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 PolishYAMLLocalizationTest < Test::Unit::TestCase
def setup
Stringex::Localization.reset!
Stringex::Localization.backend = :i18n
Stringex::Localization.backend.load_translations :pl
Stringex::Localization.locale = :pl
end
{
"foo & bar" => "foo i bar",
"AT&T" => "AT i T",
"99° is normal" => "99 stopni is normal",
"4 ÷ 2 is 2" => "4 podzielone przez 2 is 2",
"webcrawler.com" => "webcrawler kropka com",
"Well..." => "Well kropka kropka kropka",
"x=1" => "x równy 1",
"a #2 pencil" => "a numer 2 pencil",
"100%" => "100 procent",
"cost+tax" => "cost plus tax",
"batman/robin fan fiction" => "batman ukośnik robin fan fiction",
"dial *69" => "dial gwiazdka 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 złotych",
"$100" => "100 dolarów",
"$19.99" => "19 dolarów 99 centów",
"£100" => "100 funtów",
"£19.99" => "19 funtów 99 pensów",
"€100" => "100 euro",
"€19.99" => "19 euro 99 centów",
"¥1000" => "1000 jenów"
}.each do |original, converted|
define_method "test_currency_conversion: '#{original}'" do
assert_equal converted, original.convert_miscellaneous_characters
end
end
{
"Tea & Sympathy" => "Tea i Sympathy",
"10¢" => "10 centów",
"©2000" => "(c)2000",
"98° is fine" => "98 stopni is fine",
"10÷5" => "10 podzielone przez 5",
""quoted"" => '"quoted"',
"to be continued…" => "to be continued...",
"2000–2004" => "2000-2004",
"I wish—oh, never mind" => "I wish--oh, never mind",
"½ ounce of gold" => "pół ounce of gold",
"1 and ¼ ounces of silver" => "1 and jedna czwarta ounces of silver",
"9 and ¾ ounces of platinum" => "9 and trzy czwarte ounces of platinum",
"3>2" => "3>2",
"2<3" => "2<3",
"two words" => "two words",
"£100" => "funtów 100",
"Walmart®" => "Walmart(r)",
"'single quoted'" => "'single quoted'",
"2×4" => "2x4",
"Programming™" => "Programming(TM)",
"¥20000" => "jen 20000",
" 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
{
"½" => "pół",
"½" => "pół",
"½" => "pół",
"⅓" => "jedna trzecia",
"⅓" => "jedna trzecia",
"⅔" => "dwie trzecie",
"⅔" => "dwie trzecie",
"¼" => "jedna czwarta",
"¼" => "jedna czwarta",
"¼" => "jedna czwarta",
"¾" => "trzy czwarte",
"¾" => "trzy czwarte",
"¾" => "trzy czwarte",
"⅕" => "jedna piąta",
"⅕" => "jedna piąta",
"⅖" => "dwie piąte",
"⅖" => "dwie piąte",
"⅗" => "trzy piąte",
"⅗" => "trzy piąte",
"⅘" => "cztery piąte",
"⅘" => "cztery piąte",
"⅙" => "jedna szósta",
"⅙" => "jedna szósta",
"⅚" => "pięć szóstych",
"⅚" => "pięć szóstych",
"⅛" => "jedna ósma",
"⅛" => "jedna ósma",
"⅜" => "trzy ósme",
"⅜" => "trzy ósme",
"⅝" => "pięć ósmych",
"⅝" => "pięć ósmych",
"⅞" => "siedem ósmych",
"⅞" => "siedem ósmych"
}.each do |original, converted|
define_method "test_vulgar_fractions_conversion: #{original}" do
assert_equal converted, original.convert_vulgar_fractions
end
end
end
|