diff options
Diffstat (limited to 'lib/sisu/v3/i18n.rb')
-rw-r--r-- | lib/sisu/v3/i18n.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/sisu/v3/i18n.rb b/lib/sisu/v3/i18n.rb index 0666cede..00fe7101 100644 --- a/lib/sisu/v3/i18n.rb +++ b/lib/sisu/v3/i18n.rb @@ -189,6 +189,40 @@ module SiSU_i18n self end end + class Alphabet + def initialize(lng_code) + @lng_code=lng_code + end + def hash_arrays + @alph=case @lng_code + when /en/ #english + { + u: %w[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z], + l: %w[a b c d e f g h i j k l m n o p q r s t u v w x y z] + } + when /da|no|nn/ #danish, norwegian + { + u: %w[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Å Æ Ø], + l: %w[a b c d e f g h i j k l m n o p q r s t u v w x y z å æ ø] + #u: %W[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Æ Ø Å], + #l: %w[a b c d e f g h i j k l m n o p q r s t u v w x y z æ ø å] + } + when /sv/ #swedish + { + u: %w[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Å Ä Ö], + l: %w[a b c d e f g h i j k l m n o p q r s t u v w x y z å ä ö] + } + else #english default + { + u: %w[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z], + l: %w[a b c d e f g h i j k l m n o p q r s t u v w x y z] + } + end + end + def hash_strings + { u: hash_arrays[:u].join, l: hash_arrays[:l].join } + end + end end __END__ Language Lists |