[Deprecated] A Laravel package for multilingual models
It is now possible to use country based locales. For example, you can have the following locales:
en
es
es-MX
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.
$country->{'name:en'}
and locale doesn't exist #150