aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v2/i18n.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v2/i18n.rb')
-rw-r--r--lib/sisu/v2/i18n.rb156
1 files changed, 156 insertions, 0 deletions
diff --git a/lib/sisu/v2/i18n.rb b/lib/sisu/v2/i18n.rb
index 2aa730be..c43daabe 100644
--- a/lib/sisu/v2/i18n.rb
+++ b/lib/sisu/v2/i18n.rb
@@ -56,6 +56,90 @@
** Description: internationalisation
=end
+module SiSU_i18n
+ class Language
+ def initialize(md)
+ @md=md
+ end
+ def tex_name(char)
+ @lang=if char
+ case char
+ when 'sq'; 'albanian'
+ when 'am'; 'amharic'
+ #when 'ar'; 'arabic' # see polyglossia
+ when 'hy'; 'armenian'
+ #when ''; 'asturian' # polyglossia
+ #when ''; 'bahasai' # polyglossia
+ #when ''; 'bahasam' # polyglossia
+ when 'eu'; 'basque'
+ when 'bn'; 'bengali'
+ when 'pt_BR'; 'brazilian'
+ when 'br'; 'breton'
+ when 'bg'; 'bulgarian'
+ when 'ca'; 'catalan' # see polyglossia
+ #when ''; 'coptic' # polyglossia
+ when 'hr'; 'croatian'
+ when 'cs'; 'czech'
+ when 'da'; 'danish'
+ #when ''; 'divehi' # polyglossia
+ when 'nl'; 'dutch' # see polyglossia
+ when 'en'; 'english' # see polyglossia
+ when 'eo'; 'esperanto' # see polyglossia
+ when 'et'; 'estonian'
+ when 'gl'; 'galician'
+ when 'de'; 'german'
+ when 'el'; 'greek' #gl ?
+ when 'he'; 'hebrew'
+ when 'hi'; 'hindi'
+ when 'is'; 'icelandic'
+ when 'ia'; 'interlingua'
+ when 'ga'; 'irish'
+ when 'it'; 'italian'
+ #when ''; 'farsi' # polyglossia
+ when 'fi'; 'finnish'
+ when 'fr'; 'french'
+ when 'lo'; 'lao'
+ when 'la'; 'latin'
+ when 'lv'; 'latvian'
+ when 'lt'; 'lithuanian'
+ #when ''; 'lsorbian' # polyglossia
+ #when ''; 'magyar' # polyglossia
+ when 'ml'; 'malayalam'
+ when 'mr'; 'marathi'
+ #when 'hu'; 'magyar'
+ when 'no'; 'norske'
+ when 'nn'; 'nynorsk'
+ when 'oc'; 'occitan'
+ when 'pl'; 'polish'
+ when 'pt'; 'portuges'
+ when 'ro'; 'romanian'
+ when 'ru'; 'russian'
+ when 'se'; 'samin' #(check sami?)
+ when 'sa'; 'sanskrit'
+ when 'sr'; 'serbian'
+ #when ''; 'scottish' # polyglossia (gd (Gaelic (Scots)))
+ when 'sk'; 'slovak'
+ when 'sl'; 'slovenian'
+ when 'es'; 'spanish'
+ when 'sv'; 'swedish'
+ when 'ta'; 'tamil'
+ when 'te'; 'telugu'
+ when 'th'; 'thai'
+ when 'tr'; 'turkish'
+ when 'tk'; 'turkmen'
+ when 'uk'; 'ukrainian'
+ when 'ur'; 'urdu'
+ #when ''; 'usorbian' # polyglossia
+ when 'vi'; 'vietnamese'
+ when 'cy'; 'welsh'
+ when 'us'; 'USenglish' # depreciated, see iso-639-2
+ else 'english'
+ end
+ else 'english'
+ end
+ end
+ end
+end
module SiSU_Translate
require "#{SiSU_lib}/sysenv" # sysenv.rb
include SiSU_Env; include SiSU_Param
@@ -93,6 +177,7 @@ module SiSU_Translate
else English.new(md,doc_lang,trans_str)
end
end
+
def filename
@lang_class.filename
end
@@ -1623,3 +1708,74 @@ module SiSU_Translate
end
end
__END__
+http://www.debian.org/international/l10n/po/
+http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
+http://www.loc.gov/standards/iso639-2/php/code_list.php
+albanian sq
+amharic am
+arabic ar
+armenian hy
+asturian
+bahasai
+bahasam
+basque eu
+bengali bn
+brazil[ian] pt_BR
+breton br
+bulgarian bg
+catalan ca
+coptic
+croatian hr
+czech cs
+danish da
+divehi
+dutch nl
+english en
+esperanto eo
+estonian et
+galician gl
+german de
+greek el
+hebrew he
+hindi hi
+icelandic is
+interlingua ia
+irish ga
+italian it
+farsi
+finnish fi
+french fr
+lao lo
+latin la
+latvian lv
+lithuanian lt
+lsorbian
+magyar
+malayalam ml
+marathi mr
+norsk no
+nynorsk nn
+occitan oc
+polish pl
+portuges pt
+romanian ro
+russian ru
+samin se (check sami?)
+sanskrit sa
+scottish # (gd (Gaelic (Scots)))
+serbian sr
+slovak sk
+slovenian sl
+spanish es
+swedish sv
+syriac # (ar_SY (Arabic, as spoken in Syrian Arab Republic))
+tamil ta
+telugu te
+thai th
+turkish tr
+turkmen tk
+ukrainian uk
+urdu ur
+usorbian
+vietnamese vi
+welsh cy