Releases: userfrosting/i18n
4.5.0
4.4.3
4.4.2
Fixed issue where locale files from higher priority locations would not overwrite files from lower priority locations.
N.B.: This fix means the files withing the same locations will be loaded in BACKWARD order. Having the location order is more important in this case.
4.4.1
- Throws an exception if
translate
placeholder are not numeric or array. - Fix issue with numeric placeholder with non plural keys. See userfrosting#1090.
4.4.0
Complete rewrite of the Translator.
Instead of LocalePathBuilder -> MessageTranslator
, the new translator introduce the concept of Locale
, Dictionary
and Translator
. So now you create a locale, which enables you to create a dictionary for that locale, which finally allows you to create a translator which will used that dictionary.
Instead of loading multiple locale on top of each other, a locale can depend on other locale using the configuration file (ie. locale.yaml
). See the updated doc for more information.
Plural rule are now defined in the locale configuration file instead of the special @PLURAL_RULE
key.
All methods of the Translator
are the same for backward compatibility. The only change is the constructor, which now requires a DictionaryInterface
instance.
Detailed changes :
MessageTranslator
is nowTranslator
.Translator
requires aDictionaryInterface
as some constructor argument instead of paths.LocalePathBuilder
removed.DictionaryInterface
now extendsUserFrosting\Support\Repository\Repository
instead of theTranslator
. The raw data can be accessed using the Dictionary methods.@PLURAL_RULE
special key removed. Use the Locale configuration file (locale.yaml
)plural_rule
attribute instead.- Translator can't load multiple locale anymore. Use the Locale configuration file
parents
attribute instead.
See updated documentation for more details on how to use the new Translator, Locale and Dictionary.
4.3.0
4.2.1
4.2.0
4.1.0
MessageTranslator
is now an extension of the baseRepository
class in userfrosting/support.- Factored out the path building methods into
LocalePathBuilder
. - Removed loading methods. We now rely on the
ArrayFileLoader
class in userfrosting/support.
4.0.2
Support for pluralization
Support for subkeys and compound translations
Uses Twig to interpolate placeholders - allows us to use Twig's filters