Also fix the rescue_format deprecation, it seems it was never being triggered because it was checking for the existence of a not yet defined variable.
Created a test-case for an issue where the Fallbacks module will generate an I18n::InvalidLocale error. Fallbacks relies on I18n.translation to find out whether there's a translation for a fallback locale (e.g. :'de' for :'de-DE'). But I18n.translation does not distinguish from a "user" call and one coming from the Fallbacks module, and may raise I18n::InvalidLocale if enforce_available_locales is set.
currently setting this config to false will not stick due to the memoize overwriting it back to nil. this probaly works ok in many circumstances because of falsy nil, but annoyingly it does not prevent the deprecation warning that comes along with having the setting unconfigured.
…nfig.enforce_available_locales Renamed `I18n.enforce_available_locales` method to `I18n.enforce_available_locales!`
I18n.locale_available? looks for the passed locale in the `I18n.available_locales` list. --- Enforce available locales When `I18n.config.enforce_available_locales` is true we'll raise an I18n::InvalidLocale exception if the passed locale is available. The default is set to `nil` which will display a deprecation error. If set to `false` we'll skip enforcing available locales altogether (old behaviour). This has been implemented in the following methods : - I18n.config.default_locale= - I18n.config.locale= - I18n.translate - I18n.localize - I18n.transliterate
…_message Also added deprecation message for the :rescue_format option
…ooking up namespaces
… which have US-ASCII encoded symbols)
They were both identical, failing under jruby, trying to access instance variables etc..
Where translations are drawn from different sources which may be using different codes for the same language it can be useful to have mappings where two codes fallback to each other. This patch allows that by ensuring that the recursion in the computation of the mapping terminates instead of running out of stack.
- Actually test signature override - Dn't influence other tests
…This is useful for other translation engines that do not want to use the key based syntax (tr8n). Also makes it a lot easier to put a cache in front of I18n.
It was incorrectly written; Based both on the knowledge of my mother tongue (Polish) and the pluralization rules specified on the Unicode.org website (http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)
…18n::MissingTranslation (which is a plain Object) for the default case. Create an I18n::MissingTranslationData exception only if it needs to be raised to the user.
…needs further investigation as MissingTranslationData still is a subclass of Exception and the I18n.t still simply raises (as currently defined by the API).