Changes

Jump to navigation Jump to search
Line 53: Line 53:     
It provides what I presume is the usual opportunities for manual and automatic language translation, and has a project / component structure.
 
It provides what I presume is the usual opportunities for manual and automatic language translation, and has a project / component structure.
 +
 +
It also responds to the locale in the browser and displays in the selected language
    
It provides a number of different formats for input of the text to be translated, but not ".lex"  files.   
 
It provides a number of different formats for input of the text to be translated, but not ".lex"  files.   
Line 116: Line 118:  
</th>
 
</th>
   −
</syntaxhighlight>clearly then the lexicon routines identifies the "local" language and returns the locally translated string.  If the key passed thrugh does not match then the key itself is returned.  
+
</syntaxhighlight>clearly then the lexicon routines identifies the "local" language and returns the locally translated string.  If the key passed through does not match then the key itself is returned.  
    
==== The Navigation menu ====
 
==== The Navigation menu ====
Line 142: Line 144:  
https://chromewebstore.google.com/detail/locale-switcher/kngfjpghaokedippaapkfihdlmmlafcc?pli=1
 
https://chromewebstore.google.com/detail/locale-switcher/kngfjpghaokedippaapkfihdlmmlafcc?pli=1
   −
==== Converting back to .lex (or .pm) files. ====
+
==== Converting back to .lex files. ====
 
The original converted .lex files (as .po files) are saved in a pofiles directory /usr/share/smanager/lib/I18n/Modules/<whatever>/pofiles. These have been uploaded to the Git repo for smeserver-manager-locale.  These will be updated through Weblate and then converted back to the .pm files. The Pull request for each change or set of changes will be created by Weblate and then acted upon by a moderator and then the .lex files re-generated and incorporated into an rpm for testing and subsequent release.  Program to convert po files back to lex files https://src.koozali.org/brianr/Lex2Po/src/branch/main/Po2Lex.py
 
The original converted .lex files (as .po files) are saved in a pofiles directory /usr/share/smanager/lib/I18n/Modules/<whatever>/pofiles. These have been uploaded to the Git repo for smeserver-manager-locale.  These will be updated through Weblate and then converted back to the .pm files. The Pull request for each change or set of changes will be created by Weblate and then acted upon by a moderator and then the .lex files re-generated and incorporated into an rpm for testing and subsequent release.  Program to convert po files back to lex files https://src.koozali.org/brianr/Lex2Po/src/branch/main/Po2Lex.py
    
==== Spotting untranslated messages ====
 
==== Spotting untranslated messages ====
Untranslated messages are spotted by comparing the original English with the "translated" text. If they are the same, then the text has NOT been translated. The other situation that occurs is that when comparing the translated text in <modulename>_<language_code>.lex (imported from the smeserver-msanager-locale rpm) and the english text <modulename>_en.lex (which is imported in smeserver-manager rpm), then the key taken from the translated file does not exist in the English (original) file. I assume that the latter is due to the lex translated lex file being brought across from SM1 un touched whereas the english lex file has been editted to reflecxt which of the messages are actually in use by SM2. Incidentally all the lex files (from either rpm) are held in /usr/share/smanager/lib/SrvMngr/I18N/Modules/<modulename>. This difference is reflected in the placement of those files in the git repos smeserver-manager-locale and smeserver-manager,
+
Untranslated messages are spotted by comparing the original English with the "translated" text. If they are the same, then the text has NOT been translated. The other situation that occurs is that when comparing the translated text in <modulename>_<language_code>.lex (imported from the smeserver-manager-locale rpm) and the english text <modulename>_en.lex (which is imported in smeserver-manager rpm), then the key taken from the translated file does not exist in the English (original) file. I assume that the latter is due to the lex translated lex file being brought across from SM1 un touched whereas the english lex file has been edited to reflect which of the messages are actually in use by SM2. Incidentally all the lex files (from either rpm) are held in /usr/share/smanager/lib/SrvMngr/I18N/Modules/<modulename>. This difference is reflected in the placement of those files in the git repos smeserver-manager-locale and smeserver-manager, In some cases the key or Id used does not include the prefix when it ought to. Or sometimes the Id does not correspond entirely to the Id in the lex file (programmer error!), remeber if you change the id in the controller or template files, the all the .lex files need to be examined. Better to
 +
 
 +
