Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-9709

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

XMLWordPrintable

      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.

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

              Created:
              Updated:
              Resolved: