Add option to skins to decide adding or merging localization #9076
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
It would be a nice feature if there was an option in the skin's meta.json to decide the method of adding (or merging) the localized strings to the system.
In my case, I extended the elastic skin just to completely change the login page and I wanted to change the "Username" label to "E-mail address", to provide a bit more information to the user what to write to that field. I found out that I only can do that changing the text in the
program/localization/$lang/labels.inc
file. Putting it in theskins/$skin/localization/$lang.inc
cannot override the system's label, only adds new ones.The
load_language()
function already supports merging the additional texts besides the adding. I think it would be a good way defining a new variable in the skins's meta.json, for examplelocalization_merge
with a boolean value, and parse it in theload_skin()
method. The default behavior should be adding, so nothing changes without explicitly adding the variable to meta.json.