Skip to content

Releases: RinkAttendant6/JsonI18n

v2.2.1

06 Mar 08:24
85816fa
Compare
Choose a tag to compare

Fix new strict setting with translate formatted function _f

v2.2

06 Feb 05:31
76367ee
Compare
Choose a tag to compare

New features

Strict mode

Added a strict setting (defaults to true). In strict mode, an exception is thrown when attempting to translate a key that is not defined in the resources for the given locale.

v2.1.1

20 Jan 03:23
Compare
Choose a tag to compare

Developer

  • Removed all Node dependencies and move development scripts to Composer scripts
  • Added PHP 7.1, 7.2, and 7.3 to continuous integration tests
  • Updated development dependencies

v2.1

30 Dec 10:06
Compare
Choose a tag to compare

Updates

Bump minimum PHP version to PHP 7.1

Developer

  • Added scalar type declarations for parameters and return types
  • Added strict typing wherever possible
  • Changed directory structure for compliance with PHP standard filesystem structure
  • Changed code for compliance with PSR-2 coding standards
  • Changed test cases for compatibility with PHPUnit 6.x

v2.0

23 May 03:16
Compare
Choose a tag to compare
Merge pull request #14 from RinkAttendant6/2.x

2.0

v2.0.0 (BETA)

12 Dec 07:29
Compare
Choose a tag to compare
v2.0.0 (BETA) Pre-release
Pre-release

New features

Sub-resources

Sub-resources allow you to split each locale's messages into separate JSON files.

Changed

New resource structure

{
  "@metadata": {
    "arrayGroups": {
      "label": {
        "en": "label_en",
        "fr": "label_fr"
      }
    },
    "description": "Whatever you want here, all properties in @metadata except arrayGroups is ignored"
  },
  "en": {
    "greeting": "Hi, %s!"
  },
  "fr": {
    "greeting": "Salut %s!"
  }
}

This format was largely inspired by the jquery.i18n project by the Wikimedia Foundation, though the formats are not 100% compatible with each other.

Developer

  • Added PHP7 and HHVM to continuous integration

v1.2.1

25 Nov 21:14
Compare
Choose a tag to compare

Bug fixes

  • Fixed: Attempting to add a resource without an arrayGroups value caused a warning
  • Fixed: Values added to incorrect array in subsequent resources

v1.2

17 Oct 02:30
Compare
Choose a tag to compare

New features

  • Support for PHP 5.6 __debugInfo method (#5)
  • Resources of different types can now be added (#10). In addition to a file name of a JSON file, you can now pass into addResource:
    • JSON string
    • PHP associative array resembling the expected format of the JSON
  • Errors from json_decode will cause an exception to be thrown with the code from json_last_error() instead of continuing silently

Developer

  • phpDocumentor is added to the list of Grunt tasks

v1.1.2

18 May 19:51
Compare
Choose a tag to compare

Bug fixes

  • Silently fail on null arrays when passed to localizeArray

Developer

  • Build tools now implemented and added to Travis CI. Code quality checks include phplint, phpunit, and phpcpd.

v1.1.1

22 Apr 18:15
Compare
Choose a tag to compare

Bug fixes

  • Allow localization of one-dimensional arrays using localizeArray