install/includes/payload.php
changeset 832 7152ca0a0ce9
parent 819 7ef806a90d44
child 857 f3a5a276208c
equal deleted inserted replaced
831:45e887f23282 832:7152ca0a0ce9
   431  * UPGRADE STAGES
   431  * UPGRADE STAGES
   432  */
   432  */
   433 
   433 
   434 function stg_lang_import()
   434 function stg_lang_import()
   435 {
   435 {
   436   global $db, $languages;
   436   global $db, $languages, $do_langimport;
   437   
   437   
   438   define('IN_ENANO_UPGRADE_POST', 1);
   438   define('IN_ENANO_UPGRADE_POST', 1);
   439   
   439   
   440   //
   440   //
   441   // IMPORT NEW STRINGS
   441   // IMPORT NEW STRINGS
   458       foreach ( array('core', 'admin', 'user', 'tools') as $language_file )
   458       foreach ( array('core', 'admin', 'user', 'tools') as $language_file )
   459       {
   459       {
   460         // generate full path
   460         // generate full path
   461         $language_file = ENANO_ROOT . "/language/{$languages[$row['lang_code']]['dir']}/$language_file.json";
   461         $language_file = ENANO_ROOT . "/language/{$languages[$row['lang_code']]['dir']}/$language_file.json";
   462         // setting the second parameter to bool(true) causes it to skip existing strings
   462         // setting the second parameter to bool(true) causes it to skip existing strings
   463         if ( !$lang_local->import($language_file, true) )
   463         if ( !$lang_local->import($language_file, ( !$do_langimport )) )
   464           // on failure, report failure to libenanoinstall
   464           // on failure, report failure to libenanoinstall
   465           return false;
   465           return false;
   466       }
   466       }
   467       // unload this lang_local object to save memory
   467       // unload this lang_local object to save memory
   468       unset($lang_local);
   468       unset($lang_local);