F
Filament3mo ago
Thomas

Namespaced translations with different locales

I've installed filament tables in an existing app. I should have done that sooner. We're using non-default locales for this app. For example, instead of en we use en-us. We use the locale as the folder name too. This is causing an issue with Filament as it expects a different locale. When I hardcode App::setLocale('en'), all strings are rendered fine. However, if possible, we prefer to stick to en-us. I have published the translations and renamed en to en-us in lang/vendor/filament-tables but that doesn't seem to do anything. I'm hoping someone here has already dealt with this, if not, worst case we switch to the 'default' locale.
2 Replies
awcodes
awcodes3mo ago
In config/app.php try setting the default locale and fallback locale to ‘en-us’ although I think technically it should be ‘en_US’ according to the HTML specs.
Thomas
Thomas3mo ago
the default and fallback were already set to en-us and i think App::setLocale should override that, it at least did when i tried it, but translations are not still not working unless i revert back to en