-
Notifications
You must be signed in to change notification settings - Fork 36
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
Language file management improvements #260
Conversation
@phproberto |
OK, I had a mistake in the file (urls should be |
To test, manually add a |
After 21965327895345 tests I'm still unable to reproduce the issue. I'll work on the key.php and the translation edit view to fix the JS there because it's not working anyway. So I'll do a cleanup. Meanwhile if someone wants to help with the ghost issue this are the steps to reproduce it (I cannot do it so I cannot fix the issues there):
|
@phproberto After PR: Original ini string: As you can see, anything after PHP 5.3.14 and php 5.4.4 |
Looks like it could be related to this |
I see now: you use |
Results: |
Travis should be ok now. Ready for the final test before merging :) |
@test |
Oh, you changed more, Will test later. |
Based on joomla/joomla-cms#5907 we cannot merge this. We first need to know what is allowed or not in language strings and then adjust So basically I lost 3 days for nothing |
Nobody's trying to waste your time Roberto, and I don't think you lost those days at all. I think once we answer the question on how to manage the quotes (escape them in JLanguage or expect them to be in the INI files), then this should be good to go following whatever standard is decided. |
Yes. That's why I haven't closed this PR. Expecting to adapt it to whatever is decided as standard. I don't think anybody is trying to waste my time. I just feel that we started to build the house by the roof. @infograf768 has been blamed for slowing down core for trying to support the new standards in Someone in PLT should add an action to write that standards. |
Yeah without this PR roberto we wouldn't have known about the escape issue in the first place. So actually it was super important that you did do this!! |
@phproberto |
Exactly @infograf768. That's the only thing we have to do: escape double quotes. Not sure if it's better to do the work for the translators. I mean they have to know that double quotes need to be escaped and if we do it for them they may think unescaped double quotes are ok. |
To complete (as we discussed elsewhere): |
Hi, :) As far as i can to see this one is not fully implemented on the last 3.4.0 beta. Apply this new rules at Language overrides in this beta have the same result than always, each " is replaced by "QQ" constant. So, if we go there to create an override that have any "escaped doublequote" present it will return an "QQ" for each escaped doublequote and we are creating a problem. And if we have any " under the new rules we will get the same reply: now is replaced by "QQ". When this one is fully applied and running from core, seems that the stuff is handle the wrong double quotes usage in two ways: Wrong usage within text. That sure is easy to apply when really works from core. Now we are running in the old way and seems that the normal is apply pull requests adjusted to the real working mode. Regards. |
@phproberto |
ok :) |
I've modified the content preprocess to try to show language strings exactly as they would be entered inside an ini file which I think will teach people to do things properly. Sample string:
Please @infograf768 check it ant tell me if this is ok for you. Note that THIS IS ONLY DONE IN THE STRINGS view. I won't update the codemirror validations until we know exactly what we want. |
Tested: For the sake of the demonstration I modified the reference en-GB ini file: The Translation part (right column) displays OK before save, not after. |
Thanks! I'll work on the rest now that we agree on how to show strings. |
Hmm, thinking again: |
obsolete |
Fixes #257
The main idea is that we stop using helpers and hardcoded checks and we use a common base class. I just called it
LocaliseLangFile
. Ideally we should create alib_localise
library to store all this things.This only cleans localise helper and the models involved in file checking but I'm sure we can use it in more places to get things simpler.
LocaliseLangFile basics
To check a file for errors:
To get the list of language strings:
While testing errors I found that core has some inconsistency between file error checking && files not loaded in languages. This system is better than core checks and works the same for codemirror and on PHP checks. I tried to maximize the error detection so we can be sure that if a string isn't loaded it will be marked as wrong. Additionally I added errors that core "passes" but produce crap strings.
In fact I think this should go to core so language file handling & checking is abstracted from the language itself and can be reused by third part devs. I'd be happy to contribute it directly to core or as a more complex thing with a common interface and support for different type of language files in https://github.com/joomla-framework/language. I don't know really where it should go.