Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-9709

Missing language files for MCP could be substituted by default / english ones

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.7-PL1
    • Fix Version/s: 3.1.0-b1
    • Labels:
      None
    • Environment:
      PHP 5.3.1, MySQL 5.1.41, Opera 10.54 / Firefox 3.0.5

      Description

      When having installed other language packs (like DE and ES) and mods most basic board elements automatically show the english language constants if the localized ones are not found (e.g. user language is set to ES and using some functionality of a mod that only came with EN language).

      However, in the MCP this fails totally. This is because "add_mod_info()" in "/includes/functions_module.php" only makes sure the "/mods" folder exists but cannot compare the files found in there with anything. Hence, no file might match the criteria, which ultimately results in all of the mod lang consts not being parsed by the template system.

      A quick workaround would be to check if the user has another language set than english. If so, simply load all english files. After that the function can overwrite any localization it finds, whereas non-existing would still at least exist in english.

      The following code fragment at the beginning of the function helps me on my board:

      global $config;
      if( $user-> lang_name!= 'en' ) {  // 'en' because all mods at least come with english language
      	$sUserLang= $user-> lang_name;
      	$user-> lang_name= 'en';  // Force to look for english
      	$this-> add_mod_info( $module_class );  // Recursively find all english files first
      	$user-> lang_name= $sUserLang;  // Revert language chosen by user
      }
      

      This problem also exists in ACP, but that is out of interest by me.

        Attachments

          Activity

            People

            • Assignee:
              nickvergessen Joas Schilling
              Reporter:
              AmigoJack AmigoJack
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: