Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Releases: dimsav/laravel-translatable

v5.5

07 Feb 08:46
Compare
Choose a tag to compare
  • Added Laravel 5.2 support
  • Dropped Laravel 5.0 support
  • Added scope whereTranslationLike() #183
  • Fire 'updated' event when saving translations. #190
  • setAttribute() returns the model itself, which is now the default in eloquent. #201

v5.4

15 Nov 21:12
Compare
Choose a tag to compare

Added

  • Added compatibility with custom primary key. #174

v5.3

23 Oct 07:38
Compare
Choose a tag to compare

Changes

  • Added country based fallback #169
  • Added whereTranslation() scope. #168

Country based fallback

It is now possible to use country based locales. For example, you can have the following locales:

  • English: en
  • Spanish: es
  • Mexican Spanish: es-MX
  • Colombian Spanish: es-CO

To configuration for these locales looks like this:

    'locales' => [ 
        'en',
        'es' => [
            'MX',
            'CO',
        ],
    ];

We can also configure the "glue" between the language and country. If for instance we prefer the format es_MX instead of es-MX,
the configuration should look like this:

   'locale_separator' => '_',

What applies for the fallback of the locales using the en-MX format?

Let's say our fallback locale is en. Now, when we try to fetch from the database the translation for the
locale es-MX but it doesn't exist, we won't get as fallback the translation for en. Translatable will use as a fallback es (the first part of es-MX) and only if nothing is found, the translation for en is returned.

v5.2

18 Oct 17:09
Compare
Choose a tag to compare

Added

v5.1.2

17 Oct 08:21
Compare
Choose a tag to compare

Fixed

  • Db in tests is dropped and recreated to make tests more stable (3cc29a2)
  • Bug when using syntax $country->{'name:en'} and locale doesn't exist #150

Changed

  • Method isTranslationAttribute() is now public #151

v5.1.1

24 Sep 10:48
Compare
Choose a tag to compare

Fixed

  • Compatibility with Lumen #121
  • Making an attribute on a translatable model hidden does not hide it #133

v5.1

07 May 16:08
Compare
Choose a tag to compare

Added

  • Mutator/accessor translations using the format $country->{'name:de'} thanks to @barryvdh
  • Documentation in readme file

v5.0.1

06 Mar 14:40
Compare
Choose a tag to compare
  • Applied PSR-2 code style.

v5.0

13 Feb 13:54
Compare
Choose a tag to compare
  • Laravel 5 ready
  • Added configuration option for returning fallback translations

v4.5

30 Jan 14:05
Compare
Choose a tag to compare

v. 4.5

  • Added scope to list translated attributes in the current locale.
  • Force fire "saved" event when the original model is not saved, but the translation is. #85