Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix [54a5088] where the i18n gem was wrongly updated to 0.4.1.

I've tested and confirm that `2-3-stable` will use the vendored `i18n` gem if there's no `i18n` gem with version >= 0.4.1 installed

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 69c4e4ce65a509fdce60fc8de6d5d352a269cdff 1 parent 80473e0
@sikachu sikachu authored josevalim committed
Showing with 0 additions and 4,326 deletions.
  1. +0 −135 activesupport/lib/active_support/vendor/i18n-0.4.1/CHANGELOG.textile
  2. +0 −20 activesupport/lib/active_support/vendor/i18n-0.4.1/MIT-LICENSE
  3. +0 −93 activesupport/lib/active_support/vendor/i18n-0.4.1/README.textile
  4. +0 −24 activesupport/lib/active_support/vendor/i18n-0.4.1/Rakefile
  5. +0 −148 activesupport/lib/active_support/vendor/i18n-0.4.1/benchmark/example.yml
  6. +0 −116 activesupport/lib/active_support/vendor/i18n-0.4.1/benchmark/run.rb
  7. +0 −20 activesupport/lib/active_support/vendor/i18n-0.4.1/i18n.gemspec
  8. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n.rb
  9. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend.rb
  10. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/active_record.rb
  11. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/active_record/missing.rb
  12. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/active_record/store_procs.rb
  13. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/active_record/translation.rb
  14. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/base.rb
  15. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/cache.rb
  16. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/cascade.rb
  17. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/chain.rb
  18. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/cldr.rb
  19. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/fallbacks.rb
  20. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/flatten.rb
  21. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/gettext.rb
  22. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/interpolation_compiler.rb
  23. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/key_value.rb
  24. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/memoize.rb
  25. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/metadata.rb
  26. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/pluralization.rb
  27. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/simple.rb
  28. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/backend/transliterator.rb
  29. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/config.rb
  30. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/core_ext/hash.rb
  31. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/core_ext/string/interpolate.rb
  32. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/exceptions.rb
  33. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/gettext.rb
  34. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/gettext/helpers.rb
  35. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/gettext/po_parser.rb
  36. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/locale.rb
  37. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/locale/fallbacks.rb
  38. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/locale/tag.rb
  39. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/locale/tag/parents.rb
  40. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/locale/tag/rfc4646.rb
  41. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/locale/tag/simple.rb
  42. 0  activesupport/lib/active_support/vendor/i18n-0.4.1/{lib → }/i18n/version.rb
  43. +0 −1  activesupport/lib/active_support/vendor/i18n-0.4.1/init.rb
  44. +0 −8 activesupport/lib/active_support/vendor/i18n-0.4.1/test/all.rb
  45. +0 −18 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api.rb
  46. +0 −30 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/active_record_test.rb
  47. +0 −57 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/all_features_test.rb
  48. +0 −31 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/cascade_test.rb
  49. +0 −27 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/chain_test.rb
  50. +0 −33 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/fallbacks_test.rb
  51. +0 −31 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/key_value_test.rb
  52. +0 −62 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/memoize_test.rb
  53. +0 −33 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/pluralization_test.rb
  54. +0 −22 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/simple_test.rb
  55. +0 −24 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/basics.rb
  56. +0 −40 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/defaults.rb
  57. +0 −108 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/interpolation.rb
  58. +0 −56 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/link.rb
  59. +0 −84 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/localization/date.rb
  60. +0 −77 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/localization/date_time.rb
  61. +0 −117 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/localization/procs.rb
  62. +0 −76 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/localization/time.rb
  63. +0 −70 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/lookup.rb
  64. +0 −35 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/pluralization.rb
  65. +0 −55 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/procs.rb
  66. +0 −51 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/active_record/missing_test.rb
  67. +0 −57 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/active_record_test.rb
  68. +0 −70 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/cache_test.rb
  69. +0 −72 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/cascade_test.rb
  70. +0 −63 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/chain_test.rb
  71. +0 −150 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/cldr_test.rb
  72. +0 −25 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/exceptions_test.rb
  73. +0 −104 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/fallbacks_test.rb
  74. +0 −105 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/interpolation_compiler_test.rb
  75. +0 −50 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/key_value_test.rb
  76. +0 −15 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/memoize_test.rb
  77. +0 −69 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/metadata_test.rb
  78. +0 −46 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/pluralization_test.rb
  79. +0 −81 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/simple_test.rb
  80. +0 −83 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/transliterator_test.rb
  81. +0 −33 activesupport/lib/active_support/vendor/i18n-0.4.1/test/core_ext/hash_test.rb
  82. +0 −100 activesupport/lib/active_support/vendor/i18n-0.4.1/test/core_ext/string/interpolate_test.rb
  83. +0 −207 activesupport/lib/active_support/vendor/i18n-0.4.1/test/gettext/api_test.rb
  84. +0 −90 activesupport/lib/active_support/vendor/i18n-0.4.1/test/gettext/backend_test.rb
  85. +0 −97 activesupport/lib/active_support/vendor/i18n-0.4.1/test/i18n_exceptions_test.rb
  86. +0 −23 activesupport/lib/active_support/vendor/i18n-0.4.1/test/i18n_load_path_test.rb
  87. +0 −244 activesupport/lib/active_support/vendor/i18n-0.4.1/test/i18n_test.rb
  88. +0 −126 activesupport/lib/active_support/vendor/i18n-0.4.1/test/locale/fallbacks_test.rb
  89. +0 −143 activesupport/lib/active_support/vendor/i18n-0.4.1/test/locale/tag/rfc4646_test.rb
  90. +0 −33 activesupport/lib/active_support/vendor/i18n-0.4.1/test/locale/tag/simple_test.rb
  91. +0 −152 activesupport/lib/active_support/vendor/i18n-0.4.1/test/test_data/locales/cldr/de/calendars.yml
  92. +0 −8 activesupport/lib/active_support/vendor/i18n-0.4.1/test/test_data/locales/cldr/de/currencies.yml
  93. +0 −31 activesupport/lib/active_support/vendor/i18n-0.4.1/test/test_data/locales/cldr/de/numbers.yml
  94. +0 −72 activesupport/lib/active_support/vendor/i18n-0.4.1/test/test_data/locales/de.po
  95. +0 −3  activesupport/lib/active_support/vendor/i18n-0.4.1/test/test_data/locales/en.rb
  96. +0 −3  activesupport/lib/active_support/vendor/i18n-0.4.1/test/test_data/locales/en.yml
  97. +0 −113 activesupport/lib/active_support/vendor/i18n-0.4.1/test/test_data/locales/plurals.rb
  98. +0 −85 activesupport/lib/active_support/vendor/i18n-0.4.1/test/test_helper.rb
  99. +0 −71 activesupport/lib/active_support/vendor/i18n-0.4.1/test/test_setup_requirements.rb
