Sha256: 371da0bc0ec33bacbff6a653010b982e8ae1c8d079998420f227fd11f9eef935

Contents?: true

Size: 838 Bytes

Versions: 4

Compression:

Stored size: 838 Bytes

Contents

# -*- coding: utf-8; -*-
#
# tDiary language setup: Japanese(ja)
#
# Copyright (C) 2001-2011, TADA Tadashi <t@tdtds.jp>
# You can redistribute it and/or modify it under GPL2.
#

def html_lang
	'ja-JP'
end

def encoding
	'UTF-8'
end

def encoding_old
	'EUC-JP'
end

def mobile_encoding
	'Shift_JIS'
end

def to_mobile( str )
	str.encode(mobile_encoding, {invalid: :replace, undef: :replace})
end

def to_mail( str )
	str.encode('iso-2022-jp', {invalid: :replace, undef: :replace})
end

def migrate_to_utf8( str )
	to_native( str, encoding_old )
end

def shorten( str, len = 120 )
	matched = str.gsub( /\n/, ' ' ).scan( /^.{0,#{len - 2}}/u )[0]
	if $'.nil? || $'.empty?
		matched
	else
		matched + '..'
	end
end

def comment_length
	60
end

# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tdiary-4.0.5.1 tdiary/lang/ja.rb
tdiary-4.0.5 tdiary/lang/ja.rb
tdiary-4.0.4 tdiary/lang/ja.rb
tdiary-4.0.3 tdiary/lang/ja.rb