1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
# encoding: UTF-8
require 'test_helper'
require 'i18n'
require 'stringex'
class GermanYAMLLocalizationTest < Test::Unit::TestCase
def setup
Stringex::Localization.reset!
Stringex::Localization.backend = :i18n
Stringex::Localization.backend.load_translations :de
Stringex::Localization.locale = :de
end
{
"foo & bar" => "foo und bar",
"AT&T" => "AT und T",
"99° sind normal" => "99 Grad sind normal",
"4 ÷ 2 ist 2" => "4 geteilt durch 2 ist 2",
"webcrawler.com" => "webcrawler Punkt com",
"Nun..." => "Nun Punkt Punkt Punkt",
"x=1" => "x gleich 1",
"Ein #2 Stift" => "Ein Nummer 2 Stift",
"100%" => "100 Prozent",
"Kosten+Steuern" => "Kosten plus Steuern",
"Batman/Robin Fan Fiction" => "Batman Strich Robin Fan Fiction",
"Wähle *69" => "Wähle Stern 69",
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
}.each do |original, converted|
define_method "test_character_conversion: '#{original}'" do
assert_equal converted, original.convert_miscellaneous_characters
end
end
{
"¤20" => "20 Euro",
"$100" => "100 Dollar",
"$19.99" => "19 Dollar 99 Cent",
"£100" => "100 Pfund",
"£19.99" => "19 Pfund 99 Pence",
"€100" => "100 Euro",
"€19.99" => "19 Euro 99 Cent",
"¥1000" => "1000 Yen"
}.each do |original, converted|
define_method "test_currency_conversion: '#{original}'" do
assert_equal converted, original.convert_miscellaneous_characters
end
end
{
"Hennes & Mauritz" => "Hennes und Mauritz",
"10¢" => "10 Cent",
"©2000" => "(C)2000",
"98° sind ok" => "98 Grad sind ok",
"10÷5" => "10 geteilt durch 5",
""zitiert"" => '"zitiert"',
"Fortsetzung folgt…" => "Fortsetzung folgt...",
"2000–2004" => "2000-2004",
"Ich wünschte—oh, ach nichts" => "Ich wünschte--oh, ach nichts",
"½ Unze Gold" => "halbe(r) Unze Gold",
"1 und ¼ Unzen Silber" => "1 und ein Viertel Unzen Silber",
"9 und ¾ Unzen Platin" => "9 und drei Viertel Unzen Platin",
"3>2" => "3>2",
"2<3" => "2<3",
"zwei Worte" => "zwei Worte",
"100£" => "100 Pfund",
"Walmart®" => "Walmart(R)",
"'einfach zitiert'" => "'einfach zitiert'",
"2×4" => "2x4",
"Programming™" => "Programming(TM)",
"20000¥" => "20000 Yen",
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
}.each do |original, converted|
define_method "test_html_entity_conversion: '#{original}'" do
assert_equal converted, original.convert_miscellaneous_html_entities
end
end
{
"½" => "halbe(r)",
"½" => "halbe(r)",
"½" => "halbe(r)",
"⅓" => "ein Drittel",
"⅓" => "ein Drittel",
"⅔" => "zwei Drittel",
"⅔" => "zwei Drittel",
"¼" => "ein Viertel",
"¼" => "ein Viertel",
"¼" => "ein Viertel",
"¾" => "drei Viertel",
"¾" => "drei Viertel",
"¾" => "drei Viertel",
"⅕" => "ein Fünftel",
"⅕" => "ein Fünftel",
"⅖" => "zwei Fünftel",
"⅖" => "zwei Fünftel",
"⅗" => "drei Fünftel",
"⅗" => "drei Fünftel",
"⅘" => "vier Fünftel",
"⅘" => "vier Fünftel",
"⅙" => "ein Sechstel",
"⅙" => "ein Sechstel",
"⅚" => "fünf Sechstel",
"⅚" => "fünf Sechstel",
"⅛" => "ein Achtel",
"⅛" => "ein Achtel",
"⅜" => "drei Achtel",
"⅜" => "drei Achtel",
"⅝" => "fünf Achtel",
"⅝" => "fünf Achtel",
"⅞" => "sieben Achtel",
"⅞" => "sieben Achtel"
}.each do |original, converted|
define_method "test_vulgar_fractions_conversion: #{original}" do
assert_equal converted, original.convert_vulgar_fractions
end
end
end
|