View
135 activesupport/lib/active_support/vendor/i18n-0.4.1/CHANGELOG.textile
@@ -1,135 +0,0 @@
-h1. Changelog
-
-h2. master
-
-h2. 0.4.0 (2010-05-27)
-
-* "The localization proc also receives the object as option":http://github.com/svenfuchs/i18n/commit/4a8cd9fa660daaa3078e24c5851353ca377d9213
-
-h2. 0.4.0.beta1 (2010-05-03)
-
-* "Renamed Fast backend to Memoize backend":http://github.com/svenfuchs/i18n/commit/f7f7dc12c00a19d3876223771e14f8671ff313cd
-
-* "Deprecate {{}} as interpolation syntax":http://github.com/svenfuchs/i18n/commit/8894ee521ef5788c415b625a6daf522af4c416e0
-
-* "Allow nil translation to be stored again":http://github.com/svenfuchs/i18n/commit/f2074f1e82d10c2e9a801c8cc2f2a0c7c30703ba
-
-h2. 0.4.0.beta (2010-04-30)
-
-* "Added a KeyValue backend":http://github.com/svenfuchs/i18n/commit/28ca5f53ade7f545f8c0804e93564d4686b416a4
-
-* "Added transliteration support":http://github.com/svenfuchs/i18n/commit/928fdb4794959e779e90f360eb01ba043672d8d5
-
-* "Create Flatten backend module to aid handling flatten translations":http://github.com/svenfuchs/i18n/commit/2ec9d6998aa8facd7b15a3ef47a96cf2471cd8a1
-
-* "Decouple the external separator (used when storing translations) from the internal separator in Fast and ActiveRecord backends":http://github.com/svenfuchs/i18n/commit/274cb4daa0ca5e3b2bd23b45eb7f9fc58f75a79d
-
-h2. 0.3.7 (2010-04-17)
-
-* "Speed up I18n.normalize_keys by caching reused normalizations and producing less garbage":http://github.com/svenfuchs/i18n/commit/819dac0fea9c29e6545801aa107e63e355728cd4
-
-h2. 0.3.6 (2010-03-23)
-
-* "Move gettext po parser to lib":http://github.com/svenfuchs/i18n/commit/b2f038663b55727ac2327e6f07a46ba5d69d600c
-
-* "Move I18n configuration to I18n.config":http://github.com/svenfuchs/i18n/commit/4a7baea86663ead8c681008c3e80a622f0546b07
-
-h2. 0.3.5 (2010-02-26)
-
-* "Delegate I18n.normalize_translation_keys to I18n.normalize_keys and deprecate
-the former":http://github.com/svenfuchs/i18n/commit/7284b04d5f5dd9679cb68875515cdd0cdfc96fef
-
-h2. 0.3.4 (2010-02-25)
-
-* "Rename I18n.normalize_translation_keys to I18n.normalize_keys and finally make it public":http://github.com/svenfuchs/i18n/commit/20b05fe5802df6c90fb70a4e3760b2b851b791b3
-
-* "Added CLDR supoprt":http://github.com/svenfuchs/i18n/commit/860eadf671a231e7f5dffb1bb27fa318ff7a8786
-
-h2. 0.3.3 (2009-12-29)
-
-* "Use lib/i18n/version":http://github.com/svenfuchs/i18n/commit/ff426c8e7a2438b814cb303adadec292dacb752e
-
-* "Added a benchmark suite":http://github.com/svenfuchs/i18n/commit/f9b5b9b113097724638bdab96862ffa404e67e70
-
-* "Ensure links can be handled recursively":http://github.com/svenfuchs/i18n/commit/2c50bd209f3fc24fe9dfa694c81be64340f09b7d
-
-* "Make sure we can lookup false values as translation data":http://github.com/svenfuchs/i18n/commit/561c82ba4b8921d03bfdf56cb2d0c2f287629001
-
-* "Added Fast backend module":http://github.com/svenfuchs/i18n/commit/bd2f09f0a251ca793b0e8ecc7e32177a2f091c23
-
-* "Added InterpolationCompiler backend module":http://github.com/svenfuchs/i18n/commit/91810887d1abfb28996a9183bc9004678290d28b
-
-h2. 0.3.2 (2009-12-12)
-
-* "Added Cascade backend":http://github.com/svenfuchs/i18n/commit/8009aef293e9ef8564c9005090d8380feabcaf6f
-
-h2. 0.3.1 (2009-12-11)
-
-* "Add PoParser to gemspec":http://github.com/svenfuchs/i18n/commit/d6b2763f39c932f66adb039b96882a472f883c51
-* "Enable custom separators for ActiveRecord backend":http://github.com/svenfuchs/i18n/commit/9341d3fcfc951cc31807ba672d2b5d90909ef3e5
-* "Pass interpolation values to interpolation procs":http://github.com/svenfuchs/i18n/commit/39c2ed8fbad645671cd5520ce7ad0aeefe2b0cca
-* "Fix that ngettext supports keys with dots":http://github.com/svenfuchs/i18n/commit/7362a43c34364d500de8899cfcca6bf1a5e6d1c8
-
-h2. 0.3.0 (2009-11-30)
-
-* "Gettext backend and helpers":http://github.com/svenfuchs/i18n/commit/35a1740d2f10b808548af352006950da4017e374
-* "Metadata module":http://github.com/svenfuchs/i18n/commit/2677208555179b36fcbe958c0e8bc642cf5bc020
-* "Basic ActiveRecord backend":http://github.com/svenfuchs/i18n/commit/786632d0b42de423ecf0969622efc87f1691e2a2
-* "Set encoding to UTF8 for all files":http://github.com/svenfuchs/i18n/commit/9be3d4a311b5bf583eec5d39986176cc40c112f2
-* "Chain backend":http://github.com/svenfuchs/i18n/commit/08259ffb88b3005403648d77bc1cbca0b92f3cf5
-* "Backend/cache implementation":http://github.com/svenfuchs/i18n/commit/e7bf15351cd2e27f5972eb40e65a5dd6f4a0feed
-* "Pluralization module":http://github.com/svenfuchs/i18n/commit/9ca4c9ed52d4706566a6abeb2d78722dcc5d4764
-* "add and adapt Globalize2 fallback implementation":http://github.com/svenfuchs/i18n/commit/1b37a303b27d6222b17162804b06323e5628768f
-* "move Simple backend implementation to a Base backend class and extend Simple from Base.":http://github.com/svenfuchs/i18n/commit/32ddc80a04e6aa247f6d6613bde7f78c73396cb4
-
-h2. 0.2.0 (2009-07-12)
-
-* "Allow using Ruby 1.9 syntax for string interpolation (API addition)":http://github.com/svenfuchs/i18n/commit/c6e0b06d512f2af57199a843a1d8a40241b32861
-* "Allow configuring the default scope separator, allow to pass a custom scope separator(API addition)":http://github.com/svenfuchs/i18n/commit/5b75bfbc348061adc11e3790187a187275bfd471 (e.g. I18n.t(:'foo|bar', :separator => '|')
-* "Pass :format option to #translate for #localize more useful lambda support":http://github.com/svenfuchs/i18n/commit/e277711b3c844fe7589b8d3f9af0f7d1b969a273
-* "Refactor Simple backend #resolve to #default and #resolve for more consistency. Now allows to pass lambdas as defaults and re-resolve Symbols":http://github.com/svenfuchs/i18n/commit/8c4ce3d923ce5fa73e973fe28217e18165549aba
-* "Add lambda support to #translate (API addition)":http://github.com/svenfuchs/i18n/commit/c90e62d8f7d3d5b78f34cfe328d871b58884f115
-* "Add lambda support to #localize (API addition)":http://github.com/svenfuchs/i18n/commit/9d390afcf33f3f469bb95e6888147152f6cc7442
-
-h2. 0.1.3 (2009-02-27)
-
-* "Remove unnecessary string encoding handling in the i18n simple backend which made the backend break on Ruby 1.9":http://github.com/svenfuchs/i18n/commit/4c3a970783861a94f2e89f46714fb3434e4f4f8d
-
-h2. 0.1.2 (2009-01-09)
-
-* "added #available_locales (returns an array of locales for which translations are available)":http://github.com/svenfuchs/i18n/commit/411f8fe7c8f3f89e9b6b921fa62ed66cb92f3af4
-* "flatten load_path before using it so that a nested array of paths won't throw up":http://github.com/svenfuchs/i18n/commit/d473a068a2b90aba98135deb225d6eb6d8104d70
-
-h2. 0.1.1 (2008-11-20)
-
-* "Use :'en' as a default locale (in favor of :'en-US')":http://github.com/svenfuchs/i18n/commit/c4b10b246aecf7da78cb2568dd0d2ab7e6b8a230
-* "Add #reload! to Simple backend":http://github.com/svenfuchs/i18n/commit/36dd2bd9973b9e1559728749a9daafa44693e964
-
-h2. 0.1.0 (2008-10-25)
-
-* "Fix Simple backend to distinguish false from nil values":http://github.com/svenfuchs/i18n/commit/39d9a47da14b5f3ba126af48923af8c30e135166
-* "Add #load_path to public api, add initialize to simple backend and remove #load_translations from public api":http://github.com/svenfuchs/i18n/commit/c4c5649e6bc8f020f1aaf5a5470bde048e22c82d
-* "Speed up Backend::Simple#interpolate":http://github.com/svenfuchs/i18n/commit/9e1ac6bf8833304e036323ec9932b9f33c468a35
-* "Remove #populate and #store_translations from public API":http://github.com/svenfuchs/i18n/commit/f4e514a80be7feb509f66824ee311905e2940900
-* "Use :other instead of :many as a plural key":http://github.com/svenfuchs/i18n/commit/0f8f20a2552bf6a2aa758d8fdd62a7154e4a1bf6
-* "Use a class instead of a module for Simple backend":http://github.com/svenfuchs/i18n/commit/08f051aa61320c17debde24a83268bc74e33b995
-* "Make Simple backend #interpolate deal with non-ASCII string encodings":http://github.com/svenfuchs/i18n/commit/d84a3f3f55543c084d5dc5d1fed613b8df148789
-* "Fix default arrays of non-existant keys returning the default array":http://github.com/svenfuchs/i18n/commit/6c04ca86c87f97dc78f07c2a4023644e5ba8b839
-
-h2. Initial implementation (June/July 2008)
-
-Initial implementation by "Sven Fuchs":http://www.workingwithrails.com/person/9963-sven-fuchs based on previous discussion/consensus of the rails-i18n team (alphabetical order) and many others:
-
-* "Matt Aimonetti":http://railsontherun.com
-* "Sven Fuchs":http://www.workingwithrails.com/person/9963-sven-fuchs
-* "Joshua Harvey":http://www.workingwithrails.com/person/759-joshua-harvey
-* "Saimon Moore":http://saimonmoore.net
-* "Stephan Soller":http://www.arkanis-development.de
-
-h2. More information
-
-* "Homepage":http://rails-i18n.org
-* "Wiki":http://rails-i18n.org/wiki
-* "Mailinglist":http://groups.google.com/group/rails-i18n
-* "About the project/history":http://www.artweb-design.de/2008/7/18/finally-ruby-on-rails-gets-internationalized
-* "Initial API Intro":http://www.artweb-design.de/2008/7/18/the-ruby-on-rails-i18n-core-api
View
20 activesupport/lib/active_support/vendor/i18n-0.4.1/MIT-LICENSE
@@ -1,20 +0,0 @@
-Copyright (c) 2008 The Ruby I18n team
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
93 activesupport/lib/active_support/vendor/i18n-0.4.1/README.textile
@@ -1,93 +0,0 @@
-h1. Ruby I18n
-
-Ruby Internationalization and localization solution.
-
-Features:
-
-* translation and localization
-* interpolation of values to translations (Ruby 1.9 compatible syntax)
-* pluralization (CLDR compatible)
-* customizable transliteration to ASCII
-* flexible defaults
-* bulk lookup
-* lambdas as translation data
-* custom key/scope separator
-* custom exception handlers
-* extensible architecture with a swappable backend
-
-Pluggable features:
-
-* Cache
-* Pluralization: lambda pluralizers stored as translation data
-* Locale fallbacks, RFC4647 compliant (optionally: RFC4646 locale validation)
-* Gettext support
-* Translation metadata
-
-Alternative backends:
-
-* Chain
-* ActiveRecord (optionally: ActiveRecord::Missing and ActiveRecord::StoreProcs)
-* KeyValue (uses active_support/json and cannot store procs)
-
-For more information and lots of resources see: "http://rails-i18n.org/wiki":http://rails-i18n.org/wiki
-
-h2. Installation
-
-gem install i18n
-
-h3. Installation on Rails < 2.3.5 (deprecated)
-
-Up to version 2.3.4 Rails will not accept i18n gems > 0.1.3. There is an unpacked
-gem inside of active_support/lib/vendor which gets loaded unless gem 'i18n', '~> 0.1.3'.
-This requirement is relaxed in "6da03653":http://github.com/rails/rails/commit/6da03653
-
-The new i18n gem can be loaded from vendor/plugins like this:
-
- def reload_i18n!
- raise "Move to i18n version 0.2.0 or greater" if Rails.version > "2.3.4"
-
- $:.grep(/i18n/).each { |path| $:.delete(path) }
- I18n::Backend.send :remove_const, "Simple"
- $: << Rails.root.join('vendor', 'plugins', 'i18n', 'lib').to_s
- end
-
-Then you can `reload_i18n!` inside an i18n initializer.
-
-h2. Tests
-
-You can run tests both with
-
-* `rake test` or just `rake`
-* run any test file directly, e.g. `ruby test/api/simple_test.rb`
-* run all tests with `ruby test/all.rb`
-
-The structure of the test suite is a bit unusual as it uses modules to reuse
-particular tests in different test cases.
-
-The reason for this is that we need to enforce the I18n API across various
-combinations of extensions. E.g. the Simple backend alone needs to support
-the same API as any combination of feature and/or optimization modules included
-to the Simple backend. We test this by reusing the same API defition (implemented
-as test methods) in test cases with different setups.
-
-You can find the test cases that enforce the API in test/api. And you can find
-the API definition test methods in test/api/tests.
-
-All other test cases (e.g. as defined in test/backend, test/core\_ext) etc.
-follow the usual test setup and should be easy to grok.
-
-h2. Authors
-
-* "Sven Fuchs":http://www.artweb-design.de
-* "Joshua Harvey":http://www.workingwithrails.com/person/759-joshua-harvey
-* "Stephan Soller":http://www.arkanis-development.de
-* "Saimon Moore":http://saimonmoore.net
-* "Matt Aimonetti":http://railsontherun.com
-
-h2. Contributors
-
-http://github.com/svenfuchs/i18n/contributors
-
-h2. License
-
-MIT License. See the included MIT-LICENSE file.
View
24 activesupport/lib/active_support/vendor/i18n-0.4.1/Rakefile
@@ -1,24 +0,0 @@
-require 'rake/testtask'
-require "rake/gempackagetask"
-require "rake/clean"
-
-task :default => [:test]
-
-CLEAN << "pkg" << "doc" << "coverage" << ".yardoc"
-
-Rake::TestTask.new(:test) do |t|
- t.pattern = "#{File.dirname(__FILE__)}/test/all.rb"
- t.verbose = true
-end
-Rake::Task['test'].comment = "Run all i18n tests"
-
-Rake::GemPackageTask.new(eval(File.read("i18n.gemspec"))) { |pkg| }
-
-begin
- require "yard"
- YARD::Rake::YardocTask.new do |t|
- t.options = ["--output-dir=doc"]
- t.options << "--files" << ["CHANGELOG.textile", "contributors.txt", "MIT-LICENSE"].join(",")
- end
-rescue LoadError
-end
View
148 activesupport/lib/active_support/vendor/i18n-0.4.1/benchmark/example.yml
@@ -1,148 +0,0 @@
-en:
- first: "First"
-
- activemodel:
- errors:
- messages: :"activerecord.errors.messages"
-
- activerecord:
- errors:
- messages:
- inclusion: "is not included in the list"
- exclusion: "is reserved"
- invalid: "is invalid"
- confirmation: "doesn't match confirmation"
- accepted: "must be accepted"
- empty: "can't be empty"
- blank: "can't be blank"
- too_long: "is too long (maximum is %{count} characters)"
- too_short: "is too short (minimum is %{count} characters)"
- wrong_length: "is the wrong length (should be %{count} characters)"
- taken: "has already been taken"
- not_a_number: "is not a number"
- greater_than: "must be greater than %{count}"
- greater_than_or_equal_to: "must be greater than or equal to %{count}"
- equal_to: "must be equal to %{count}"
- less_than: "must be less than %{count}"
- less_than_or_equal_to: "must be less than or equal to %{count}"
- odd: "must be odd"
- even: "must be even"
- record_invalid: "Validation failed: %{errors}"
-
- models:
- user:
- blank: "This is a custom blank message for %{model}: %{attribute}"
- attributes:
- login:
- blank: "This is a custom blank message for User login"
-
- models:
- user: "Dude"
-
- attributes:
- admins:
- user:
- login: "Handle"
-
- date:
- formats:
- # Use the strftime parameters for formats.
- # When no format has been given, it uses default.
- # You can provide other formats here if you like!
- default: "%Y-%m-%d"
- short: "%b %d"
- long: "%B %d, %Y"
-
- day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
- abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
-
- # Don't forget the nil at the beginning; there's no such thing as a 0th month
- month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
- abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
- # Used in date_select and datime_select.
- order: [ :year, :month, :day ]
-
- time:
- formats:
- default: "%a, %d %b %Y %H:%M:%S %z"
- short: "%d %b %H:%M"
- long: "%B %d, %Y %H:%M"
- am: "am"
- pm: "pm"
-
- support:
- array:
- words_connector: ", "
- two_words_connector: " and "
- last_word_connector: ", and "
-
- activemodel:
- errors:
- messages:
- inclusion: "is not included in the list"
- exclusion: "is reserved"
- invalid: "is invalid"
- confirmation: "doesn't match confirmation"
- accepted: "must be accepted"
- empty: "can't be empty"
- blank: "can't be blank"
- too_long: "is too long (maximum is %{count} characters)"
- too_short: "is too short (minimum is %{count} characters)"
- wrong_length: "is the wrong length (should be %{count} characters)"
- taken: "has already been taken"
- not_a_number: "is not a number"
- greater_than: "must be greater than %{count}"
- greater_than_or_equal_to: "must be greater than or equal to %{count}"
- equal_to: "must be equal to %{count}"
- less_than: "must be less than %{count}"
- less_than_or_equal_to: "must be less than or equal to %{count}"
- odd: "must be odd"
- even: "must be even"
- record_invalid: "Validation failed: %{errors}"
-
- models:
- user:
- blank: "This is a custom blank message for %{model}: %{attribute}"
- attributes:
- login:
- blank: "This is a custom blank message for User login"
-
- models:
- user: "Dude"
-
- attributes:
- user:
- login: "Handle"
-
- model_data:
- date:
- formats:
- # Use the strftime parameters for formats.
- # When no format has been given, it uses default.
- # You can provide other formats here if you like!
- default: "%Y-%m-%d"
- short: "%b %d"
- long: "%B %d, %Y"
-
- day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
- abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
-
- # Don't forget the nil at the beginning; there's no such thing as a 0th month
- month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
- abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
- # Used in date_select and datime_select.
- order: [ :year, :month, :day ]
-
- time:
- formats:
- default: "%a, %d %b %Y %H:%M:%S %z"
- short: "%d %b %H:%M"
- long: "%B %d, %Y %H:%M"
- am: "am"
- pm: "pm"
-
- support:
- array:
- words_connector: ", "
- two_words_connector: " and "
- last_word_connector: ", and "
View
116 activesupport/lib/active_support/vendor/i18n-0.4.1/benchmark/run.rb
@@ -1,116 +0,0 @@
-#! /usr/bin/ruby
-$:.unshift File.expand_path('../../lib', __FILE__)
-
-require 'i18n'
-require 'benchmark'
-require 'yaml'
-
-DATA_STORES = ARGV.delete("-ds")
-N = (ARGV.shift || 1000).to_i
-YAML_HASH = YAML.load_file(File.expand_path("example.yml", File.dirname(__FILE__)))
-
-module Backends
- Simple = I18n::Backend::Simple.new
-
- Interpolation = Class.new(I18n::Backend::Simple) do
- include I18n::Backend::InterpolationCompiler
- end.new
-
- if DATA_STORES
- require 'rubygems'
- require File.expand_path('../../test/test_setup_requirements', __FILE__)
-
- setup_active_record
- ActiveRecord = I18n::Backend::ActiveRecord.new if defined?(::ActiveRecord)
-
- setup_rufus_tokyo
- TokyoCabinet = I18n::Backend::KeyValue.new(Rufus::Tokyo::Cabinet.new("*"), true) if defined?(::Rufus::Tokyo)
- end
-end
-
-ORDER = %w(Simple Interpolation ActiveRecord TokyoCabinet)
-ORDER.map!(&:to_sym) if RUBY_VERSION > '1.9'
-
-module Benchmark
- WIDTH = 20
-
- def self.rt(label = "", n=N, &blk)
- print label.ljust(WIDTH)
- time, objects = measure_objects(n, &blk)
- time = time.respond_to?(:real) ? time.real : time
- print format("%8.2f ms %8d objects\n", time * 1000, objects)
- rescue Exception => e
- print "FAILED: #{e.message}"
- end
-
- if ObjectSpace.respond_to?(:allocated_objects)
- def self.measure_objects(n, &blk)
- obj = ObjectSpace.allocated_objects
- t = Benchmark.realtime { n.times(&blk) }
- [t, ObjectSpace.allocated_objects - obj]
- end
- else
- def self.measure_objects(n, &blk)
- [Benchmark.measure { n.times(&blk) }, 0]
- end
- end
-end
-
-benchmarker = lambda do |backend_name|
- I18n.backend = Backends.const_get(backend_name)
- puts "=> #{backend_name}\n\n"
-
- Benchmark.rt "store", 1 do
- I18n.backend.store_translations *(YAML_HASH.to_a.first)
- end
-
- I18n.backend.translate :en, :first
-
- Benchmark.rt "available_locales" do
- I18n.backend.available_locales
- end
-
- Benchmark.rt "t (depth=3)" do
- I18n.backend.translate :en, :"activerecord.models.user"
- end
-
- Benchmark.rt "t (depth=5)" do
- I18n.backend.translate :en, :"activerecord.attributes.admins.user.login"
- end
-
- Benchmark.rt "t (depth=7)" do
- I18n.backend.translate :en, :"activerecord.errors.models.user.attributes.login.blank"
- end
-
- Benchmark.rt "t w/ default" do
- I18n.backend.translate :en, :"activerecord.models.another", :default => "Another"
- end
-
- Benchmark.rt "t w/ interpolation" do
- I18n.backend.translate :en, :"activerecord.errors.models.user.blank", :model => "User", :attribute => "name"
- end
-
- Benchmark.rt "t w/ link" do
- I18n.backend.translate :en, :"activemodel.errors.messages.blank"
- end
-
- Benchmark.rt "t subtree" do
- I18n.backend.translate :en, :"activerecord.errors.messages"
- end
-
- puts
-end
-
-# Run!
-puts
-puts "Running benchmarks with N = #{N}\n\n"
-(ORDER & Backends.constants).each(&benchmarker)
-
-Backends.constants.each do |backend_name|
- backend = Backends.const_get(backend_name)
- backend.reload!
- backend.extend I18n::Backend::Memoize
-end
-
-puts "Running memoized benchmarks with N = #{N}\n\n"
-(ORDER & Backends.constants).each(&benchmarker)
View
20 activesupport/lib/active_support/vendor/i18n-0.4.1/i18n.gemspec
@@ -1,20 +0,0 @@
-# encoding: utf-8
-
-$: << File.expand_path('../lib', __FILE__)
-require 'i18n/version'
-
-Gem::Specification.new do |s|
- s.name = "i18n"
- s.version = I18n::VERSION
- s.authors = ["Sven Fuchs", "Joshua Harvey", "Matt Aimonetti", "Stephan Soller", "Saimon Moore"]
- s.email = "rails-i18n@googlegroups.com"
- s.homepage = "http://github.com/svenfuchs/i18n"
- s.summary = "New wave Internationalization support for Ruby"
- s.description = "New wave Internationalization support for Ruby."
-
- s.files = `git ls-files {app,lib}`.split("\n") + %w(README.textile MIT-LICENSE CHANGELOG.textile)
- s.platform = Gem::Platform::RUBY
- s.require_path = 'lib'
- s.rubyforge_project = '[none]'
- s.required_rubygems_version = '>= 1.3.6'
-end
View
0  .../lib/active_support/vendor/i18n-0.4.1/lib/i18n.rb → ...port/lib/active_support/vendor/i18n-0.4.1/i18n.rb
File renamed without changes
View
0  ...ive_support/vendor/i18n-0.4.1/lib/i18n/backend.rb → .../active_support/vendor/i18n-0.4.1/i18n/backend.rb
File renamed without changes
View
0  ...ndor/i18n-0.4.1/lib/i18n/backend/active_record.rb → ...t/vendor/i18n-0.4.1/i18n/backend/active_record.rb
File renamed without changes
View
0  ...n-0.4.1/lib/i18n/backend/active_record/missing.rb → .../i18n-0.4.1/i18n/backend/active_record/missing.rb
File renamed without changes
View
0  ...4.1/lib/i18n/backend/active_record/store_procs.rb → ...n-0.4.1/i18n/backend/active_record/store_procs.rb
File renamed without changes
View
0  ...4.1/lib/i18n/backend/active_record/translation.rb → ...n-0.4.1/i18n/backend/active_record/translation.rb
File renamed without changes
View
0  ...upport/vendor/i18n-0.4.1/lib/i18n/backend/base.rb → ...ve_support/vendor/i18n-0.4.1/i18n/backend/base.rb
File renamed without changes
View
0  ...pport/vendor/i18n-0.4.1/lib/i18n/backend/cache.rb → ...e_support/vendor/i18n-0.4.1/i18n/backend/cache.rb
File renamed without changes
View
0  ...ort/vendor/i18n-0.4.1/lib/i18n/backend/cascade.rb → ...support/vendor/i18n-0.4.1/i18n/backend/cascade.rb
File renamed without changes
View
0  ...pport/vendor/i18n-0.4.1/lib/i18n/backend/chain.rb → ...e_support/vendor/i18n-0.4.1/i18n/backend/chain.rb
File renamed without changes
View
0  ...upport/vendor/i18n-0.4.1/lib/i18n/backend/cldr.rb → ...ve_support/vendor/i18n-0.4.1/i18n/backend/cldr.rb
File renamed without changes
View
0  ...t/vendor/i18n-0.4.1/lib/i18n/backend/fallbacks.rb → ...pport/vendor/i18n-0.4.1/i18n/backend/fallbacks.rb
File renamed without changes
View
0  ...ort/vendor/i18n-0.4.1/lib/i18n/backend/flatten.rb → ...support/vendor/i18n-0.4.1/i18n/backend/flatten.rb
File renamed without changes
View
0  ...ort/vendor/i18n-0.4.1/lib/i18n/backend/gettext.rb → ...support/vendor/i18n-0.4.1/i18n/backend/gettext.rb
File renamed without changes
View
0  ...-0.4.1/lib/i18n/backend/interpolation_compiler.rb → ...i18n-0.4.1/i18n/backend/interpolation_compiler.rb
File renamed without changes
View
0  ...t/vendor/i18n-0.4.1/lib/i18n/backend/key_value.rb → ...pport/vendor/i18n-0.4.1/i18n/backend/key_value.rb
File renamed without changes
View
0  ...ort/vendor/i18n-0.4.1/lib/i18n/backend/memoize.rb → ...support/vendor/i18n-0.4.1/i18n/backend/memoize.rb
File renamed without changes
View
0  ...rt/vendor/i18n-0.4.1/lib/i18n/backend/metadata.rb → ...upport/vendor/i18n-0.4.1/i18n/backend/metadata.rb
File renamed without changes
View
0  ...ndor/i18n-0.4.1/lib/i18n/backend/pluralization.rb → ...t/vendor/i18n-0.4.1/i18n/backend/pluralization.rb
File renamed without changes
View
0  ...port/vendor/i18n-0.4.1/lib/i18n/backend/simple.rb → ..._support/vendor/i18n-0.4.1/i18n/backend/simple.rb
File renamed without changes
View
0  ...dor/i18n-0.4.1/lib/i18n/backend/transliterator.rb → .../vendor/i18n-0.4.1/i18n/backend/transliterator.rb
File renamed without changes
View
0  ...tive_support/vendor/i18n-0.4.1/lib/i18n/config.rb → ...b/active_support/vendor/i18n-0.4.1/i18n/config.rb
File renamed without changes
View
0  ...pport/vendor/i18n-0.4.1/lib/i18n/core_ext/hash.rb → ...e_support/vendor/i18n-0.4.1/i18n/core_ext/hash.rb
File renamed without changes
View
0  ...18n-0.4.1/lib/i18n/core_ext/string/interpolate.rb → ...or/i18n-0.4.1/i18n/core_ext/string/interpolate.rb
File renamed without changes
View
0  ..._support/vendor/i18n-0.4.1/lib/i18n/exceptions.rb → ...tive_support/vendor/i18n-0.4.1/i18n/exceptions.rb
File renamed without changes
View
0  ...ive_support/vendor/i18n-0.4.1/lib/i18n/gettext.rb → .../active_support/vendor/i18n-0.4.1/i18n/gettext.rb
File renamed without changes
View
0  ...ort/vendor/i18n-0.4.1/lib/i18n/gettext/helpers.rb → ...support/vendor/i18n-0.4.1/i18n/gettext/helpers.rb
File renamed without changes
View
0  ...t/vendor/i18n-0.4.1/lib/i18n/gettext/po_parser.rb → ...pport/vendor/i18n-0.4.1/i18n/gettext/po_parser.rb
File renamed without changes
View
0  ...tive_support/vendor/i18n-0.4.1/lib/i18n/locale.rb → ...b/active_support/vendor/i18n-0.4.1/i18n/locale.rb
File renamed without changes
View
0  ...rt/vendor/i18n-0.4.1/lib/i18n/locale/fallbacks.rb → ...upport/vendor/i18n-0.4.1/i18n/locale/fallbacks.rb
File renamed without changes
View
0  ..._support/vendor/i18n-0.4.1/lib/i18n/locale/tag.rb → ...tive_support/vendor/i18n-0.4.1/i18n/locale/tag.rb
File renamed without changes
View
0  .../vendor/i18n-0.4.1/lib/i18n/locale/tag/parents.rb → ...port/vendor/i18n-0.4.1/i18n/locale/tag/parents.rb
File renamed without changes
View
0  .../vendor/i18n-0.4.1/lib/i18n/locale/tag/rfc4646.rb → ...port/vendor/i18n-0.4.1/i18n/locale/tag/rfc4646.rb
File renamed without changes
View
0  ...t/vendor/i18n-0.4.1/lib/i18n/locale/tag/simple.rb → ...pport/vendor/i18n-0.4.1/i18n/locale/tag/simple.rb
File renamed without changes
View
0  ...ive_support/vendor/i18n-0.4.1/lib/i18n/version.rb → .../active_support/vendor/i18n-0.4.1/i18n/version.rb
File renamed without changes
View
1  activesupport/lib/active_support/vendor/i18n-0.4.1/init.rb
@@ -1 +0,0 @@
-require 'i18n'
View
8 activesupport/lib/active_support/vendor/i18n-0.4.1/test/all.rb
@@ -1,8 +0,0 @@
-# encoding: utf-8
-
-dir = File.dirname(__FILE__)
-$LOAD_PATH.unshift(dir)
-
-Dir["#{dir}/**/*_test.rb"].sort.each do |file|
- require file.sub(/^#{dir}\/(.*)\.rb$/, '\1')
-end
View
18 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api.rb
@@ -1,18 +0,0 @@
-module Tests
- module Api
- autoload :Basics, 'api/tests/basics'
- autoload :Defaults, 'api/tests/defaults'
- autoload :Interpolation, 'api/tests/interpolation'
- autoload :Link, 'api/tests/link'
- autoload :Lookup, 'api/tests/lookup'
- autoload :Pluralization, 'api/tests/pluralization'
- autoload :Procs, 'api/tests/procs'
-
- module Localization
- autoload :Date, 'api/tests/localization/date'
- autoload :DateTime, 'api/tests/localization/date_time'
- autoload :Procs, 'api/tests/localization/procs'
- autoload :Time, 'api/tests/localization/time'
- end
- end
-end
View
30 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/active_record_test.rb
@@ -1,30 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-require 'api'
-
-setup_active_record
-
-class I18nActiveRecordApiTest < Test::Unit::TestCase
- def setup
- I18n.backend = I18n::Backend::ActiveRecord.new
- super
- end
-
- include Tests::Api::Basics
- include Tests::Api::Defaults
- include Tests::Api::Interpolation
- include Tests::Api::Link
- include Tests::Api::Lookup
- include Tests::Api::Pluralization
- include Tests::Api::Procs # unless RUBY_VERSION >= '1.9.1'
-
- include Tests::Api::Localization::Date
- include Tests::Api::Localization::DateTime
- include Tests::Api::Localization::Time
- include Tests::Api::Localization::Procs # unless RUBY_VERSION >= '1.9.1'
-
- test "make sure we use an ActiveRecord backend" do
- assert_equal I18n::Backend::ActiveRecord, I18n.backend.class
- end
-end if defined?(ActiveRecord)
View
57 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/all_features_test.rb
@@ -1,57 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-require 'api'
-
-begin
- require 'rubygems'
- require 'active_support'
-rescue LoadError
- puts "not testing with Cache enabled because active_support can not be found"
-end
-
-class I18nAllFeaturesApiTest < Test::Unit::TestCase
- class Backend < I18n::Backend::Simple
- include I18n::Backend::Cache
- include I18n::Backend::Metadata
- include I18n::Backend::Cascade
- include I18n::Backend::Fallbacks
- include I18n::Backend::Pluralization
- include I18n::Backend::Memoize
- end
-
- def setup
- I18n.backend = I18n::Backend::Chain.new(Backend.new, I18n::Backend::Simple.new)
- I18n.cache_store = cache_store
- super
- end
-
- def teardown
- I18n.cache_store.clear
- I18n.cache_store = nil
- super
- end
-
- def cache_store
- ActiveSupport::Cache.lookup_store(:memory_store) if defined?(ActiveSupport) && defined?(ActiveSupport::Cache)
- end
-
- include Tests::Api::Basics
- include Tests::Api::Defaults
- include Tests::Api::Interpolation
- include Tests::Api::Link
- include Tests::Api::Lookup
- include Tests::Api::Pluralization
- include Tests::Api::Procs
- include Tests::Api::Localization::Date
- include Tests::Api::Localization::DateTime
- include Tests::Api::Localization::Time
- include Tests::Api::Localization::Procs
-
- test "make sure we use a Chain backend with an all features backend" do
- assert_equal I18n::Backend::Chain, I18n.backend.class
- assert_equal Backend, I18n.backend.backends.first.class
- end
-
- # links: test that keys stored on one backend can link to keys stored on another backend
-end
View
31 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/cascade_test.rb
@@ -1,31 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-require 'api'
-
-class I18nCascadeApiTest < Test::Unit::TestCase
- class Backend < I18n::Backend::Simple
- include I18n::Backend::Cascade
- end
-
- def setup
- I18n.backend = Backend.new
- super
- end
-
- include Tests::Api::Basics
- include Tests::Api::Defaults
- include Tests::Api::Interpolation
- include Tests::Api::Link
- include Tests::Api::Lookup
- include Tests::Api::Pluralization
- include Tests::Api::Procs
- include Tests::Api::Localization::Date
- include Tests::Api::Localization::DateTime
- include Tests::Api::Localization::Time
- include Tests::Api::Localization::Procs
-
- test "make sure we use a backend with Cascade included" do
- assert_equal Backend, I18n.backend.class
- end
-end
View
27 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/chain_test.rb
@@ -1,27 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-require 'api'
-
-class I18nApiChainTest < Test::Unit::TestCase
- def setup
- super
- I18n.backend = I18n::Backend::Chain.new(I18n::Backend::Simple.new, I18n.backend)
- end
-
- include Tests::Api::Basics
- include Tests::Api::Defaults
- include Tests::Api::Interpolation
- include Tests::Api::Link
- include Tests::Api::Lookup
- include Tests::Api::Pluralization
- include Tests::Api::Procs
- include Tests::Api::Localization::Date
- include Tests::Api::Localization::DateTime
- include Tests::Api::Localization::Time
- include Tests::Api::Localization::Procs
-
- test "make sure we use the Chain backend" do
- assert_equal I18n::Backend::Chain, I18n.backend.class
- end
-end
View
33 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/fallbacks_test.rb
@@ -1,33 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-require 'api'
-
-class I18nFallbacksApiTest < Test::Unit::TestCase
- class Backend < I18n::Backend::Simple
- include I18n::Backend::Fallbacks
- end
-
- def setup
- I18n.backend = Backend.new
- super
- end
-
- include Tests::Api::Basics
- include Tests::Api::Defaults
- include Tests::Api::Interpolation
- include Tests::Api::Link
- include Tests::Api::Lookup
- include Tests::Api::Pluralization
- include Tests::Api::Procs
- include Tests::Api::Localization::Date
- include Tests::Api::Localization::DateTime
- include Tests::Api::Localization::Time
- include Tests::Api::Localization::Procs
-
- test "make sure we use a backend with Fallbacks included" do
- assert_equal Backend, I18n.backend.class
- end
-
- # links: test that keys stored on one backend can link to keys stored on another backend
-end
View
31 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/key_value_test.rb
@@ -1,31 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-require 'api'
-
-setup_rufus_tokyo
-
-class I18nKeyValueApiTest < Test::Unit::TestCase
- include Tests::Api::Basics
- include Tests::Api::Defaults
- include Tests::Api::Interpolation
- include Tests::Api::Link
- include Tests::Api::Lookup
- include Tests::Api::Pluralization
- # include Tests::Api::Procs
- include Tests::Api::Localization::Date
- include Tests::Api::Localization::DateTime
- include Tests::Api::Localization::Time
- # include Tests::Api::Localization::Procs
-
- STORE = Rufus::Tokyo::Cabinet.new('*')
-
- def setup
- I18n.backend = I18n::Backend::KeyValue.new(STORE)
- super
- end
-
- test "make sure we use the KeyValue backend" do
- assert_equal I18n::Backend::KeyValue, I18n.backend.class
- end
-end if defined?(Rufus::Tokyo::Cabinet)
View
62 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/memoize_test.rb
@@ -1,62 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-require 'api'
-
-class I18nMemoizeBackendWithSimpleApiTest < Test::Unit::TestCase
- include Tests::Api::Basics
- include Tests::Api::Defaults
- include Tests::Api::Interpolation
- include Tests::Api::Link
- include Tests::Api::Lookup
- include Tests::Api::Pluralization
- include Tests::Api::Procs
- include Tests::Api::Localization::Date
- include Tests::Api::Localization::DateTime
- include Tests::Api::Localization::Time
- include Tests::Api::Localization::Procs
-
- class MemoizeBackend < I18n::Backend::Simple
- include I18n::Backend::Memoize
- end
-
- def setup
- I18n.backend = MemoizeBackend.new
- super
- end
-
- test "make sure we use the MemoizeBackend backend" do
- assert_equal MemoizeBackend, I18n.backend.class
- end
-end
-
-setup_rufus_tokyo
-
-class I18nMemoizeBackendWithKeyValueApiTest < Test::Unit::TestCase
- include Tests::Api::Basics
- include Tests::Api::Defaults
- include Tests::Api::Interpolation
- include Tests::Api::Link
- include Tests::Api::Lookup
- include Tests::Api::Pluralization
- # include Tests::Api::Procs
- include Tests::Api::Localization::Date
- include Tests::Api::Localization::DateTime
- include Tests::Api::Localization::Time
- # include Tests::Api::Localization::Procs
-
- class MemoizeBackend < I18n::Backend::KeyValue
- include I18n::Backend::Memoize
- end
-
- STORE = Rufus::Tokyo::Cabinet.new('*')
-
- def setup
- I18n.backend = MemoizeBackend.new(STORE)
- super
- end
-
- test "make sure we use the MemoizeBackend backend" do
- assert_equal MemoizeBackend, I18n.backend.class
- end
-end if defined?(Rufus::Tokyo::Cabinet)
View
33 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/pluralization_test.rb
@@ -1,33 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-require 'api'
-
-class I18nPluralizationApiTest < Test::Unit::TestCase
- class Backend < I18n::Backend::Simple
- include I18n::Backend::Pluralization
- end
-
- def setup
- I18n.backend = Backend.new
- super
- end
-
- include Tests::Api::Basics
- include Tests::Api::Defaults
- include Tests::Api::Interpolation
- include Tests::Api::Link
- include Tests::Api::Lookup
- include Tests::Api::Pluralization
- include Tests::Api::Procs
- include Tests::Api::Localization::Date
- include Tests::Api::Localization::DateTime
- include Tests::Api::Localization::Time
- include Tests::Api::Localization::Procs
-
- test "make sure we use a backend with Pluralization included" do
- assert_equal Backend, I18n.backend.class
- end
-
- # links: test that keys stored on one backend can link to keys stored on another backend
-end
View
22 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/simple_test.rb
@@ -1,22 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-require 'api'
-
-class I18nSimpleBackendApiTest < Test::Unit::TestCase
- include Tests::Api::Basics
- include Tests::Api::Defaults
- include Tests::Api::Interpolation
- include Tests::Api::Link
- include Tests::Api::Lookup
- include Tests::Api::Pluralization
- include Tests::Api::Procs
- include Tests::Api::Localization::Date
- include Tests::Api::Localization::DateTime
- include Tests::Api::Localization::Time
- include Tests::Api::Localization::Procs
-
- test "make sure we use the Simple backend" do
- assert_equal I18n::Backend::Simple, I18n.backend.class
- end
-end
View
24 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/basics.rb
@@ -1,24 +0,0 @@
-# encoding: utf-8
-
-module Tests
- module Api
- module Basics
- def test_available_locales
- store_translations('de', :foo => 'bar')
- store_translations('en', :foo => 'foo')
-
- assert I18n.available_locales.include?(:de)
- assert I18n.available_locales.include?(:en)
- end
-
- def test_delete_value
- store_translations(:to_be_deleted => 'bar')
- assert_equal 'bar', I18n.t('to_be_deleted', :default => 'baz')
-
- I18n.cache_store.clear if I18n.respond_to?(:cache_store) && I18n.cache_store
- store_translations(:to_be_deleted => nil)
- assert_equal 'baz', I18n.t('to_be_deleted', :default => 'baz')
- end
- end
- end
-end
View
40 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/defaults.rb
@@ -1,40 +0,0 @@
-# encoding: utf-8
-
-module Tests
- module Api
- module Defaults
- def setup
- super
- store_translations(:foo => { :bar => 'bar', :baz => 'baz' })
- end
-
- define_method "test defaults: given nil as a key it returns the given default" do
- assert_equal 'default', I18n.t(nil, :default => 'default')
- end
-
- define_method "test defaults: given a symbol as a default it translates the symbol" do
- assert_equal 'bar', I18n.t(nil, :default => :'foo.bar')
- end
-
- define_method "test defaults: given a symbol as a default and a scope it stays inside the scope when looking up the symbol" do
- assert_equal 'bar', I18n.t(:missing, :default => :bar, :scope => :foo)
- end
-
- define_method "test defaults: given an array as a default it returns the first match" do
- assert_equal 'bar', I18n.t(:does_not_exist, :default => [:does_not_exist_2, :'foo.bar'])
- end
-
- define_method "test defaults: given an array of missing keys it raises a MissingTranslationData exception" do
- assert_raise I18n::MissingTranslationData do
- I18n.t(:does_not_exist, :default => [:does_not_exist_2, :does_not_exist_3], :raise => true)
- end
- end
-
- define_method "test defaults: using a custom scope separator" do
- # data must have been stored using the custom separator when using the ActiveRecord backend
- I18n.backend.store_translations(:en, { :foo => { :bar => 'bar' } }, { :separator => '|' })
- assert_equal 'bar', I18n.t(nil, :default => :'foo|bar', :separator => '|')
- end
- end
- end
-end
View
108 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/interpolation.rb
@@ -1,108 +0,0 @@
-# encoding: utf-8
-
-module Tests
- module Api
- module Interpolation
- def interpolate(*args)
- options = args.last.is_a?(Hash) ? args.pop : {}
- key = args.pop
- I18n.backend.translate('en', key, options)
- end
-
- # If no interpolation parameter is not given, I18n should not alter the string.
- # This behavior is due to three reasons:
- #
- # * Checking interpolation keys in all strings hits performance, badly;
- #
- # * This allows us to retrieve untouched values through I18n. For example
- # I could have a middleware that returns I18n lookup results in JSON
- # to be processed through Javascript. Leaving the keys untouched allows
- # the interpolation to happen at the javascript level;
- #
- # * Security concerns: if I allow users to translate a web site, they can
- # insert %{} in messages causing the I18n lookup to fail in every request.
- #
- define_method "test interpolation: given no values it does not alter the string" do
- assert_equal 'Hi %{name}!', interpolate(:default => 'Hi %{name}!')
- end
-
- define_method "test interpolation: given values it interpolates them into the string" do
- assert_equal 'Hi David!', interpolate(:default => 'Hi %{name}!', :name => 'David')
- end
-
- define_method "test interpolation: given a nil value it still interpolates it into the string" do
- assert_equal 'Hi !', interpolate(:default => 'Hi %{name}!', :name => nil)
- end
-
- define_method "test interpolation: given a lambda as a value it calls it if the string contains the key" do
- assert_equal 'Hi David!', interpolate(:default => 'Hi %{name}!', :name => lambda { |*args| 'David' })
- end
-
- define_method "test interpolation: given a lambda as a value it does not call it if the string does not contain the key" do
- assert_nothing_raised { interpolate(:default => 'Hi!', :name => lambda { |*args| raise 'fail' }) }
- end
-
- define_method "test interpolation: given values but missing a key it raises I18n::MissingInterpolationArgument" do
- assert_raise(I18n::MissingInterpolationArgument) do
- interpolate(:default => '%{foo}', :bar => 'bar')
- end
- end
-
- define_method "test interpolation: it does not raise I18n::MissingInterpolationArgument for escaped variables" do
- assert_nothing_raised(I18n::MissingInterpolationArgument) do
- assert_equal 'Barr %{foo}', interpolate(:default => '%{bar} %%{foo}', :bar => 'Barr')
- end
- end
-
- define_method "test interpolation: it does not change the original, stored translation string" do
- I18n.backend.store_translations(:en, :interpolate => 'Hi %{name}!')
- assert_equal 'Hi David!', interpolate(:interpolate, :name => 'David')
- assert_equal 'Hi Yehuda!', interpolate(:interpolate, :name => 'Yehuda')
- end
-
- define_method "test interpolation: works with the deprecated syntax" do
- deprecation = capture(:stderr) do
- assert_equal 'Hi David!', interpolate(:default => 'Hi {{name}}!', :name => 'David')
- end
- assert_match "The {{key}} interpolation syntax in I18n messages is deprecated", deprecation
- end
-
- define_method "test interpolation: given the translation is in utf-8 it still works" do
- assert_equal 'Häi David!', interpolate(:default => 'Häi %{name}!', :name => 'David')
- end
-
- define_method "test interpolation: given the value is in utf-8 it still works" do
- assert_equal 'Hi ゆきひろ!', interpolate(:default => 'Hi %{name}!', :name => 'ゆきひろ')
- end
-
- define_method "test interpolation: given the translation and the value are in utf-8 it still works" do
- assert_equal 'こんにちは、ゆきひろさん!', interpolate(:default => 'こんにちは、%{name}さん!', :name => 'ゆきひろ')
- end
-
- if Kernel.const_defined?(:Encoding)
- define_method "test interpolation: given a euc-jp translation and a utf-8 value it raises Encoding::CompatibilityError" do
- assert_raise(Encoding::CompatibilityError) do
- interpolate(:default => euc_jp('こんにちは、%{name}さん!'), :name => 'ゆきひろ')
- end
- end
-
- # define_method "test interpolation: given a utf-8 translation and a euc-jp value it returns a translation in euc-jp" do
- # assert_equal euc_jp('Hi ゆきひろ!'), interpolate(:default => 'Hi %{name}!', :name => euc_jp('ゆきひろ'))
- # end
- #
- # TODO should better explain how this relates to the test above with the simpler utf-8 default string
- define_method "test interpolation: given a utf-8 translation and a euc-jp value it raises Encoding::CompatibilityError" do
- assert_raise(Encoding::CompatibilityError) do
- interpolate(:default => 'こんにちは、%{name}さん!', :name => euc_jp('ゆきひろ'))
- end
- end
- end
-
- define_method "test interpolation: given a translations containing a reserved key it raises I18n::ReservedInterpolationKey" do
- assert_raise(I18n::ReservedInterpolationKey) { interpolate(:default => '%{default}', :foo => :bar) }
- assert_raise(I18n::ReservedInterpolationKey) { interpolate(:default => '%{scope}', :foo => :bar) }
- assert_raise(I18n::ReservedInterpolationKey) { interpolate(:default => '%{separator}', :foo => :bar) }
- end
- end
- end
-end
View
56 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/link.rb
@@ -1,56 +0,0 @@
-# encoding: utf-8
-
-module Tests
- module Api
- module Link
- define_method "test linked lookup: if a key resolves to a symbol it looks up the symbol" do
- I18n.backend.store_translations 'en', {
- :link => :linked,
- :linked => 'linked'
- }
- assert_equal 'linked', I18n.backend.translate('en', :link)
- end
-
- define_method "test linked lookup: if a key resolves to a dot-separated symbol it looks up the symbol" do
- I18n.backend.store_translations 'en', {
- :link => :"foo.linked",
- :foo => { :linked => 'linked' }
- }
- assert_equal('linked', I18n.backend.translate('en', :link))
- end
-
- define_method "test linked lookup: if a dot-separated key resolves to a symbol it looks up the symbol" do
- I18n.backend.store_translations 'en', {
- :foo => { :link => :linked },
- :linked => 'linked'
- }
- assert_equal('linked', I18n.backend.translate('en', :'foo.link'))
- end
-
- define_method "test linked lookup: if a dot-separated key resolves to a dot-separated symbol it looks up the symbol" do
- I18n.backend.store_translations 'en', {
- :foo => { :link => :"bar.linked" },
- :bar => { :linked => 'linked' }
- }
- assert_equal('linked', I18n.backend.translate('en', :'foo.link'))
- end
-
- define_method "test linked lookup: links always refer to the absolute key" do
- I18n.backend.store_translations 'en', {
- :foo => { :link => :linked, :linked => 'linked in foo' },
- :linked => 'linked absolutely'
- }
- assert_equal 'linked absolutely', I18n.backend.translate('en', :link, :scope => :foo)
- end
-
- define_method "test linked lookup: a link can resolve to a namespace in the middle of a dot-separated key" do
- I18n.backend.store_translations 'en', {
- :activemodel => { :errors => { :messages => { :blank => "can't be blank" } } },
- :activerecord => { :errors => { :messages => :"activemodel.errors.messages" } }
- }
- assert_equal "can't be blank", I18n.t(:"activerecord.errors.messages.blank")
- assert_equal "can't be blank", I18n.t(:"activerecord.errors.messages.blank")
- end
- end
- end
-end
View
84 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/localization/date.rb
@@ -1,84 +0,0 @@
-# encoding: utf-8
-
-module Tests
- module Api
- module Localization
- module Date
- def setup
- super
- setup_date_translations
- @date = ::Date.new(2008, 3, 1)
- end
-
- define_method "test localize Date: given the short format it uses it" do
- # TODO should be Mrz, shouldn't it?
- assert_equal '01. Mar', I18n.l(@date, :format => :short, :locale => :de)
- end
-
- define_method "test localize Date: given the long format it uses it" do
- assert_equal '01. März 2008', I18n.l(@date, :format => :long, :locale => :de)
- end
-
- define_method "test localize Date: given the default format it uses it" do
- assert_equal '01.03.2008', I18n.l(@date, :format => :default, :locale => :de)
- end
-
- define_method "test localize Date: given a day name format it returns the correct day name" do
- assert_equal 'Samstag', I18n.l(@date, :format => '%A', :locale => :de)
- end
-
- define_method "test localize Date: given an abbreviated day name format it returns the correct abbreviated day name" do
- assert_equal 'Sa', I18n.l(@date, :format => '%a', :locale => :de)
- end
-
- define_method "test localize Date: given a month name format it returns the correct month name" do
- assert_equal 'März', I18n.l(@date, :format => '%B', :locale => :de)
- end
-
- define_method "test localize Date: given an abbreviated month name format it returns the correct abbreviated month name" do
- # TODO should be Mrz, shouldn't it?
- assert_equal 'Mar', I18n.l(@date, :format => '%b', :locale => :de)
- end
-
- define_method "test localize Date: given an unknown format it does not fail" do
- assert_nothing_raised { I18n.l(@date, :format => '%x') }
- end
-
- define_method "test localize Date: given nil it raises I18n::ArgumentError" do
- assert_raise(I18n::ArgumentError) { I18n.l(nil) }
- end
-
- define_method "test localize Date: given a plain Object it raises I18n::ArgumentError" do
- assert_raise(I18n::ArgumentError) { I18n.l(Object.new) }
- end
-
- define_method "test localize Date: given a format is missing it raises I18n::MissingTranslationData" do
- assert_raise(I18n::MissingTranslationData) { I18n.l(@date, :format => :missing) }
- end
-
- define_method "test localize Date: it does not alter the format string" do
- assert_equal '01. Februar 2009', I18n.l(::Date.parse('2009-02-01'), :format => :long, :locale => :de)
- assert_equal '01. Oktober 2009', I18n.l(::Date.parse('2009-10-01'), :format => :long, :locale => :de)
- end
-
- protected
-
- def setup_date_translations
- store_translations :de, {
- :date => {
- :formats => {
- :default => "%d.%m.%Y",
- :short => "%d. %b",
- :long => "%d. %B %Y",
- },
- :day_names => %w(Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag),
- :abbr_day_names => %w(So Mo Di Mi Do Fr Sa),
- :month_names => %w(Januar Februar März April Mai Juni Juli August September Oktober November Dezember).unshift(nil),
- :abbr_month_names => %w(Jan Feb Mar Apr Mai Jun Jul Aug Sep Okt Nov Dez).unshift(nil)
- }
- }
- end
- end
- end
- end
-end
View
77 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/localization/date_time.rb
@@ -1,77 +0,0 @@
-# encoding: utf-8
-
-module Tests
- module Api
- module Localization
- module DateTime
- def setup
- super
- setup_datetime_translations
- @datetime = ::DateTime.new(2008, 3, 1, 6)
- @other_datetime = ::DateTime.new(2008, 3, 1, 18)
- end
-
- define_method "test localize DateTime: given the short format it uses it" do
- # TODO should be Mrz, shouldn't it?
- assert_equal '01. Mar 06:00', I18n.l(@datetime, :format => :short, :locale => :de)
- end
-
- define_method "test localize DateTime: given the long format it uses it" do
- assert_equal '01. März 2008 06:00', I18n.l(@datetime, :format => :long, :locale => :de)
- end
-
- define_method "test localize DateTime: given the default format it uses it" do
- # TODO should be Mrz, shouldn't it?
- assert_equal 'Sa, 01. Mar 2008 06:00:00 +0000', I18n.l(@datetime, :format => :default, :locale => :de)
- end
-
- define_method "test localize DateTime: given a day name format it returns the correct day name" do
- assert_equal 'Samstag', I18n.l(@datetime, :format => '%A', :locale => :de)
- end
-
- define_method "test localize DateTime: given an abbreviated day name format it returns the correct abbreviated day name" do
- assert_equal 'Sa', I18n.l(@datetime, :format => '%a', :locale => :de)
- end
-
- define_method "test localize DateTime: given a month name format it returns the correct month name" do
- assert_equal 'März', I18n.l(@datetime, :format => '%B', :locale => :de)
- end
-
- define_method "test localize DateTime: given an abbreviated month name format it returns the correct abbreviated month name" do
- # TODO should be Mrz, shouldn't it?
- assert_equal 'Mar', I18n.l(@datetime, :format => '%b', :locale => :de)
- end
-
- define_method "test localize DateTime: given a meridian indicator format it returns the correct meridian indicator" do
- assert_equal 'am', I18n.l(@datetime, :format => '%p', :locale => :de)
- assert_equal 'pm', I18n.l(@other_datetime, :format => '%p', :locale => :de)
- end
-
- define_method "test localize DateTime: given an unknown format it does not fail" do
- assert_nothing_raised { I18n.l(@datetime, :format => '%x') }
- end
-
- define_method "test localize DateTime: given a format is missing it raises I18n::MissingTranslationData" do
- assert_raise(I18n::MissingTranslationData) { I18n.l(@datetime, :format => :missing) }
- end
-
- protected
-
- def setup_datetime_translations
- # time translations might have been set up in Tests::Api::Localization::Time
- store_translations :de, {
- :time => {
- :formats => {
- :default => "%a, %d. %b %Y %H:%M:%S %z",
- :short => "%d. %b %H:%M",
- :long => "%d. %B %Y %H:%M"
- },
- :am => 'am',
- :pm => 'pm'
- }
- }
- end
- end
- end
- end
-end
View
117 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/localization/procs.rb
@@ -1,117 +0,0 @@
-# encoding: utf-8
-
-module Tests
- module Api
- module Localization
- module Procs
- define_method "test localize: using day names from lambdas" do
- if can_store_procs?
- setup_time_proc_translations
- time = ::Time.parse('2008-03-01 6:00 UTC')
- assert_match /Суббота/, I18n.l(time, :format => "%A, %d %B", :locale => :ru)
- assert_match /суббота/, I18n.l(time, :format => "%d %B (%A)", :locale => :ru)
- end
- end
-
- define_method "test localize: using month names from lambdas" do
- if can_store_procs?
- setup_time_proc_translations
- time = ::Time.parse('2008-03-01 6:00 UTC')
- assert_match /марта/, I18n.l(time, :format => "%d %B %Y", :locale => :ru)
- assert_match /Март /, I18n.l(time, :format => "%B %Y", :locale => :ru)
- end
- end
-
- define_method "test localize: using abbreviated day names from lambdas" do
- if can_store_procs?
- setup_time_proc_translations
- time = ::Time.parse('2008-03-01 6:00 UTC')
- assert_match /марта/, I18n.l(time, :format => "%d %b %Y", :locale => :ru)
- assert_match /март /, I18n.l(time, :format => "%b %Y", :locale => :ru)
- end
- end
-
- define_method "test localize Date: given a format that resolves to a Proc it calls the Proc with the object" do
- if can_store_procs?
- setup_time_proc_translations
- date = ::Date.new(2008, 3, 1, 6)
- assert_equal '[Sat, 01 Mar 2008, {}]', I18n.l(date, :format => :proc, :locale => :ru)
- end
- end
-
- define_method "test localize Date: given a format that resolves to a Proc it calls the Proc with the object and extra options" do
- if can_store_procs?
- setup_time_proc_translations
- date = ::Date.new(2008, 3, 1, 6)
- assert_equal '[Sat, 01 Mar 2008, {:foo=>"foo"}]', I18n.l(date, :format => :proc, :foo => 'foo', :locale => :ru)
- end
- end
-
- define_method "test localize DateTime: given a format that resolves to a Proc it calls the Proc with the object" do
- if can_store_procs?
- setup_time_proc_translations
- datetime = ::DateTime.new(2008, 3, 1, 6)
- assert_equal '[Sat, 01 Mar 2008 06:00:00 +0000, {}]', I18n.l(datetime, :format => :proc, :locale => :ru)
- end
- end
-
- define_method "test localize DateTime: given a format that resolves to a Proc it calls the Proc with the object and extra options" do
- if can_store_procs?
- setup_time_proc_translations
- datetime = ::DateTime.new(2008, 3, 1, 6)
- assert_equal '[Sat, 01 Mar 2008 06:00:00 +0000, {:foo=>"foo"}]', I18n.l(datetime, :format => :proc, :foo => 'foo', :locale => :ru)
- end
- end
-
- define_method "test localize Time: given a format that resolves to a Proc it calls the Proc with the object" do
- if can_store_procs?
- setup_time_proc_translations
- time = ::Time.parse('2008-03-01 6:00 UTC')
- assert_equal [time, {}].inspect, I18n.l(time, :format => :proc, :locale => :ru)
- end
- end
-
- define_method "test localize Time: given a format that resolves to a Proc it calls the Proc with the object and extra options" do
- if can_store_procs?
- setup_time_proc_translations
- time = ::Time.parse('2008-03-01 6:00 UTC')
- options = { :foo => 'foo' }
- assert_equal [time, options].inspect, I18n.l(time, options.merge(:format => :proc, :locale => :ru))
- end
- end
-
- protected
-
- def setup_time_proc_translations
- store_translations :ru, {
- :time => {
- :formats => {
- :proc => lambda { |*args| args.inspect }
- }
- },
- :date => {
- :formats => {
- :proc => lambda { |*args| args.inspect }
- },
- :'day_names' => lambda { |key, options|
- (options[:format] =~ /^%A/) ?
- %w(Воскресенье Понедельник Вторник Среда Четверг Пятница Суббота) :
- %w(воскресенье понедельник вторник среда четверг пятница суббота)
- },
- :'month_names' => lambda { |key, options|
- (options[:format] =~ /(%d|%e)(\s*)?(%B)/) ?
- %w(января февраля марта апреля мая июня июля августа сентября октября ноября декабря).unshift(nil) :
- %w(Январь Февраль Март Апрель Май Июнь Июль Август Сентябрь Октябрь Ноябрь Декабрь).unshift(nil)
- },
- :'abbr_month_names' => lambda { |key, options|
- (options[:format] =~ /(%d|%e)(\s*)(%b)/) ?
- %w(янв. февр. марта апр. мая июня июля авг. сент. окт. нояб. дек.).unshift(nil) :
- %w(янв. февр. март апр. май июнь июль авг. сент. окт. нояб. дек.).unshift(nil)
- },
- }
- }
- end
- end
- end
- end
-end
View
76 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/localization/time.rb
@@ -1,76 +0,0 @@
-# encoding: utf-8
-
-module Tests
- module Api
- module Localization
- module Time
- def setup
- super
- setup_time_translations
- @time = ::Time.parse('2008-03-01 6:00 UTC')
- @other_time = ::Time.parse('2008-03-01 18:00 UTC')
- end
-
- define_method "test localize Time: given the short format it uses it" do
- # TODO should be Mrz, shouldn't it?
- assert_equal '01. Mar 06:00', I18n.l(@time, :format => :short, :locale => :de)
- end
-
- define_method "test localize Time: given the long format it uses it" do
- assert_equal '01. März 2008 06:00', I18n.l(@time, :format => :long, :locale => :de)
- end
-
- # TODO Seems to break on Windows because ENV['TZ'] is ignored. What's a better way to do this?
- # def test_localize_given_the_default_format_it_uses_it
- # assert_equal 'Sa, 01. Mar 2008 06:00:00 +0000', I18n.l(@time, :format => :default, :locale => :de)
- # end
-
- define_method "test localize Time: given a day name format it returns the correct day name" do
- assert_equal 'Samstag', I18n.l(@time, :format => '%A', :locale => :de)
- end
-
- define_method "test localize Time: given an abbreviated day name format it returns the correct abbreviated day name" do
- assert_equal 'Sa', I18n.l(@time, :format => '%a', :locale => :de)
- end
-
- define_method "test localize Time: given a month name format it returns the correct month name" do
- assert_equal 'März', I18n.l(@time, :format => '%B', :locale => :de)
- end
-
- define_method "test localize Time: given an abbreviated month name format it returns the correct abbreviated month name" do
- # TODO should be Mrz, shouldn't it?
- assert_equal 'Mar', I18n.l(@time, :format => '%b', :locale => :de)
- end
-
- define_method "test localize Time: given a meridian indicator format it returns the correct meridian indicator" do
- assert_equal 'am', I18n.l(@time, :format => '%p', :locale => :de)
- assert_equal 'pm', I18n.l(@other_time, :format => '%p', :locale => :de)
- end
-
- define_method "test localize Time: given an unknown format it does not fail" do
- assert_nothing_raised { I18n.l(@time, :format => '%x') }
- end
-
- define_method "test localize Time: given a format is missing it raises I18n::MissingTranslationData" do
- assert_raise(I18n::MissingTranslationData) { I18n.l(@time, :format => :missing) }
- end
-
- protected
-
- def setup_time_translations
- store_translations :de, {
- :time => {
- :formats => {
- :default => "%a, %d. %b %Y %H:%M:%S %z",
- :short => "%d. %b %H:%M",
- :long => "%d. %B %Y %H:%M",
- },
- :am => 'am',
- :pm => 'pm'
- }
- }
- end
- end
- end
- end
-end
View
70 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/lookup.rb
@@ -1,70 +0,0 @@
-# encoding: utf-8
-
-module Tests
- module Api
- module Lookup
- def setup
- super
- store_translations(:foo => { :bar => 'bar', :baz => 'baz' }, :bla => false,
- :string => "a", :array => %w(a b c), :hash => { "a" => "b" })
- end
-
- define_method "test lookup: it returns a string" do
- assert_equal("a", I18n.t(:string))
- end
-
- define_method "test lookup: it returns hash" do
- assert_equal({ :a => "b" }, I18n.t(:hash))
- end
-
- define_method "test lookup: it returns a array" do
- assert_equal(%w(a b c), I18n.t(:array))
- end
-
- define_method "test lookup: it returns a native false" do
- assert_equal false, I18n.t(:bla)
- end
-
- define_method "test lookup: given a missing key, no default and no raise option it returns an error message" do
- assert_equal "translation missing: en, missing", I18n.t(:missing)
- end
-
- define_method "test lookup: given a missing key, no default and the raise option it raises MissingTranslationData" do
- assert_raise(I18n::MissingTranslationData) { I18n.t(:missing, :raise => true) }
- end
-
- define_method "test lookup: does not raise an exception if no translation data is present for the given locale" do
- assert_nothing_raised { I18n.t(:foo, :locale => :xx) }
- end
-
- define_method "test lookup: given an array of keys it translates all of them" do
- assert_equal %w(bar baz), I18n.t([:bar, :baz], :scope => [:foo])
- end
-
- define_method "test lookup: using a custom scope separator" do
- # data must have been stored using the custom separator when using the ActiveRecord backend
- I18n.backend.store_translations(:en, { :foo => { :bar => 'bar' } }, { :separator => '|' })
- assert_equal 'bar', I18n.t('foo|bar', :separator => '|')
- end
-
- # In fact it probably *should* fail but Rails currently relies on using the default locale instead.
- # So we'll stick to this for now until we get it fixed in Rails.
- define_method "test lookup: given nil as a locale it does not raise but use the default locale" do
- # assert_raise(I18n::InvalidLocale) { I18n.t(:bar, :locale => nil) }
- assert_nothing_raised { I18n.t(:bar, :locale => nil) }
- end
-
- define_method "test lookup: a resulting String is not frozen" do
- assert !I18n.t(:string).frozen?
- end
-
- define_method "test lookup: a resulting Array is not frozen" do
- assert !I18n.t(:array).frozen?
- end
-
- define_method "test lookup: a resulting Hash is not frozen" do
- assert !I18n.t(:hash).frozen?
- end
- end
- end
-end
View
35 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/pluralization.rb
@@ -1,35 +0,0 @@
-# encoding: utf-8
-
-module Tests
- module Api
- module Pluralization
- define_method "test pluralization: given 0 it returns the :zero translation if it is defined" do
- assert_equal 'zero', I18n.t(:default => { :zero => 'zero' }, :count => 0)
- end
-
- define_method "test pluralization: given 0 it returns the :other translation if :zero is not defined" do
- assert_equal 'bars', I18n.t(:default => { :other => 'bars' }, :count => 0)
- end
-
- define_method "test pluralization: given 1 it returns the singular translation" do
- assert_equal 'bar', I18n.t(:default => { :one => 'bar' }, :count => 1)
- end
-
- define_method "test pluralization: given 2 it returns the :other translation" do
- assert_equal 'bars', I18n.t(:default => { :other => 'bars' }, :count => 2)
- end
-
- define_method "test pluralization: given 3 it returns the :other translation" do
- assert_equal 'bars', I18n.t(:default => { :other => 'bars' }, :count => 3)
- end
-
- define_method "test pluralization: given nil it returns the whole entry" do
- assert_equal({ :one => 'bar' }, I18n.t(:default => { :one => 'bar' }, :count => nil))
- end
-
- define_method "test pluralization: given incomplete pluralization data it raises I18n::InvalidPluralizationData" do
- assert_raise(I18n::InvalidPluralizationData) { I18n.t(:default => { :one => 'bar' }, :count => 2) }
- end
- end
- end
-end
View
55 activesupport/lib/active_support/vendor/i18n-0.4.1/test/api/tests/procs.rb
@@ -1,55 +0,0 @@
-# encoding: utf-8
-
-module Tests
- module Api
- module Procs
- define_method "test lookup: given a translation is a proc it calls the proc with the key and interpolation values" do
- if can_store_procs?
- store_translations(:a_lambda => lambda { |*args| args.inspect })
- assert_equal '[:a_lambda, {:foo=>"foo"}]', I18n.t(:a_lambda, :foo => 'foo')
- end
- end
-
- define_method "test defaults: given a default is a Proc it calls it with the key and interpolation values" do
- proc = lambda { |*args| args.inspect }
- assert_equal '[nil, {:foo=>"foo"}]', I18n.t(nil, :default => proc, :foo => 'foo')
- end
-
- define_method "test defaults: given a default is a key that resolves to a Proc it calls it with the key and interpolation values" do
- if can_store_procs?
- store_translations(:a_lambda => lambda { |*args| args.inspect })
- assert_equal '[:a_lambda, {:foo=>"foo"}]', I18n.t(nil, :default => :a_lambda, :foo => 'foo')
- assert_equal '[:a_lambda, {:foo=>"foo"}]', I18n.t(nil, :default => [nil, :a_lambda], :foo => 'foo')
- end
- end
-
- define_method "test interpolation: given an interpolation value is a lambda it calls it with key and values before interpolating it" do
- proc = lambda { |*args| args.inspect }
- assert_match %r(\[\{:foo=>#<Proc.*>\}\]), I18n.t(nil, :default => '%{foo}', :foo => proc)
- end
-
- define_method "test interpolation: given a key resolves to a Proc that returns a string then interpolation still works" do
- proc = lambda { |*args| "%{foo}: " + args.inspect }
- assert_equal 'foo: [nil, {:foo=>"foo"}]', I18n.t(nil, :default => proc, :foo => 'foo')
- end
-
- define_method "test pluralization: given a key resolves to a Proc that returns valid data then pluralization still works" do
- proc = lambda { |*args| { :zero => 'zero', :one => 'one', :other => 'other' } }
- assert_equal 'zero', I18n.t(:default => proc, :count => 0)
- assert_equal 'one', I18n.t(:default => proc, :count => 1)
- assert_equal 'other', I18n.t(:default => proc, :count => 2)
- end
-
- define_method "test lookup: given the option :resolve => false was passed it does not resolve proc translations" do
- if can_store_procs?
- store_translations(:a_lambda => lambda { |*args| args.inspect })
- assert_equal Proc, I18n.t(:a_lambda, :resolve => false).class
- end
- end
-
- define_method "test lookup: given the option :resolve => false was passed it does not resolve proc default" do
- assert_equal Proc, I18n.t(nil, :default => lambda { |*args| args.inspect }, :resolve => false).class
- end
- end
- end
-end
View
51 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/active_record/missing_test.rb
@@ -1,51 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../../')); $:.uniq!
-require 'test_helper'
-
-setup_active_record
-
-class I18nActiveRecordMissingTest < Test::Unit::TestCase
- def setup
- store_translations(:en, :i18n => { :plural => { :keys => [:zero, :one, :other] } })
-
- I18n.backend = I18n::Backend::Chain.new(I18n.backend)
- I18n.backend.meta_class.send(:include, I18n::Backend::ActiveRecord::Missing)
-
- I18n::Backend::ActiveRecord::Translation.delete_all
- end
-
- test "can persist interpolations" do
- translation = I18n::Backend::ActiveRecord::Translation.new(:key => 'foo', :value => 'bar', :locale => :en)
- translation.interpolations = %w(count name)
- translation.save
- assert translation.valid?
- end
-
- test "lookup persists the key" do
- I18n.t('foo.bar.baz')
- assert_equal 1, I18n::Backend::ActiveRecord::Translation.count
- end
-
- test "lookup does not persist the key twice" do
- 2.times { I18n.t('foo.bar.baz') }
- assert_equal 1, I18n::Backend::ActiveRecord::Translation.count
- end
-
- test "lookup persists interpolation keys when looked up directly" do
- I18n.t('foo.bar.baz', :cow => "lucy" ) # creates stub translation.
- translation_stub = I18n::Backend::ActiveRecord::Translation.locale(:en).lookup('foo.bar.baz').first
- assert translation_stub.interpolates?(:cow)
- end
-
- test "creates one stub per pluralization" do
- I18n.t('foo', :count => 999)
- translations = I18n::Backend::ActiveRecord::Translation.locale(:en).find_all_by_key %w{ foo.zero foo.one foo.other }
- assert_equal 3, translations.length
- end
-
- test "creates no stub for base key in pluralization" do
- I18n.t('foo', :count => 999)
- translations = I18n::Backend::ActiveRecord::Translation.locale(:en).find_by_key %w{ foo.zero foo.one foo.other }
- assert !I18n::Backend::ActiveRecord::Translation.locale(:en).find_by_key("foo")
- end
-end if defined?(ActiveRecord)
View
57 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/active_record_test.rb
@@ -1,57 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-
-setup_active_record
-
-class I18nBackendActiveRecordTest < Test::Unit::TestCase
- def setup
- I18n.backend = I18n::Backend::ActiveRecord.new
- store_translations(:en, :foo => { :bar => 'bar', :baz => 'baz' })
- end
-
- def teardown
- I18n::Backend::ActiveRecord::Translation.destroy_all
- super
- end
-
- test "store_translations does not allow ambiguous keys (1)" do
- I18n::Backend::ActiveRecord::Translation.delete_all
- I18n.backend.store_translations(:en, :foo => 'foo')
- I18n.backend.store_translations(:en, :foo => { :bar => 'bar' })
- I18n.backend.store_translations(:en, :foo => { :baz => 'baz' })
-
- translations = I18n::Backend::ActiveRecord::Translation.locale(:en).lookup('foo').all
- assert_equal %w(bar baz), translations.map(&:value)
-
- assert_equal({ :bar => 'bar', :baz => 'baz' }, I18n.t(:foo))
- end
-
- test "store_translations does not allow ambiguous keys (2)" do
- I18n::Backend::ActiveRecord::Translation.delete_all
- I18n.backend.store_translations(:en, :foo => { :bar => 'bar' })
- I18n.backend.store_translations(:en, :foo => { :baz => 'baz' })
- I18n.backend.store_translations(:en, :foo => 'foo')
-
- translations = I18n::Backend::ActiveRecord::Translation.locale(:en).lookup('foo').all
- assert_equal %w(foo), translations.map(&:value)
-
- assert_equal 'foo', I18n.t(:foo)
- end
-
- test "can store translations with keys that are translations containing special chars" do
- I18n.backend.store_translations(:es, :"Pagina's" => "Pagina's" )
- assert_equal "Pagina's", I18n.t(:"Pagina's", :locale => :es)
- end
-
- with_mocha do
- test "missing translations table does not cause an error in #available_locales" do
- I18n::Backend::ActiveRecord::Translation.expects(:available_locales).raises(::ActiveRecord::StatementInvalid)
- assert_equal [], I18n.backend.available_locales
- end
- end
-
- def test_expand_keys
- assert_equal %w(foo foo.bar foo.bar.baz), I18n.backend.send(:expand_keys, :'foo.bar.baz')
- end
-end if defined?(ActiveRecord)
View
70 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/cache_test.rb
@@ -1,70 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-
-begin
- require 'active_support'
-rescue LoadError
- $stderr.puts "Skipping cache tests using ActiveSupport"
-else
-
-class I18nBackendCacheTest < Test::Unit::TestCase
- class Backend < I18n::Backend::Simple
- include I18n::Backend::Cache
- end
-
- def setup
- I18n.backend = Backend.new
- super
- I18n.cache_store = ActiveSupport::Cache.lookup_store(:memory_store)
- end
-
- def teardown
- I18n.cache_store = nil
- end
-
- test "it uses the cache" do
- assert I18n.cache_store.is_a?(ActiveSupport::Cache::MemoryStore)
- end
-
- with_mocha do
- test "translate hits the backend and caches the response" do
- I18n.backend.expects(:lookup).returns('Foo')
- assert_equal 'Foo', I18n.t(:foo)
-
- I18n.backend.expects(:lookup).never
- assert_equal 'Foo', I18n.t(:foo)
-
- I18n.backend.expects(:lookup).returns('Bar')
- assert_equal 'Bar', I18n.t(:bar)
- end
-
- test "still raises MissingTranslationData but also caches it" do
- I18n.backend.expects(:lookup).returns(nil)
- assert_raise(I18n::MissingTranslationData) { I18n.t(:missing, :raise => true) }
-
- I18n.backend.expects(:lookup).never
- assert_raise(I18n::MissingTranslationData) { I18n.t(:missing, :raise => true) }
- end
- end
-
- test "uses 'i18n' as a cache key namespace by default" do
- assert_equal 0, I18n.backend.send(:cache_key, :foo).index('i18n')
- end
-
- test "adds a custom cache key namespace" do
- with_cache_namespace('bar') do
- assert_equal 0, I18n.backend.send(:cache_key, :foo).index('i18n-bar')
- end
- end
-
- protected
-
- def with_cache_namespace(namespace)
- I18n.cache_namespace = namespace
- yield
- I18n.cache_namespace = nil
- end
-end
-
-end # AS cache check
View
72 activesupport/lib/active_support/vendor/i18n-0.4.1/test/backend/cascade_test.rb
@@ -1,72 +0,0 @@
-# encoding: utf-8
-$:.unshift(File.expand_path(File.dirname(__FILE__) + '/../')); $:.uniq!
-require 'test_helper'
-
-class I18nBackendCascadeTest < Test::Unit::TestCase
- class Backend < I18n::Backend::Simple
- include I18n::Backend::Cascade
- end
-
- def setup
- I18n.backend = Backend.new
- store_translations(:en,
- :foo => 'foo',
- :bar => { :baz => 'baz' }
- )
- end
-
- def lookup(key, options = {})
- I18n.t(key, options.merge(:cascade => { :step => 1, :offset => 1, :skip_root => false }))
- end
-
- test "still returns an existing translation as usual" do
- assert_equal 'foo', lookup(:foo)
- assert_equal 'baz', lookup(:'bar.baz')