[Bug] Brazilian Portuguese lang folder name should be pt_BR (ISO 15897)
See original GitHub issueBug report
What I did
Configured the Laravel application locale using ISO 15897 codes in config/app.conf
to:
'locale' => 'pt_BR',
Since the Laravel Documentation states:
For languages that differ by territory, you should name the language directories according to the ISO 15897. For example, “en_GB” should be used for British English rather than “en-gb”.
What I expected to happen
Backpack strings such as “entries per page” to be translated to Brazilian Portuguese.
What happened
Text is shown in English, the configured fallback_locale
.
What I’ve already tried to fix it
Checked that the folder names for Brazilian Portuguese are pt-BR
and pt_br
.
Of course, setting locale
to pt-BR
fixes the problem, but then it goes against Laravel recomendation to use the ISO 15897 language codes, and other languages like da_DK
have lang folders with the proper name.
Backpack, Laravel, PHP, DB version
When I run php artisan backpack:version
the output is:
### PHP VERSION:
PHP 7.4.3 (cli) (built: Oct 6 2020 15:47:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
### LARAVEL VERSION:
v8.21.0@a61cab167c35f465a923737ee6e6fb99cd5fde88
### BACKPACK VERSION:
4.1.34@d9ec59ab1f9fe03c7106911b5667d912c1cfe1f7
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10 (9 by maintainers)
Top GitHub Comments
Indeed @promatik , I was thinking having both now, but yeah, it’s impossible to have both folders. We can only fix this in 4.2 with a BC.
@matheusb-comp the lang strings don’t change that much. Probably will not change until next version where we could introduce the breaking change, in the meanwhile you would not get “automatic” updates since those files are in user land, and can only be overriden if you specify
--force
when publishing assets.Thanks guys for the clarification.
Best, Pedro
Apparently the text was added to the documentation recently, but it seems that Laravel already opted to use the POSIX locales format internally for some time.
An example of this can be seen in the Authentication UI view stub from version 5.7, where the underline from the locale is changed to a dash to conform with a BCP-47 language tag format.