Releases: Mistralys/application-localization
Releases · Mistralys/application-localization
Minor improvements
Timezone improvements
Included in this release:
- Timezones: Added getters for countries and locales.
- Timezones: Added an interfaces to split global and country timezones.
- Timezones: Added basket collection classes for global and country timezones.
- Timezones: Fixed London being labeled as Paris.
- Countries: Fixed
filterCode()not initializing the collection. - Locales: Added a locale basket collection class.
- Dependencies: Bumped up AppUtils Collections to v1.2.1.
Added timezone support
Included in this release:
- Countries: Added the
getTimezone()method to get the timezone of a country. - Countries: Added the
CountryBasketutility class for freeform country selections. - Timezones: Added time zone classes.
- PHPStan: Clean up to level 8.
- Dependencies: Bumped up AppUtils Collections to v1.2.0.
Added the Netherlands and Sweden
Included in this release:
- Countries: Added the Netherlands (
NL). - Countries: Added Sweden (
SE). - Currencies: Added the Swedish Krona (
SEK). - Currencies: Added methods
getSingularInvariant()andgetPluralInvariant(). - Currencies: Canadian Dollars are now called "Canadian Dollars" instead of just "Dollars".
- Currencies: Singapore Dollars are now called "Singapore Dollars" instead of just "Dollars".
- Locales: Added the
choose()method to access known locales by methods. - Build: Now generating the canned locales class automatically.
Full Changelog: 2.0.0...2.0.1
Core revamp and new countries (Breaking-XL)
Included in this release:
- Countries: Added Finland (
FI). - Countries: Added Belgium (
BE). - Countries: Added Singapore (
SG). - Countries: Added Ireland (
IE). - Countries: Added
getLabelInvariant()to get the label in invariant locale. - Countries: Now using dynamic class loading.
- Countries: Renamed and namespaced all country classes.
- Countries: Added
getMainLocale(). - Countries: Now handling ISO code aliases like
ukforgb. - Currencies: Now using dynamic class loading.
- Currencies: Renamed and namespaced all currency classes.
- Currencies: Added the Singapore Dollar (
SGD). - Locales: Renamed and namespaced all locale classes.
- Locales: Added
getLabelInvariant()to get the label in the invariant locale. - Locales: Normalized the labels that were not consistently showing the country name.
- Locales: Now handling locale code aliases like
en_UKforen_GB. - Tests: Namespaced and organized all test classes.
- Tests: Added a trait text translation test (#2).
- Editor: Better path display for files with warnings.
- Parser: Replaced the obsolete JTokenizer with Peast.
- Translator: Improved exception message for mismatched placeholders, now also with error code.
- Composer: Added the
build-releasecommand. - Composer: Added the
clear-class-cachecommand. - Composer: The class cache is now automatically cleared on autoloader generation.
- Documentation: An overview of countries, locales and currencies is now generated.
- Code: PHPStan analysis is now clean, up to level 6.
- Code: PHP8.4 compatible.
- Core: Switched license to MIT (was GPL3).
- Dependencies: Updated AppUtils Core to v2.3.11.
- Dependencies: Updated AppUtils Collections to v1.1.5.
Breaking changes
Virtually all classes have been renamed and namespaced, and any
references to them must be updated in your applications.
I recommend using a static code analysis tool like PHPStan
to find all references to the old class names.
All deprecated methods have been removed.
Country and Currency collections (Deprecation)
Included in this release:
- Countries: Added a country collection accessible via
Localization::createCountries(). - Countries: Added the
ISO_CODEconstant to all country classes. - Countries: Fixed some separator character mixups.
- Locales: Added the
LOCALE_NAMEconstant to all locale classes. - Locales: Added the
LocaleInterfaceinterface. - Locales: Added the
es_MXlocale. - Currencies: Added the
CurrencyInterfaceinterface. - Currencies: Added the
ISO_CODEconstant to all currency classes. - Currencies: Added
getCountries(). - Currencies: Added
isNamePreferred(). - Currencies: Added
getPreferredSymbol(). - Currencies: Improved template-based formatting.
- Generator: Fixed clientside files being regenerated every time.
Currency changes
Currencies can now be accessed without a country context for accessing basic
information. For number formatting, a country context is still required:
Get the currency from a country object for the added functionality.
Deprecations
Localization_Currency::getCountry(), no replacement planned.Localization::createCountry()=>Localization::createCountries()->getByID()CountryInterface::getCurrencyID()=>getCurrencyISO()Localization_CountryInterface=>CountryInterfaceLocalization_Country=>CountryInterfaceorBaseCountryLocalization_Currency=>CurrencyInterfaceorBaseCurrencyBaseCurrency::isCurrencyKnown()=>Localization::createCurrencies()->idExists()Localization_Currency_Number=>CurrencyNumberInfoLocalization_Event_LocaleChanged=>LocaleChanged
Bugfix release.
Included in this release:
- Editor: Fixed the error message shown when using the search.
- Tests: Added tests to the PHPStan analysis; Added type hints.
- Example: Updated the example files to be fully valid PHP files.
- Locales: Moved locales to separate files for easier maintenance.
- Core: Updated
createLocale()andcreateCountry()to check the created objects. - Contexts: Partially sanitizing the context information to remove unsupported HTML tags.
Feature release.
Included in this release:
- Added support for adding translation context information.
- When available, context information is shown in the translation UI.
- Added the global functions
tex(),ptex()andptexs(). - Updated the entire codebase to pass level 7 PHPStan checks.
- Internal parser improvements.
- Fixed duplicate slashes being added to single quotes.
- Added
changelog.txtandversion.txt.
Dependency update release.
Included in this release:
- Minimum PHP version increased to PHP7.3.
- Currency:
parseNumber()now always returns a value (and throws an exception if it fails). - Currency: Added
tryParseNumber()method, which behaves likeparseNumber()did previously. - Javascript parsing: Now using the separate JTokenizer package instead of bundling it.
- Solved deprecated warnings and errors in PHP7.4+.
Bugfix release.
Included in this release:
- Fixed double-quotes not being escaped correctly when saving the INI file.