-
-
Notifications
You must be signed in to change notification settings - Fork 185
feat: language:variables root
#6212
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
base: v6/develop
Are you sure you want to change the base?
Conversation
lukasbestle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great solution to move the logic to a separate class. π
A few things I noticed while skimming through the changes:
|
Excited for this, thanks! Will this include the possibility to add translations (e.g. for the panel) even if the language does not have a content language assigned to it? Some of my pages are German only, but should still have English translations for the panel. |
|
@tobimori In your case; multilingual is not enabled for the frontend, but you want to add translations (for example for blueprint labels) for users in different languages using the panel. Do I understand correctly? |
Multilingual is enabled, but the languages in the panel might differ from the languages in the frontend. Currently, I have a translations directory and load yaml files from a plugin. (https://github.com/tobimori/kirby-baukasten/blob/main/site/plugins/project-extended/index.php#L20) |
|
If there is no FR language (so |
|
π¦ |
7f4acb1 to
178fa70
Compare
distantnative
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some first comments. Let me know if you think I misunderstood parts of the code :)
a18e0ef to
b1b372f
Compare
|
@distantnative I did some changes based on your reviews and done some improvements. Would be nice if you take a look when you're available before writing unit tests and last touch π |
b56dad6 to
e4d97b1
Compare
854ddb5 to
1cea8dd
Compare
1cea8dd to
05c2e0f
Compare
|
Rebased this but moved it to v6 due to the breaking change. |
language:variables rootlanguage:variables root
cfa9f36 to
6ae111e
Compare
This PR β¦
This was a more complex problem than I expected (always π). Because the system should be able to read, update and delete language variables both from the language file and from a custom root. It involves a breakage change, but I wanted to remove the code complexity by creating a separate
LanguageVariablesobject.Todos/To discuss
k-language-viewand the API endpoints). Do we fully want to switch tovariables? Then we should make the changes everywhere (with legacy fallbacks for now).$props['translation']to theLanguageVariablesobject? Or would it be better to keep them separate, so thatLanguageVariablesonly takes care about the file and its value. AndLanguagehas the job to merge both arrays ($props['translation']) and$this->variables->toArray()) together. As well as filtering all keys from$props['translation']to only write everything remaining to the variables file.@sincetagsChangelog
Fixes
Features
language:variablesrootBreaking changes
Language::translations()deprecated, useLanguage::variables()instead$language->translations()returnsLanguageVariablesobject insteadarray. Use$language->translations()->toArray()or$language->variables()->toArray().Ready?
For review team