Skip to content

Releases: Mistralys/application-localization

Minor improvements

13 Oct 09:09

Choose a tag to compare

Included in this release:

  • Currencies: Added an interface for country currencies.
  • Currencies: Adjusted return types so country currency methods are visible.

Timezone improvements

28 Jul 09:45

Choose a tag to compare

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

25 Jul 13:41

Choose a tag to compare

Included in this release:

  • Countries: Added the getTimezone() method to get the timezone of a country.
  • Countries: Added the CountryBasket utility 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

21 Jul 13:42

Choose a tag to compare

Included in this release:

  • Countries: Added the Netherlands (NL).
  • Countries: Added Sweden (SE).
  • Currencies: Added the Swedish Krona (SEK).
  • Currencies: Added methods getSingularInvariant() and getPluralInvariant().
  • 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)

21 May 12:17

Choose a tag to compare

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 uk for gb.
  • 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_UK for en_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-release command.
  • Composer: Added the clear-class-cache command.
  • 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)

23 Oct 05:39

Choose a tag to compare

Included in this release:

  • Countries: Added a country collection accessible via Localization::createCountries().
  • Countries: Added the ISO_CODE constant to all country classes.
  • Countries: Fixed some separator character mixups.
  • Locales: Added the LOCALE_NAME constant to all locale classes.
  • Locales: Added the LocaleInterface interface.
  • Locales: Added the es_MX locale.
  • Currencies: Added the CurrencyInterface interface.
  • Currencies: Added the ISO_CODE constant 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 => CountryInterface
  • Localization_Country => CountryInterface or BaseCountry
  • Localization_Currency => CurrencyInterface or BaseCurrency
  • BaseCurrency::isCurrencyKnown() => Localization::createCurrencies()->idExists()
  • Localization_Currency_Number => CurrencyNumberInfo
  • Localization_Event_LocaleChanged => LocaleChanged

Bugfix release.

10 Aug 11:49

Choose a tag to compare

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() and createCountry() to check the created objects.
  • Contexts: Partially sanitizing the context information to remove unsupported HTML tags.

Feature release.

08 Aug 10:59

Choose a tag to compare

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() and ptexs().
  • Updated the entire codebase to pass level 7 PHPStan checks.
  • Internal parser improvements.
  • Fixed duplicate slashes being added to single quotes.
  • Added changelog.txt and version.txt.

Dependency update release.

12 Mar 09:30

Choose a tag to compare

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 like parseNumber() did previously.
  • Javascript parsing: Now using the separate JTokenizer package instead of bundling it.
  • Solved deprecated warnings and errors in PHP7.4+.

Bugfix release.

28 Jul 07:41

Choose a tag to compare

Included in this release:

  • Fixed double-quotes not being escaped correctly when saving the INI file.