New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panel Creates Languages with Odd Locale Array #2426
Comments
Actually I can't see a problem. They are PHP's defined numbers in core: define ('LC_CTYPE', 0);
define ('LC_NUMERIC', 1);
define ('LC_TIME', 2);
define ('LC_COLLATE', 3);
define ('LC_MONETARY', 4);
define ('LC_ALL', 6);
define ('LC_MESSAGES', 5); @lukasbestle What do you think about that? |
Ah, that makes sense. Would be nice if it could export out the constant name, instead of the value. The underlying values could change in a future PHP version, right? Having the constant used would ensure nothing gets mangled because of that. |
It could also save it as a simple string, which avoids all ambiguity. 'locale' => 'en', |
This is something I'd like to improve as well, but it's unfortunately not possible: The language files are stored using the The idea to save the locale as a simple string could work, but it's going to make the code quite a bit more complex (more edge-cases). Also it won't fix this issue completely as the array structure is still required if the developer has defined multiple different locales. I'm leaving this issue open for now, but I don't think we'll implement this in the near future. |
✅ |
Describe the bug
I'm testing out multi-language features of Kirby, but noticed that the Panel creates odd locale arrays in the language files it generates. For example:
To Reproduce
Steps to reproduce the behavior:
'languages' => true
inconfig.php
site/languages
Expected behavior
The
locale
value should either be a simple stringor an array such as
Source: https://getkirby.com/docs/guide/languages/introduction
Kirby Version
3.3.3
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: