All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Added Windows OS to CI tests
- Updated dependencies
- Improved testing for edge cases
- Replaced Travis with GitHub Action for build
- Upgrade deprecation in tests
- 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.)
- Throws an exception if
translate
placeholder are not numeric or array. - Fix issue with numeric placeholder with non plural keys. See userfrosting#1090.
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.
- Dropping support for PHP 5.6 & 7.0
- Updated Twig to 2.x
- Updated PHPUnit to 7.5
- 100% Test coverage (#9)
- Factor translate() into smaller methods (#3)
- Fix misc issues for edge cases, especially when a plural rule couldn't be found
- General code improvements, test optimizations and code styling
- Replaced
rockettheme/toolbox
withuserfrosting/uniformresourcelocator
fromuserfrosting/support
4.2.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.
- Fixed Illuminate/config version requirement
- Moved dependencies to
require
- Fixed standards compliance issues
- Replacing
str_replace
with Twig for placeholder replacement
- Initial release