Which package is being used to handle translations?
pepijn - 2 months ago
Looks a lot like this is handed off to Laravel-Translatable: https://github.com/dimsav/laravel-translatable
However, when I try to search for this package in the repository, nothing comes up. What's the approach here, has laravel-translatable been forked? Which version is being used ? Where can I view the dependency ? Etc. :) Thanks for any input on this, would like to make use of recent features in laravel-translatable
- 2 months ago
Thanks for the info! That's weird, it seems counter intuitive to me that PyroCMS has its own solution for this, which is almost entirely compatible with Dimsav/Laravel-translatable ! (I guess they're both based on the Symfony Translation package)
The feature I'm looking for is a country-based fallback. (
es-mx should fallback to
es, which should fallback to the default
(See 'country-based fallback' in the Laravel-Translatable readme)
Update: seems like this feature is actually handled by the Symfony package! From the symfony docs:
Fallback Translation Locales¶
Imagine that the user's locale is fr_FR and that you're translating the key Symfony is great. To find the French translation, Symfony actually checks translation resources for several locales: First, Symfony looks for the translation in a fr_FR translation resource (e.g. messages.fr_FR.xlf); If it wasn't found, Symfony looks for the translation in a fr translation resource (e.g. messages.fr.xlf); If the translation still isn't found, Symfony uses the fallbacks configuration parameter, which defaults to en (see Configuration).