User tests: Successful: Unsuccessful:
Right now in Joomla core, the way to override a language string is to define the key in either the designated overrides file or load it in a file loaded after the version you want to override. This is problematic in some cases because a key gets used in multiple contexts and if you were to load files in the wrong order this results in the wrong translation being displayed. Additionally, this behavior makes it really difficult to create a process for caching a JLanguage
instance with all of the language strings loaded into memory (you replace the processing time loading INIs into memory by just starting with the object having everything).
JText
already exposes an API for using alternate language strings; it should be used in locations where we know localized contexts of a string may be created. This PR does just that for the two keys in the rules form field that are commonly overridden by extensions.
In the com_content component config and article edit view, the permissions strings should use the localized keys for this component.
N/A
Though these keys are renamed in this PR, there is no B/C concern with translations. JText::alt()
checks if the alternate key (built by appending the second parameter to the first parameter) exists before using it, so if it doesn't exist, the base key (which will probably already be translated on a current 3.6 package) will be used.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Language & Strings Libraries |
I didn't want to waste time doing them all if the idea was going to be rejected, I also wanted to have proof that this wasn't going to break anything. If it's fine though I can work through them all.
I have tested this item
Patch ok for me
folks, i think'it is a goog idea. let's keep it, if b/c, for 3.8
@mbabker as Release Lead: Milestone Joomla 3.8.0?
Rebased for 3.8. I did all the strings except the one in com_categories
, with this patch to have a unique string we would have to duplicate it in every extension supporting categories (the key would be JLIB_RULES_SETTING_NOTES_ITEM_<extension>_CATEGORY
or we hardcode some rule into the form field to have yet another lookup for that context, doesn't seem worth the effort to do that.
Labels |
Added:
?
?
|
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
Not sure this should go in 3.8.6. It can safely wait 3.9
Labels |
Added:
?
?
Removed: ? |
Rebased to 3.9.
This has been RTC for 10 months. Is this getting merged or not?
You are the one in charge. No opposition here for merging in 3.10
Labels |
Added:
?
Removed: ? |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-06-02 08:42:42 |
Closed_By | ⇒ | laoneo |
@mbabker
we are using 22 instances of
JLIB_RULES_SETTING_NOTES
in core. (took off the lib ones)Does it mean this PR should be enlarged to all these places?