We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2623
    • 34 Posts
    I don’t get this. huh

    I’ve uploaded the file and CHMODed it.

    After executing the script and selecting the appropriate langguage files it shows "Checking language..." and a blank page below, while manager displays a warning for the language file.

    Could someone babystep me to this tool?
      • 22668
      • 718 Posts
      Doesn’t work for chinese files.
      • Hello coroico. I’ve found the tool fails on some files as well, including French as are currently in SVN. Do you think you could look into what might be causing this? Thanks!
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 5811
          • 1,717 Posts
          Hi Ryan,
          I’ve found the tool fails on some files as well, including French as are currently in SVN
          Could you more precise ? I need to know which files ? I have done some tests with the French language Files and chineses language files without find any wrong results.
          Without an example is not so easy to find what is possibly wrong.

          The test on the installer with the French language files give me:

          Same number of labels ? ...

          Total number of labels are different!
          - english labels:169
          - new language file:166

          Are english labels all translated ? ...

          These labels have not been translated: - connection_screen_connection_method
          - status_failed_database_collation_does_not_match
          - warning

          Useless labels ? ...

          Ok

          And with the tests on the manager with the French language files give me:
          Same number of labels ? ...

          Total number of labels are different!
          - english labels:1027
          - new language file:1002

          Are english labels all translated ? ...

          These labels have not been translated: - access_permissions_docs_collision
          - access_permissions_group_link
          - access_permissions_link_to_group
          - access_permissions_link_user_group
          - cfg_base_path
          - cfg_base_url
          - cfg_manager_path
          - cfg_manager_url
          - cfg_site_url
          - database_version
          - document_permissions_error
          - duplicate_name_found_general
          - duplicate_name_found_module
          - modx_news
          - modx_news_tab
          - modx_news_title
          - modx_security_notices
          - rss_url_news_message
          - rss_url_news_title
          - rss_url_security_message
          - rss_url_security_title
          - security_notices_tab
          - security_notices_title
          - validate_referer_message
          - validate_referer_title

          Useless labels ? ...

          Ok

          And with chinese manager file I get:
          Checking chinese

          Language file analysed: E:/Perso/www/modx-1.0.0-rc1/manager/includes/lang/chinese.inc.php

          English reference file analysed: E:/Perso/www/modx-1.0.0-rc1/manager/includes/lang/english.inc.php

          Same number of labels ? ...

          Total number of labels are different!
          - english labels:1027
          - new language file:981

          Are english labels all translated ? ...

          These labels have not been translated: - access_permissions_docs_collision
          - access_permissions_group_link
          - access_permissions_link_to_group
          - access_permissions_link_user_group
          - account_email
          - cfg_base_path
          - cfg_base_url
          - cfg_manager_path
          - cfg_manager_url
          - cfg_site_url
          - configcheck_errorpage_unavailable
          - configcheck_errorpage_unavailable_msg
          - configcheck_unauthorizedpage_unavailable
          - configcheck_unauthorizedpage_unavailable_msg
          - database_charset
          - database_collation
          - database_version
          - document_permissions_error
          - duplicate_name_found_general
          - duplicate_name_found_module
          - file_folder_chmod_error
          - inbox
          - login_cancelled_install_in_progress
          - login_cancelled_site_was_updated
          - modx_news
          - modx_news_tab
          - modx_news_title
          - modx_security_notices
          - none
          - pagination_table_first
          - pagination_table_gotopage
          - pagination_table_last
          - paging_first
          - paging_last
          - paging_next
          - paging_prev
          - paging_showing
          - paging_to
          - paging_total
          - rb_webuser_message
          - rb_webuser_title
          - role
          - role_empty_trash
          - rss_url_news_message
          - rss_url_news_title
          - rss_url_security_message
          - rss_url_security_title
          - security_notices_tab
          - security_notices_title
          - validate_referer_message
          - validate_referer_title

          Useless labels ? ...

          These labels are useless:
          - access_permissions_user_group
          - access_permissions_user_group_access
          - nojava
          - web_access_permissions_user_group
          - web_access_permissions_user_group_access

          On which files the tool fails ?
          • I’m running the tool locally on the French files. I only get partial output:

            MODx Language files checking tool
            Checking francais

            Language file analysed: /Library/WebServer/Documents/Evo/manager/includes/lang/francais.inc.php

            English reference file analysed: /Library/WebServer/Documents/Evo/manager/includes/lang/english.inc.php

            If I run it on another language:
            Checking russian-UTF8

            Language file analysed: /Library/WebServer/Documents/Evo/manager/includes/lang/russian-UTF8.inc.php

            English reference file analysed: /Library/WebServer/Documents/Evo/manager/includes/lang/english.inc.php

            Same number of labels ? ...
            Total number of labels are different!
            - english labels:1013
            - new language file:1009

            Are english labels all translated ? ...
            These labels have not been translated:
            - access_permissions_docs_collision
            - datepicker_offset
            - datepicker_offset_message
            - document_permissions_error
            Useless labels ? ...
            Ok

            In fact it only seems to error on Francais/Fraincaise-utf8. The installer file is fine.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • Based on the number of labels in the English file at your test location, it seems you may not be using the latest files from SVN. Can you try those and see if you get the same issue?
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 22668
                • 718 Posts
                Now the chinese files are checked properly.
                I think the problem was a wrong quotes.

                Feature request:

                • button "Remove deprecated strings"
                • button "Find duplicate strings"
                • button "Create backup"
                  • 22668
                  • 718 Posts
                  I discover the problem. They forgot ";" at the end of the following strings laugh
                  $_lang["captcha_message"] = 'Activer les codes CAPTCHA permet de renforcer la sécurité en exigeant des utilisateurs d\'écrire un code illisible par des machines (automates).'
                  $_lang["captcha_words_message"] = 'Veuillez saisir une liste de mots à utiliser si CAPTCHA est activé. Séparez les mots par des virgules. Ce champ est limité à 255 caractères.'
                  $_lang["configcheck_lang_difference_msg"] = 'La langue actuellement choisie a un nombre de variables différent de la langue par défaut. Ceci n\'est pas nécessairement un problème, mais peut signifier que le fichier de langue doit être mis à jour.'
                  


                  s’il vous plaît
                  For french translators. Please compare previous lang file with new one.
                  grin

                  Here my patch with small fixes and fix for french.
                  http://rapidshare.com/files/250277529/smalllangfixes.zip
                  sorry for the link. attachments don’t work.
                    • 5811
                    • 1,717 Posts
                    This issue comes from the French file itself. 3 lines wasn’t ended by a semi-column : lines 72, 74 & 115
                    As checkLanguageFiles load the file with a "require" statement, the Php parser fails.

                    After correction of the lines, I got the following differences between the two files:

                    MODx Language files checking tool
                    Checking francais-utf8

                    Language file analysed: E:/Perso/www/modx-1.0.0-rc2/manager/includes/lang/francais-utf8.inc.php

                    English reference file analysed: E:/Perso/www/modx-1.0.0-rc2/manager/includes/lang/english.inc.php

                    Same number of labels ? ...

                    Total number of labels are different!
                    - english labels:1013
                    - new language file:1008

                    Are english labels all translated ? ...

                    These labels have not been translated: - datepicker_offset
                    - datepicker_offset_message
                    - messages_message
                    - rss_url_security_message
                    - search_criteria_longtitle_msg

                    Useless labels ? ...

                    Ok

                    A first step to avoid any parsed error needs to comment the line 142 :
                    //    error_reporting (E_ERROR); // to avoid useless include warnings
                    So all parsing errors are listed. Then the line error if the parsing fails give the error line in the original language file analysed.

                    I will do some improvements about this scrpt later.
                      • 5811
                      • 1,717 Posts
                      @Ryan

                      I have updated the SVN branch tattoo/branches/1.0/manager/includes/lang/ with new versions of manager french language files (rev 5296). Hereafter is the delta.
                      181a182,183
                      > $_lang["datepicker_offset"] = 'Décalage du contrôle de saisie de la date: ';
                      > $_lang["datepicker_offset_message"] = 'Le nombre d\'années dans le passé a montré sur le contrôle de saisie de la date.';
                      463c465
                      < $_lang["messages_inbox"] = 'Inbox';
                      ---
                      > $_lang["messages_message"] = 'Message';
                      771c773
                      < $_lang["rss_url_news_message"] = 'Entrez l\'URL du flux pour les bulletins de sécurité MODx.';
                      ---
                      > $_lang["rss_url_security_message"] = 'Entrez l\'URL du flux pour les bulletins de sécurité MODx.';
                      781c783
                      < $_lang["search_criteria_content"] = 'Rech. par contenu';
                      ---
                      > $_lang["search_criteria_content"] = 'Recherche par contenu';
                      785,787c787,789
                      < $_lang["search_criteria_longtitle"] = 'Rech. par titre long';
                      < $_lang["search_criteria_title_msg"] = 'Rechercher les documents dont le titre long contient ce texte';
                      < $_lang["search_criteria_title"] = 'Rech. par titre';
                      ---
                      > $_lang["search_criteria_longtitle"] = 'Recherche par titre long';
                      > $_lang["search_criteria_longtitle_msg"] = 'Rechercher les documents dont le titre long contient ce texte';
                      > $_lang["search_criteria_title"] = 'Recherche par titre';


                      I will update the checkLanguageFiles tool to the following possible improvements:

                      1/ display the Php errors when the language file is not correctly parsed.
                      this will allow to avoid basic errors like forget semi-column character at the end of line or forget to escape an accent.

                      2/ Check that a label is unique in the final file
                      Some errors come by duplication of line (usually the above line) without the label name changing
                      For instance in the previous french file one error was :
                      $_lang["search_criteria_title_msg"] = 'Rechercher les documents dont le titre long contient ce texte';
                      instead of:
                      $_lang["search_criteria_longtitle_msg"] = 'Rechercher les documents dont le titre long contient ce texte';
                      And this error comes only because we have two lines with the labels "search_criteria_title_msg"


                      Other suggestions to improve this tool are welcome.