This repository has been archived by the owner on Jun 18, 2019. It is now read-only.
Releases: dimsav/laravel-translatable
Releases · dimsav/laravel-translatable
v5.5
v5.4
v5.3
Changes
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
Added
- Option to override default locale #158
- Default value in translatedIn() scope #148
- New scope withTranslation() (including tests) to decrease the number of mysql calls made.
- Added documentation about scopes.