mini-pro-pkg 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/mini-pro-pkg.gemspec +12 -0
- data/stringex-2.8.6/Gemfile +51 -0
- data/stringex-2.8.6/MIT-LICENSE +20 -0
- data/stringex-2.8.6/README.md +162 -0
- data/stringex-2.8.6/Rakefile +57 -0
- data/stringex-2.8.6/VERSION +1 -0
- data/stringex-2.8.6/init.rb +3 -0
- data/stringex-2.8.6/lib/stringex/acts_as_url/adapter/active_record.rb +23 -0
- data/stringex-2.8.6/lib/stringex/acts_as_url/adapter/base.rb +240 -0
- data/stringex-2.8.6/lib/stringex/acts_as_url/adapter/data_mapper.rb +61 -0
- data/stringex-2.8.6/lib/stringex/acts_as_url/adapter/mongoid.rb +37 -0
- data/stringex-2.8.6/lib/stringex/acts_as_url/adapter.rb +26 -0
- data/stringex-2.8.6/lib/stringex/acts_as_url.rb +107 -0
- data/stringex-2.8.6/lib/stringex/configuration/acts_as_url.rb +50 -0
- data/stringex-2.8.6/lib/stringex/configuration/base.rb +58 -0
- data/stringex-2.8.6/lib/stringex/configuration/configurator.rb +25 -0
- data/stringex-2.8.6/lib/stringex/configuration/string_extensions.rb +20 -0
- data/stringex-2.8.6/lib/stringex/configuration.rb +4 -0
- data/stringex-2.8.6/lib/stringex/configuration_lite.rb +3 -0
- data/stringex-2.8.6/lib/stringex/core_ext.rb +10 -0
- data/stringex-2.8.6/lib/stringex/localization/backend/base.rb +13 -0
- data/stringex-2.8.6/lib/stringex/localization/backend/i18n.rb +86 -0
- data/stringex-2.8.6/lib/stringex/localization/backend/internal.rb +47 -0
- data/stringex-2.8.6/lib/stringex/localization/conversion_expressions.rb +154 -0
- data/stringex-2.8.6/lib/stringex/localization/converter.rb +129 -0
- data/stringex-2.8.6/lib/stringex/localization/default_conversions.rb +89 -0
- data/stringex-2.8.6/lib/stringex/localization.rb +112 -0
- data/stringex-2.8.6/lib/stringex/rails/railtie.rb +10 -0
- data/stringex-2.8.6/lib/stringex/string_extensions.rb +228 -0
- data/stringex-2.8.6/lib/stringex/unidecoder.rb +82 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x00.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x01.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x02.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x03.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x04.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x05.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x06.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x07.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x09.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x0a.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x0b.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x0c.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x0d.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x0e.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x0f.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x10.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x11.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x12.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x13.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x14.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x15.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x16.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x17.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x18.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x1e.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x1f.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x20.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x21.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x22.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x23.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x24.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x25.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x26.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x27.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x28.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x2e.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x2f.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x30.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x31.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x32.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x33.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x4d.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x4e.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x4f.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x50.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x51.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x52.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x53.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x54.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x55.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x56.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x57.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x58.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x59.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x5a.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x5b.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x5c.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x5d.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x5e.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x5f.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x60.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x61.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x62.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x63.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x64.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x65.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x66.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x67.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x68.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x69.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x6a.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x6b.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x6c.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x6d.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x6e.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x6f.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x70.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x71.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x72.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x73.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x74.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x75.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x76.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x77.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x78.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x79.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x7a.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x7b.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x7c.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x7d.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x7e.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x7f.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x80.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x81.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x82.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x83.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x84.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x85.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x86.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x87.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x88.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x89.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x8a.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x8b.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x8c.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x8d.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x8e.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x8f.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x90.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x91.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x92.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x93.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x94.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x95.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x96.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x97.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x98.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x99.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x9a.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x9b.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x9c.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x9d.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x9e.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/x9f.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xa0.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xa1.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xa2.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xa3.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xa4.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xac.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xad.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xae.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xaf.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xb0.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xb1.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xb2.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xb3.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xb4.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xb5.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xb6.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xb7.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xb8.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xb9.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xba.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xbb.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xbc.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xbd.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xbe.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xbf.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xc0.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xc1.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xc2.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xc3.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xc4.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xc5.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xc6.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xc7.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xc8.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xc9.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xca.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xcb.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xcc.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xcd.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xce.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xcf.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xd0.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xd1.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xd2.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xd3.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xd4.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xd5.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xd6.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xd7.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xf9.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xfa.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xfb.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xfc.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xfd.yml +256 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xfe.yml +257 -0
- data/stringex-2.8.6/lib/stringex/unidecoder_data/xff.yml +257 -0
- data/stringex-2.8.6/lib/stringex/version.rb +8 -0
- data/stringex-2.8.6/lib/stringex.rb +17 -0
- data/stringex-2.8.6/lib/stringex_lite.rb +15 -0
- data/stringex-2.8.6/locales/da.yml +76 -0
- data/stringex-2.8.6/locales/de.yml +77 -0
- data/stringex-2.8.6/locales/en.yml +69 -0
- data/stringex-2.8.6/locales/fr.yml +72 -0
- data/stringex-2.8.6/locales/nb.yml +76 -0
- data/stringex-2.8.6/locales/nl.yml +69 -0
- data/stringex-2.8.6/locales/no.yml +76 -0
- data/stringex-2.8.6/locales/pl.yml +88 -0
- data/stringex-2.8.6/locales/pt-BR.yml +69 -0
- data/stringex-2.8.6/locales/ru.yml +69 -0
- data/stringex-2.8.6/locales/sv.yml +76 -0
- data/stringex-2.8.6/stringex.gemspec +290 -0
- data/stringex-2.8.6/test/performance/localization_performance_test.rb +24 -0
- data/stringex-2.8.6/test/test_helper.rb +2 -0
- data/stringex-2.8.6/test/unit/acts_as_url/adapter/activerecord.rb +71 -0
- data/stringex-2.8.6/test/unit/acts_as_url/adapter/datamapper.rb +83 -0
- data/stringex-2.8.6/test/unit/acts_as_url/adapter/mongoid.rb +82 -0
- data/stringex-2.8.6/test/unit/acts_as_url_configuration_test.rb +51 -0
- data/stringex-2.8.6/test/unit/acts_as_url_integration_test.rb +425 -0
- data/stringex-2.8.6/test/unit/localization/da_test.rb +118 -0
- data/stringex-2.8.6/test/unit/localization/de_test.rb +118 -0
- data/stringex-2.8.6/test/unit/localization/default_test.rb +115 -0
- data/stringex-2.8.6/test/unit/localization/en_test.rb +118 -0
- data/stringex-2.8.6/test/unit/localization/fr_test.rb +118 -0
- data/stringex-2.8.6/test/unit/localization/nl_test.rb +118 -0
- data/stringex-2.8.6/test/unit/localization/pl_test.rb +118 -0
- data/stringex-2.8.6/test/unit/localization/pt_br_test.rb +118 -0
- data/stringex-2.8.6/test/unit/localization/ru_test.rb +130 -0
- data/stringex-2.8.6/test/unit/localization/sv_test.rb +118 -0
- data/stringex-2.8.6/test/unit/localization_18n_failure_test.rb +40 -0
- data/stringex-2.8.6/test/unit/localization_test.rb +162 -0
- data/stringex-2.8.6/test/unit/string_extensions_configuration_test.rb +17 -0
- data/stringex-2.8.6/test/unit/string_extensions_test.rb +321 -0
- data/stringex-2.8.6/test/unit/unicode_point_suite/basic_greek_test.rb +113 -0
- data/stringex-2.8.6/test/unit/unicode_point_suite/basic_latin_test.rb +144 -0
- data/stringex-2.8.6/test/unit/unicode_point_suite/codepoint_test_helper.rb +32 -0
- data/stringex-2.8.6/test/unit/unidecoder/bad_localization.yml +1 -0
- data/stringex-2.8.6/test/unit/unidecoder/localization.yml +4 -0
- data/stringex-2.8.6/test/unit/unidecoder_test.rb +104 -0
- data/stringex-2.8.6/test/unit/version_test.rb +12 -0
- metadata +294 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
require 'stringex'
|
|
5
|
+
|
|
6
|
+
class DefaultLocalizationTest < Test::Unit::TestCase
|
|
7
|
+
def setup
|
|
8
|
+
Stringex::Localization.reset!
|
|
9
|
+
Stringex::Localization.backend = :internal
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
{
|
|
13
|
+
"foo & bar" => "foo and bar",
|
|
14
|
+
"AT&T" => "AT and T",
|
|
15
|
+
"99° is normal" => "99 degrees is normal",
|
|
16
|
+
"4 ÷ 2 is 2" => "4 divided by 2 is 2",
|
|
17
|
+
"webcrawler.com" => "webcrawler dot com",
|
|
18
|
+
"Well..." => "Well dot dot dot",
|
|
19
|
+
"x=1" => "x equals 1",
|
|
20
|
+
"a #2 pencil" => "a number 2 pencil",
|
|
21
|
+
"100%" => "100 percent",
|
|
22
|
+
"cost+tax" => "cost plus tax",
|
|
23
|
+
"batman/robin fan fiction" => "batman slash robin fan fiction",
|
|
24
|
+
"dial *69" => "dial star 69",
|
|
25
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
|
26
|
+
}.each do |original, converted|
|
|
27
|
+
define_method "test_character_conversion: '#{original}'" do
|
|
28
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
"¤20" => "20 dollars",
|
|
34
|
+
"$100" => "100 dollars",
|
|
35
|
+
"$19.99" => "19 dollars 99 cents",
|
|
36
|
+
"£100" => "100 pounds",
|
|
37
|
+
"£19.99" => "19 pounds 99 pence",
|
|
38
|
+
"€100" => "100 euros",
|
|
39
|
+
"€19.99" => "19 euros 99 cents",
|
|
40
|
+
"¥1000" => "1000 yen"
|
|
41
|
+
}.each do |original, converted|
|
|
42
|
+
define_method "test_currency_conversion: '#{original}'" do
|
|
43
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
{
|
|
48
|
+
"Tea & Sympathy" => "Tea and Sympathy",
|
|
49
|
+
"10¢" => "10 cents",
|
|
50
|
+
"©2000" => "(c)2000",
|
|
51
|
+
"98° is fine" => "98 degrees is fine",
|
|
52
|
+
"10÷5" => "10 divided by 5",
|
|
53
|
+
""quoted"" => '"quoted"',
|
|
54
|
+
"to be continued…" => "to be continued...",
|
|
55
|
+
"2000–2004" => "2000-2004",
|
|
56
|
+
"I wish—oh, never mind" => "I wish--oh, never mind",
|
|
57
|
+
"½ ounce of gold" => "half ounce of gold",
|
|
58
|
+
"1 and ¼ ounces of silver" => "1 and one fourth ounces of silver",
|
|
59
|
+
"9 and ¾ ounces of platinum" => "9 and three fourths ounces of platinum",
|
|
60
|
+
"3>2" => "3>2",
|
|
61
|
+
"2<3" => "2<3",
|
|
62
|
+
"two words" => "two words",
|
|
63
|
+
"£100" => "pounds 100",
|
|
64
|
+
"Walmart®" => "Walmart(r)",
|
|
65
|
+
"'single quoted'" => "'single quoted'",
|
|
66
|
+
"2×4" => "2x4",
|
|
67
|
+
"Programming™" => "Programming(tm)",
|
|
68
|
+
"¥20000" => "yen 20000",
|
|
69
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
|
70
|
+
}.each do |original, converted|
|
|
71
|
+
define_method "test_html_entity_conversion: '#{original}'" do
|
|
72
|
+
assert_equal converted, original.convert_miscellaneous_html_entities
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
{
|
|
77
|
+
"½" => "half",
|
|
78
|
+
"½" => "half",
|
|
79
|
+
"½" => "half",
|
|
80
|
+
"⅓" => "one third",
|
|
81
|
+
"⅓" => "one third",
|
|
82
|
+
"⅔" => "two thirds",
|
|
83
|
+
"⅔" => "two thirds",
|
|
84
|
+
"¼" => "one fourth",
|
|
85
|
+
"¼" => "one fourth",
|
|
86
|
+
"¼" => "one fourth",
|
|
87
|
+
"¾" => "three fourths",
|
|
88
|
+
"¾" => "three fourths",
|
|
89
|
+
"¾" => "three fourths",
|
|
90
|
+
"⅕" => "one fifth",
|
|
91
|
+
"⅕" => "one fifth",
|
|
92
|
+
"⅖" => "two fifths",
|
|
93
|
+
"⅖" => "two fifths",
|
|
94
|
+
"⅗" => "three fifths",
|
|
95
|
+
"⅗" => "three fifths",
|
|
96
|
+
"⅘" => "four fifths",
|
|
97
|
+
"⅘" => "four fifths",
|
|
98
|
+
"⅙" => "one sixth",
|
|
99
|
+
"⅙" => "one sixth",
|
|
100
|
+
"⅚" => "five sixths",
|
|
101
|
+
"⅚" => "five sixths",
|
|
102
|
+
"⅛" => "one eighth",
|
|
103
|
+
"⅛" => "one eighth",
|
|
104
|
+
"⅜" => "three eighths",
|
|
105
|
+
"⅜" => "three eighths",
|
|
106
|
+
"⅝" => "five eighths",
|
|
107
|
+
"⅝" => "five eighths",
|
|
108
|
+
"⅞" => "seven eighths",
|
|
109
|
+
"⅞" => "seven eighths"
|
|
110
|
+
}.each do |original, converted|
|
|
111
|
+
define_method "test_vulgar_fractions_conversion: #{original}" do
|
|
112
|
+
assert_equal converted, original.convert_vulgar_fractions
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
require 'i18n'
|
|
5
|
+
require 'stringex'
|
|
6
|
+
|
|
7
|
+
class EnglishYAMLLocalizationTest < Test::Unit::TestCase
|
|
8
|
+
def setup
|
|
9
|
+
Stringex::Localization.reset!
|
|
10
|
+
Stringex::Localization.backend = :i18n
|
|
11
|
+
Stringex::Localization.backend.load_translations :en
|
|
12
|
+
Stringex::Localization.locale = :en
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
{
|
|
16
|
+
"foo & bar" => "foo and bar",
|
|
17
|
+
"AT&T" => "AT and T",
|
|
18
|
+
"99° is normal" => "99 degrees is normal",
|
|
19
|
+
"4 ÷ 2 is 2" => "4 divided by 2 is 2",
|
|
20
|
+
"webcrawler.com" => "webcrawler dot com",
|
|
21
|
+
"Well..." => "Well dot dot dot",
|
|
22
|
+
"x=1" => "x equals 1",
|
|
23
|
+
"a #2 pencil" => "a number 2 pencil",
|
|
24
|
+
"100%" => "100 percent",
|
|
25
|
+
"cost+tax" => "cost plus tax",
|
|
26
|
+
"batman/robin fan fiction" => "batman slash robin fan fiction",
|
|
27
|
+
"dial *69" => "dial star 69",
|
|
28
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
|
29
|
+
}.each do |original, converted|
|
|
30
|
+
define_method "test_character_conversion: '#{original}'" do
|
|
31
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
"¤20" => "20 pounds",
|
|
37
|
+
"$100" => "100 dollars",
|
|
38
|
+
"$19.99" => "19 dollars 99 cents",
|
|
39
|
+
"£100" => "100 pounds",
|
|
40
|
+
"£19.99" => "19 pounds 99 pence",
|
|
41
|
+
"€100" => "100 euros",
|
|
42
|
+
"€19.99" => "19 euros 99 cents",
|
|
43
|
+
"¥1000" => "1000 yen"
|
|
44
|
+
}.each do |original, converted|
|
|
45
|
+
define_method "test_currency_conversion: '#{original}'" do
|
|
46
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
{
|
|
51
|
+
"Tea & Sympathy" => "Tea and Sympathy",
|
|
52
|
+
"10¢" => "10 cents",
|
|
53
|
+
"©2000" => "(c)2000",
|
|
54
|
+
"98° is fine" => "98 degrees is fine",
|
|
55
|
+
"10÷5" => "10 divided by 5",
|
|
56
|
+
""quoted"" => '"quoted"',
|
|
57
|
+
"to be continued…" => "to be continued...",
|
|
58
|
+
"2000–2004" => "2000-2004",
|
|
59
|
+
"I wish—oh, never mind" => "I wish--oh, never mind",
|
|
60
|
+
"½ ounce of gold" => "half ounce of gold",
|
|
61
|
+
"1 and ¼ ounces of silver" => "1 and one fourth ounces of silver",
|
|
62
|
+
"9 and ¾ ounces of platinum" => "9 and three fourths ounces of platinum",
|
|
63
|
+
"3>2" => "3>2",
|
|
64
|
+
"2<3" => "2<3",
|
|
65
|
+
"two words" => "two words",
|
|
66
|
+
"£100" => "pounds 100",
|
|
67
|
+
"Walmart®" => "Walmart(r)",
|
|
68
|
+
"'single quoted'" => "'single quoted'",
|
|
69
|
+
"2×4" => "2x4",
|
|
70
|
+
"Programming™" => "Programming(tm)",
|
|
71
|
+
"¥20000" => "yen 20000",
|
|
72
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
|
73
|
+
}.each do |original, converted|
|
|
74
|
+
define_method "test_html_entity_conversion: '#{original}'" do
|
|
75
|
+
assert_equal converted, original.convert_miscellaneous_html_entities
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
{
|
|
80
|
+
"½" => "half",
|
|
81
|
+
"½" => "half",
|
|
82
|
+
"½" => "half",
|
|
83
|
+
"⅓" => "one third",
|
|
84
|
+
"⅓" => "one third",
|
|
85
|
+
"⅔" => "two thirds",
|
|
86
|
+
"⅔" => "two thirds",
|
|
87
|
+
"¼" => "one fourth",
|
|
88
|
+
"¼" => "one fourth",
|
|
89
|
+
"¼" => "one fourth",
|
|
90
|
+
"¾" => "three fourths",
|
|
91
|
+
"¾" => "three fourths",
|
|
92
|
+
"¾" => "three fourths",
|
|
93
|
+
"⅕" => "one fifth",
|
|
94
|
+
"⅕" => "one fifth",
|
|
95
|
+
"⅖" => "two fifths",
|
|
96
|
+
"⅖" => "two fifths",
|
|
97
|
+
"⅗" => "three fifths",
|
|
98
|
+
"⅗" => "three fifths",
|
|
99
|
+
"⅘" => "four fifths",
|
|
100
|
+
"⅘" => "four fifths",
|
|
101
|
+
"⅙" => "one sixth",
|
|
102
|
+
"⅙" => "one sixth",
|
|
103
|
+
"⅚" => "five sixths",
|
|
104
|
+
"⅚" => "five sixths",
|
|
105
|
+
"⅛" => "one eighth",
|
|
106
|
+
"⅛" => "one eighth",
|
|
107
|
+
"⅜" => "three eighths",
|
|
108
|
+
"⅜" => "three eighths",
|
|
109
|
+
"⅝" => "five eighths",
|
|
110
|
+
"⅝" => "five eighths",
|
|
111
|
+
"⅞" => "seven eighths",
|
|
112
|
+
"⅞" => "seven eighths"
|
|
113
|
+
}.each do |original, converted|
|
|
114
|
+
define_method "test_vulgar_fractions_conversion: #{original}" do
|
|
115
|
+
assert_equal converted, original.convert_vulgar_fractions
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
require 'i18n'
|
|
5
|
+
require 'stringex'
|
|
6
|
+
|
|
7
|
+
class FrenchYAMLLocalizationTest < Test::Unit::TestCase
|
|
8
|
+
def setup
|
|
9
|
+
Stringex::Localization.reset!
|
|
10
|
+
Stringex::Localization.backend = :i18n
|
|
11
|
+
Stringex::Localization.backend.load_translations :fr
|
|
12
|
+
Stringex::Localization.locale = :fr
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
{
|
|
16
|
+
"foo & bar" => "foo et bar",
|
|
17
|
+
"AT&T" => "AT et T",
|
|
18
|
+
"99° est normal" => "99 degrés est normal",
|
|
19
|
+
"4 ÷ 2 is 2" => "4 divisé par 2 is 2",
|
|
20
|
+
"webcrawler.com" => "webcrawler point com",
|
|
21
|
+
"Well..." => "Well point point point",
|
|
22
|
+
"x=1" => "x égal 1",
|
|
23
|
+
"a #2 pencil" => "a numéro 2 pencil",
|
|
24
|
+
"100%" => "100 pourcent",
|
|
25
|
+
"cost+tax" => "cost plus tax",
|
|
26
|
+
"batman/robin fan fiction" => "batman slash robin fan fiction",
|
|
27
|
+
"dial *69" => "dial étoile 69",
|
|
28
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
|
29
|
+
}.each do |original, converted|
|
|
30
|
+
define_method "test_character_conversion: '#{original}'" do
|
|
31
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
"¤20" => "20 livres",
|
|
37
|
+
"$100" => "100 dollars",
|
|
38
|
+
"$19.99" => "19 dollars 99 cents",
|
|
39
|
+
"£100" => "100 livres",
|
|
40
|
+
"£19.99" => "19 livres 99 pennies",
|
|
41
|
+
"€100" => "100 euros",
|
|
42
|
+
"€19.99" => "19 euros 99 cents",
|
|
43
|
+
"¥1000" => "1000 yen"
|
|
44
|
+
}.each do |original, converted|
|
|
45
|
+
define_method "test_currency_conversion: '#{original}'" do
|
|
46
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
{
|
|
51
|
+
"Tea & Sympathy" => "Tea et Sympathy",
|
|
52
|
+
"10¢" => "10 cents",
|
|
53
|
+
"©2000" => "(c)2000",
|
|
54
|
+
"98° is fine" => "98 degrés is fine",
|
|
55
|
+
"10÷5" => "10 divisé par 5",
|
|
56
|
+
""quoted"" => '"quoted"',
|
|
57
|
+
"to be continued…" => "to be continued...",
|
|
58
|
+
"2000–2004" => "2000-2004",
|
|
59
|
+
"I wish—oh, never mind" => "I wish--oh, never mind",
|
|
60
|
+
"½ ounce of gold" => "un demi ounce of gold",
|
|
61
|
+
"1 et ¼ d'once de platinium" => "1 et un quart d'once de platinium",
|
|
62
|
+
"9 et ¾ d'once de platinium" => "9 et trois quarts d'once de platinium",
|
|
63
|
+
"3>2" => "3>2",
|
|
64
|
+
"2<3" => "2<3",
|
|
65
|
+
"two words" => "two words",
|
|
66
|
+
"£100" => "livres 100",
|
|
67
|
+
"Walmart®" => "Walmart(r)",
|
|
68
|
+
"'single quoted'" => "'single quoted'",
|
|
69
|
+
"2×4" => "2x4",
|
|
70
|
+
"Programming™" => "Programming(tm)",
|
|
71
|
+
"¥20000" => "yen 20000",
|
|
72
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
|
73
|
+
}.each do |original, converted|
|
|
74
|
+
define_method "test_html_entity_conversion: '#{original}'" do
|
|
75
|
+
assert_equal converted, original.convert_miscellaneous_html_entities
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
{
|
|
80
|
+
"½" => "un demi",
|
|
81
|
+
"½" => "un demi",
|
|
82
|
+
"½" => "un demi",
|
|
83
|
+
"⅓" => "un tiers",
|
|
84
|
+
"⅓" => "un tiers",
|
|
85
|
+
"⅔" => "deux tiers",
|
|
86
|
+
"⅔" => "deux tiers",
|
|
87
|
+
"¼" => "un quart",
|
|
88
|
+
"¼" => "un quart",
|
|
89
|
+
"¼" => "un quart",
|
|
90
|
+
"¾" => "trois quarts",
|
|
91
|
+
"¾" => "trois quarts",
|
|
92
|
+
"¾" => "trois quarts",
|
|
93
|
+
"⅕" => "un cinquième",
|
|
94
|
+
"⅕" => "un cinquième",
|
|
95
|
+
"⅖" => "deux cinquièmes",
|
|
96
|
+
"⅖" => "deux cinquièmes",
|
|
97
|
+
"⅗" => "trois cinquièmes",
|
|
98
|
+
"⅗" => "trois cinquièmes",
|
|
99
|
+
"⅘" => "quatre cinquièmes",
|
|
100
|
+
"⅘" => "quatre cinquièmes",
|
|
101
|
+
"⅙" => "un sixième",
|
|
102
|
+
"⅙" => "un sixième",
|
|
103
|
+
"⅚" => "cinq sixièmes",
|
|
104
|
+
"⅚" => "cinq sixièmes",
|
|
105
|
+
"⅛" => "un huitième",
|
|
106
|
+
"⅛" => "un huitième",
|
|
107
|
+
"⅜" => "trois huitièmes",
|
|
108
|
+
"⅜" => "trois huitièmes",
|
|
109
|
+
"⅝" => "cinq huitièmes",
|
|
110
|
+
"⅝" => "cinq huitièmes",
|
|
111
|
+
"⅞" => "sept huitièmes",
|
|
112
|
+
"⅞" => "sept huitièmes"
|
|
113
|
+
}.each do |original, converted|
|
|
114
|
+
define_method "test_vulgar_fractions_conversion: #{original}" do
|
|
115
|
+
assert_equal converted, original.convert_vulgar_fractions
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
require 'i18n'
|
|
5
|
+
require 'stringex'
|
|
6
|
+
|
|
7
|
+
class DutchYAMLLocalizationTest < Test::Unit::TestCase
|
|
8
|
+
def setup
|
|
9
|
+
Stringex::Localization.reset!
|
|
10
|
+
Stringex::Localization.backend = :i18n
|
|
11
|
+
Stringex::Localization.backend.load_translations :nl
|
|
12
|
+
Stringex::Localization.locale = :nl
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
{
|
|
16
|
+
"foo & bar" => "foo en bar",
|
|
17
|
+
"AT&T" => "AT en T",
|
|
18
|
+
"99° is normaal" => "99 graden is normaal",
|
|
19
|
+
"4 ÷ 2 is 2" => "4 gedeeld door 2 is 2",
|
|
20
|
+
"webcrawler.com" => "webcrawler punt com",
|
|
21
|
+
"Dus..." => "Dus punt punt punt",
|
|
22
|
+
"x=1" => "x is 1",
|
|
23
|
+
"Een potlood #2" => "Een potlood nummer 2",
|
|
24
|
+
"100%" => "100 procent",
|
|
25
|
+
"prijs+belasting" => "prijs plus belasting",
|
|
26
|
+
"Batman/Robin fan fiction" => "Batman slash Robin fan fiction",
|
|
27
|
+
"bel *69" => "bel ster 69",
|
|
28
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
|
29
|
+
}.each do |original, converted|
|
|
30
|
+
define_method "test_character_conversion: '#{original}'" do
|
|
31
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
"¤20" => "20 euro",
|
|
37
|
+
"$100" => "100 dollar",
|
|
38
|
+
"$19.99" => "19 dollar 99 cent",
|
|
39
|
+
"£100" => "100 pond",
|
|
40
|
+
"£19.99" => "19 pond 99 pence",
|
|
41
|
+
"€100" => "100 euro",
|
|
42
|
+
"€19.99" => "19 euro 99 cent",
|
|
43
|
+
"¥1000" => "1000 yen"
|
|
44
|
+
}.each do |original, converted|
|
|
45
|
+
define_method "test_currency_conversion: '#{original}'" do
|
|
46
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
{
|
|
51
|
+
"Appels & peren" => "Appels en peren",
|
|
52
|
+
"10¢" => "10 cent",
|
|
53
|
+
"©2000" => "(c)2000",
|
|
54
|
+
"98° is acceptabel" => "98 graden is acceptabel",
|
|
55
|
+
"10÷5" => "10 gedeeld door 5",
|
|
56
|
+
""tussen aanhalingstekens"" => '"tussen aanhalingstekens"',
|
|
57
|
+
"wordt vervolgd…" => "wordt vervolgd...",
|
|
58
|
+
"2000–2004" => "2000-2004",
|
|
59
|
+
"Ik wil—oh, laat maar" => "Ik wil--oh, laat maar",
|
|
60
|
+
"½ ons goud" => "half ons goud",
|
|
61
|
+
"1 en ¼ ons zilver" => "1 en eenvierde ons zilver",
|
|
62
|
+
"9 en ¾ ons platina" => "9 en drievierde ons platina",
|
|
63
|
+
"3>2" => "3>2",
|
|
64
|
+
"2<3" => "2<3",
|
|
65
|
+
"twee woorden" => "twee woorden",
|
|
66
|
+
"100£" => "100 pond",
|
|
67
|
+
"Walmart®" => "Walmart(r)",
|
|
68
|
+
"'enkele aanhalingstekens'" => "'enkele aanhalingstekens'",
|
|
69
|
+
"2×4" => "2x4",
|
|
70
|
+
"Programming™" => "Programming(tm)",
|
|
71
|
+
"20000¥" => "20000 yen",
|
|
72
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
|
73
|
+
}.each do |original, converted|
|
|
74
|
+
define_method "test_html_entity_conversion: '#{original}'" do
|
|
75
|
+
assert_equal converted, original.convert_miscellaneous_html_entities
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
{
|
|
80
|
+
"½" => "half",
|
|
81
|
+
"½" => "half",
|
|
82
|
+
"½" => "half",
|
|
83
|
+
"⅓" => "eenderde",
|
|
84
|
+
"⅓" => "eenderde",
|
|
85
|
+
"⅔" => "tweederde",
|
|
86
|
+
"⅔" => "tweederde",
|
|
87
|
+
"¼" => "eenvierde",
|
|
88
|
+
"¼" => "eenvierde",
|
|
89
|
+
"¼" => "eenvierde",
|
|
90
|
+
"¾" => "drievierde",
|
|
91
|
+
"¾" => "drievierde",
|
|
92
|
+
"¾" => "drievierde",
|
|
93
|
+
"⅕" => "eenvijfde",
|
|
94
|
+
"⅕" => "eenvijfde",
|
|
95
|
+
"⅖" => "tweevijfde",
|
|
96
|
+
"⅖" => "tweevijfde",
|
|
97
|
+
"⅗" => "drievijfde",
|
|
98
|
+
"⅗" => "drievijfde",
|
|
99
|
+
"⅘" => "viervijfde",
|
|
100
|
+
"⅘" => "viervijfde",
|
|
101
|
+
"⅙" => "eenzesde",
|
|
102
|
+
"⅙" => "eenzesde",
|
|
103
|
+
"⅚" => "vijfzesde",
|
|
104
|
+
"⅚" => "vijfzesde",
|
|
105
|
+
"⅛" => "eenachtste",
|
|
106
|
+
"⅛" => "eenachtste",
|
|
107
|
+
"⅜" => "drieachtste",
|
|
108
|
+
"⅜" => "drieachtste",
|
|
109
|
+
"⅝" => "vijfachtste",
|
|
110
|
+
"⅝" => "vijfachtste",
|
|
111
|
+
"⅞" => "zevenachtste",
|
|
112
|
+
"⅞" => "zevenachtste"
|
|
113
|
+
}.each do |original, converted|
|
|
114
|
+
define_method "test_vulgar_fractions_conversion: #{original}" do
|
|
115
|
+
assert_equal converted, original.convert_vulgar_fractions
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require 'test_helper'
|
|
4
|
+
require 'i18n'
|
|
5
|
+
require 'stringex'
|
|
6
|
+
|
|
7
|
+
class PolishYAMLLocalizationTest < Test::Unit::TestCase
|
|
8
|
+
def setup
|
|
9
|
+
Stringex::Localization.reset!
|
|
10
|
+
Stringex::Localization.backend = :i18n
|
|
11
|
+
Stringex::Localization.backend.load_translations :pl
|
|
12
|
+
Stringex::Localization.locale = :pl
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
{
|
|
16
|
+
"foo & bar" => "foo i bar",
|
|
17
|
+
"AT&T" => "AT i T",
|
|
18
|
+
"99° is normal" => "99 stopni is normal",
|
|
19
|
+
"4 ÷ 2 is 2" => "4 podzielone przez 2 is 2",
|
|
20
|
+
"webcrawler.com" => "webcrawler kropka com",
|
|
21
|
+
"Well..." => "Well kropka kropka kropka",
|
|
22
|
+
"x=1" => "x równy 1",
|
|
23
|
+
"a #2 pencil" => "a numer 2 pencil",
|
|
24
|
+
"100%" => "100 procent",
|
|
25
|
+
"cost+tax" => "cost plus tax",
|
|
26
|
+
"batman/robin fan fiction" => "batman ukośnik robin fan fiction",
|
|
27
|
+
"dial *69" => "dial gwiazdka 69",
|
|
28
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
|
29
|
+
}.each do |original, converted|
|
|
30
|
+
define_method "test_character_conversion: '#{original}'" do
|
|
31
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
{
|
|
36
|
+
"¤20" => "20 złotych",
|
|
37
|
+
"$100" => "100 dolarów",
|
|
38
|
+
"$19.99" => "19 dolarów 99 centów",
|
|
39
|
+
"£100" => "100 funtów",
|
|
40
|
+
"£19.99" => "19 funtów 99 pensów",
|
|
41
|
+
"€100" => "100 euro",
|
|
42
|
+
"€19.99" => "19 euro 99 centów",
|
|
43
|
+
"¥1000" => "1000 jenów"
|
|
44
|
+
}.each do |original, converted|
|
|
45
|
+
define_method "test_currency_conversion: '#{original}'" do
|
|
46
|
+
assert_equal converted, original.convert_miscellaneous_characters
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
{
|
|
51
|
+
"Tea & Sympathy" => "Tea i Sympathy",
|
|
52
|
+
"10¢" => "10 centów",
|
|
53
|
+
"©2000" => "(c)2000",
|
|
54
|
+
"98° is fine" => "98 stopni is fine",
|
|
55
|
+
"10÷5" => "10 podzielone przez 5",
|
|
56
|
+
""quoted"" => '"quoted"',
|
|
57
|
+
"to be continued…" => "to be continued...",
|
|
58
|
+
"2000–2004" => "2000-2004",
|
|
59
|
+
"I wish—oh, never mind" => "I wish--oh, never mind",
|
|
60
|
+
"½ ounce of gold" => "pół ounce of gold",
|
|
61
|
+
"1 and ¼ ounces of silver" => "1 and jedna czwarta ounces of silver",
|
|
62
|
+
"9 and ¾ ounces of platinum" => "9 and trzy czwarte ounces of platinum",
|
|
63
|
+
"3>2" => "3>2",
|
|
64
|
+
"2<3" => "2<3",
|
|
65
|
+
"two words" => "two words",
|
|
66
|
+
"£100" => "funtów 100",
|
|
67
|
+
"Walmart®" => "Walmart(r)",
|
|
68
|
+
"'single quoted'" => "'single quoted'",
|
|
69
|
+
"2×4" => "2x4",
|
|
70
|
+
"Programming™" => "Programming(TM)",
|
|
71
|
+
"¥20000" => "jen 20000",
|
|
72
|
+
" i leave whitespace on ends unchanged " => " i leave whitespace on ends unchanged "
|
|
73
|
+
}.each do |original, converted|
|
|
74
|
+
define_method "test_html_entity_conversion: '#{original}'" do
|
|
75
|
+
assert_equal converted, original.convert_miscellaneous_html_entities
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
{
|
|
80
|
+
"½" => "pół",
|
|
81
|
+
"½" => "pół",
|
|
82
|
+
"½" => "pół",
|
|
83
|
+
"⅓" => "jedna trzecia",
|
|
84
|
+
"⅓" => "jedna trzecia",
|
|
85
|
+
"⅔" => "dwie trzecie",
|
|
86
|
+
"⅔" => "dwie trzecie",
|
|
87
|
+
"¼" => "jedna czwarta",
|
|
88
|
+
"¼" => "jedna czwarta",
|
|
89
|
+
"¼" => "jedna czwarta",
|
|
90
|
+
"¾" => "trzy czwarte",
|
|
91
|
+
"¾" => "trzy czwarte",
|
|
92
|
+
"¾" => "trzy czwarte",
|
|
93
|
+
"⅕" => "jedna piąta",
|
|
94
|
+
"⅕" => "jedna piąta",
|
|
95
|
+
"⅖" => "dwie piąte",
|
|
96
|
+
"⅖" => "dwie piąte",
|
|
97
|
+
"⅗" => "trzy piąte",
|
|
98
|
+
"⅗" => "trzy piąte",
|
|
99
|
+
"⅘" => "cztery piąte",
|
|
100
|
+
"⅘" => "cztery piąte",
|
|
101
|
+
"⅙" => "jedna szósta",
|
|
102
|
+
"⅙" => "jedna szósta",
|
|
103
|
+
"⅚" => "pięć szóstych",
|
|
104
|
+
"⅚" => "pięć szóstych",
|
|
105
|
+
"⅛" => "jedna ósma",
|
|
106
|
+
"⅛" => "jedna ósma",
|
|
107
|
+
"⅜" => "trzy ósme",
|
|
108
|
+
"⅜" => "trzy ósme",
|
|
109
|
+
"⅝" => "pięć ósmych",
|
|
110
|
+
"⅝" => "pięć ósmych",
|
|
111
|
+
"⅞" => "siedem ósmych",
|
|
112
|
+
"⅞" => "siedem ósmych"
|
|
113
|
+
}.each do |original, converted|
|
|
114
|
+
define_method "test_vulgar_fractions_conversion: #{original}" do
|
|
115
|
+
assert_equal converted, original.convert_vulgar_fractions
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|