Feature No Code Attached Yet J4 Issue
avatar MartijnMaandag
MartijnMaandag
19 May 2019

Steps to reproduce the issue

I do understand after the Dutch JoomlaDagen that there is a check on template overrides in Joomla 4 if the original item is changed.
It would be nice to have a check on language overrides also.

Expected result

Warning if the original language string is removed or changed.

Additional comments

When I do use a override to correct a (for me) wrong tramslation/english string in Joomla or an extension, I would like to know if the original string is changed, so I can decide to remove/change/keep the override.

avatar MartijnMaandag MartijnMaandag - open - 19 May 2019
avatar joomla-cms-bot joomla-cms-bot - labeled - 19 May 2019
avatar brianteeman
brianteeman - comment - 19 May 2019

Hi. I was talking about this with @roland-d about this on Saturday night. Could you please explain all the type of checks you would like to see and the benefit of each.

avatar franz-wohlkoenig franz-wohlkoenig - change - 19 May 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 19 May 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 May 2019
Labels Added: J4 Issue
Removed: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - unlabeled - 19 May 2019
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 19 May 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 May 2019
Title
override check in language files
[4.0] override check in language files
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 May 2019
Title
override check in language files
[4.0] override check in language files
avatar franz-wohlkoenig franz-wohlkoenig - edited - 19 May 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 20 May 2019
Status New Information Required
avatar MartijnMaandag
MartijnMaandag - comment - 20 May 2019

What I am thinking about is a list with all the overrides (constants) with the value of the override and the current value of the variable (original text).
It is more or less the same as the view as it is now, without the filter and showing also the text from the original developer (Joomla or Extension builder).
It must give the option to delete the override (if I notice it is the same as original text now, or the original constant does not exist anymore)
It must give me the option to edit the override (while I also see the text of the original constant).
This way I can remove overrides which don't exist anymore or edit/delete overrides which are changed in time.
if someone has more ideas....


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24952.
avatar mbabker
mbabker - comment - 20 May 2019

Not really the most practical thing to pull off. For templates, it's a relatively easier check to make (you can check modification timestamps, file checksums, assume source file paths based on the override file path, etc.), but because of the way Joomla "lazy" loads each language file you couldn't sanely do a post-update check of every constant in your override INI to check for changes (two immediate issues include that some strings take advantage of the fact that loading a file after another one can overwrite a constant, a quirk used in components to override certain strings from the <lang>.ini or <lang>.lib_joomla.ini files; and the override INI files have no information about what constant they're overriding so you'd need to add requirements for that file to put comments above each constant specifying the source if you wanted a verifiable reference).

avatar brianteeman
brianteeman - comment - 21 May 2019

I spent quite a bit of thinking time today on this and like @mbabker I can't think of a sensible way to achieve this

avatar richard67
richard67 - comment - 21 May 2019

I also thought about it and agree with @mbabker and @brianteeman for reasons which @mbabker explained above.

avatar mbabker
mbabker - comment - 21 May 2019

A couple of years ago I was toying with the idea of having a plugin that caches a compiled Joomla\CMS\Language\Language instance which eliminates the need to read all of the language files on each request if the files are already in the cache. The plugin conceptually works, but it ultimately runs into the same problem with the load order of files and constants being overwritten as a result that made me basically give up on that idea. So even if you were able to shove constant metadata into the override file as comments on each thing (source file at a bare minimum), you still ultimately end up running into the overwrite issue at some point without doing a raw filesystem diff and avoiding use of the Language API to pull in everything to a monolithic Language instance.

Maybe some of the work George and I did on the Framework's Language package (specifically the bits about extracting the message catalogue from the Language class to its own class (with a notion of fallback catalogues instead of a single catalogue that gets overwritten, perfect for the "my site is in German but English files are still loaded as the default language" scenario) and extracting the file parser API from the Language class) could help someone put something together. But ultimately without a source file to compare against it's going to blow up pretty badly thanks to the lazy loading and overwriting that happens now.

avatar MartijnMaandag
MartijnMaandag - comment - 22 May 2019