So I wrote another program https://src.koozali.org/brianr/Lex2Po/src/branch/main/Check_Translation.py to spot the untranslated messages and also to delete in the "translated" lex filers the entries that do not appear in the english file. There were a few exceptions to this - ones dealing with time (AM, PM and AM/PM) and also the ones for some of the linux internals (cifs and nfs). The editted lex files have been played back to the main git repos.  At some point I will re-build the rpms for smeserver-manager-locale and smeserver-manager and then clearly we need to test all (or an many as we can) paths through all the SM2 modules to make sure we are not missing messages.
 +
 
 +
==== Testing the language translations ====
 +
I'd like to do an audit of the current translations ( they where taken from SM1) and see whether SM2 processes them all correctly and identify where there are areas for extra attention.
 +
 
 +
As at 27july2024, The minimum smeserver-manager is version 11.0.0-10 (there may be -14 by the time you read this) and the smeserver-manager-locale is at 11.0.0-4. Note that in the latter case you have to load each rpm for each language.  If you are on earlier version then the navigation menu is not correctly translated in many cases.
 +
 
 +
This should work:
 +
 
 +
dnf update smeserver-manager-locale-*
 +
 
 +
and
 +
 
 +
dnf update smerver-manager
 +
 
 +
Using the Chrome or Chromium browser, there is a plugin called "Locale Switcher" which will allow the browser locale to be switched into whatever language you choose. This can then be used to test each language translations. Switching locale (language) results in the panel being instantly updated to the new language.
 +
 
 +
No  translations have complete coverage , so testing each one will result in anomalous messages, remember to look at the left navigation menu as well as the panel text.  There have been some changes to the headings and description of panels in the Navigation menu, these have not yet been incorporated into the lex files (and therefore not translated!).
 +
 
 +
So, go through as many of the SM2 panels as possible in each of the languages (they are listed in a section above) and spot situations where the  message has not been translated  (and is in English) OR shows the message ID rather than the translated OR where the translated text has HTML in it which is not being interpreted.  This screen shot demonstrates what I mean:
 +
[[File:Screenshot from 2024-07-27 14-28-29.png|left|thumb|Domains panel in Turkish. Showing anomalous messages. ]]
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
In this case its looks as though the button text does not match the equivalent id in the .lex files (this will require a change to the template files or more likely to the Turkish lex file(s). These may be similar errors in other files.
 +
 
 +
In some cases the Message Id in the translation file does not match the Id used in the Code. HTML has to be passed through Mojolicious specifically so we need to wrap a routine around that message in the code.
 +
 
 +
Note you could stay on one panel and switch between languages OR choose a language and examine all the panels.
 +
 
 +
Note that some global buttons such as the login are not translated.  They could be. 
 +
 
 +
Also the control buttons for the clever table sorting, filtering etc are not translated. This needs looking into as those facilities are provided by javascript.
 +
 
 +
There may also be formatting / placement issues, in some cases depending if the length of the translated text differs substantially from the original text.
   −
So I wrote another program https://src.koozali.org/brianr/Lex2Po/src/branch/main/Check_Translation.py to spot the untranslated messages and also to delete in the "translated" lex filers the entries that do not appear in the english file. There were a few expcetions to this - ones dealing with time (AM, PM and AM/PM) and also the ones for some of the linux internals (cifs and nfs). These have been played back to the main git repos.  Clearly we need to test all (or an many as we can) paths through all the SM2 modules to make sure we are not missing messages.
+
Please log any anomalies. Best in Bugzilla, but a separate document or wiki page are other options.
   −
==== Other Anomalies ====
+
The most obvious one is that any translations which are clearly not optimal or missing and if you speak the language, then please log your recommendations.

Navigation menu