I don't think you understand what I want. I don't want an automated check.
I don't think there are much language overrides in a site. It is not as important als template overrides, which can disturbe your site.
I would be glad if the present information is changed:
screen shot 2019-05-22 at 10 11 53
The filter must contain 'Show all', which shows all the language overrides (all ectensions and all languages).
Below the 'Text' of the Override I would like to see the present text of the language variable. This way I can manualy delete a override if it is equal to the origin and edit it when the origin is changed.
If I edit the override variable I want to see the present variable.
Again: No automated check!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24952.
avatar brianteeman
brianteeman - comment - 22 May 2019

Ah - we misunderstood

This sounds similar to #22259

Both of which seems a good idea to me although the comments from @infograf768 on that issue state that it is not possible

avatar mbabker
mbabker - comment - 22 May 2019

Below the 'Text' of the Override I would like to see the present text of the language variable. This way I can manualy delete a override if it is equal to the origin and edit it when the origin is changed.

That bit runs into the problems with the load order of files and constants. It is hardcoded into the Language class that the overrides file be loaded when it is instantiated and it is loaded into a separate array from the main message catalogue, then when a language file is loaded basically the new file is merged over the message catalogue then the overrides merged back in on top of that. So there is not a way using the API to show both the text of an override AND its original text (again the original text bit requires that the system knows where the original came from and that is information that is not stored anywhere at present), the closest practical solution as far as code goes to dealing with that is using the extracted API logic from the Framework package since using the catalogue and parsers standalone from the main Language class will let you assemble a message catalogue with the source information without it being "polluted" by the hardcoded override logic.

avatar infograf768
infograf768 - comment - 22 May 2019

Some aspects could be done for the list, after a full refactoring of the overrides.
Please read #22259 (comment)

If that refactoring is done, we "could" get new ways of filtering to display in the list all overrides with a "Show All" and filter separately or not by Language, Client and even Constant.

But that would not solve your expected result, i.e. get a Warning if the original language string is removed or changed. as @mbabker rightfully explains.

Also the same constant may have different values depending from which component they are loaded. Example JLIB_RULES_SETTING_NOTES
Let's not forget also that we may have NO original value for a constant which string is created in the override file as some constant may be for example the Title of a custom field, or other similar situations.

avatar alikon
alikon - comment - 3 Feb 2020

Closing this due to not receiving required information to determine if this is a bug or not. If you feel this still needs review, please open a new tracker entry with as much information as possible to ensure it can be reviewed properly

avatar alikon alikon - close - 3 Feb 2020
avatar alikon alikon - change - 3 Feb 2020
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2020-02-03 19:21:27
Closed_By alikon
avatar brianteeman
brianteeman - comment - 3 Feb 2020

This was not a bug report - it was a feature request

avatar alikon alikon - change - 3 Feb 2020
Status Closed New
Closed_Date 2020-02-03 19:21:27
Closed_By alikon
avatar alikon alikon - reopen - 3 Feb 2020
avatar jwaisner
jwaisner - comment - 3 Feb 2020

@brianteeman if this is a feature request from this far back and was tagged as "information Needed". Then something was missing at some point. Maybe it isnt the right status now, but no follow up as been completed and if it needs a different state then someone who felt it was a viable feature could have changed it to "confirmed" so someone can start a PR.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24952.

avatar ceford
ceford - comment - 27 Oct 2020

I have experience of something like this with a custom component and multiple languages. For the request here I think the solution needs a couple of tables, one for the joomla strings and one for the overrides, both with last update dates. Should this be a third party extension rather than a core feature? And is it a site specific solution - something to run after an update? Something for an Ideas page (do we have one)?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24952.

avatar Hackwar Hackwar - change - 19 Feb 2023
Labels Added: ? No Code Attached Yet
Removed: ?
avatar Hackwar Hackwar - labeled - 19 Feb 2023
avatar coolcat-creations
coolcat-creations - comment - 11 Mar 2023

I would like to see a more robust language override system where I can track that the original strings were changed but also which ones are even still in use and also track changes between the languages. For example, if I have 7 languages and I change the overrides from 3 of them to have a check to change the other 4 languages as well.

avatar rdeutz
rdeutz - comment - 22 Apr 2024

This needs more discussion and definition what we want to achive and what can be done. Moving it to dicussion.

avatar rdeutz rdeutz - change - 22 Apr 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-04-22 07:31:55
Closed_By rdeutz
Labels Added: Feature
Removed: ?
avatar rdeutz rdeutz - close - 22 Apr 2024

Add a Comment

Login with GitHub to post a comment