From c4b1a5343974e3f2f990a662faf5a3efa58dff50 Mon Sep 17 00:00:00 2001 From: pezcurrel Date: Fri, 2 Dec 2022 16:29:24 +0100 Subject: [PATCH] Added German language (de) --- web/clitools/crawler.php | 3 ++- web/clitools/mustool.php | 4 ++-- web/site/index.php | 3 ++- web/site/stats.php | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/web/clitools/crawler.php b/web/clitools/crawler.php index 468a383..8b83547 100755 --- a/web/clitools/crawler.php +++ b/web/clitools/crawler.php @@ -532,6 +532,7 @@ function langs($instid, $uri, $auto) { if (mysqli_num_rows($res)<1) { $code=myesc($link,truncs($lang,'Languages','Code','«'.$instrow['URI'].'»')); $NameOrig=myesc($link,truncs(mb_ucfirst(locale_get_display_name($lang,$lang)),'Languages','NameOrig','«'.$instrow['URI'].'»')); + $NameDe=myesc($link,truncs(mb_ucfirst(locale_get_display_name($lang,'de')),'Languages','NameDE','«'.$instrow['URI'].'»')); $NameUk=myesc($link,truncs(mb_ucfirst(locale_get_display_name($lang,'uk')),'Languages','NameUK','«'.$instrow['URI'].'»')); $NameCa=myesc($link,truncs(mb_ucfirst(locale_get_display_name($lang,'ca')),'Languages','NameCA','«'.$instrow['URI'].'»')); $NameEn=myesc($link,truncs(mb_ucfirst(locale_get_display_name($lang,'en')),'Languages','NameEN','«'.$instrow['URI'].'»')); @@ -539,7 +540,7 @@ function langs($instid, $uri, $auto) { $NameFr=myesc($link,truncs(mb_ucfirst(locale_get_display_name($lang,'fr')),'Languages','NameFR','«'.$instrow['URI'].'»')); $NameGl=myesc($link,truncs(mb_ucfirst(locale_get_display_name($lang,'gl')),'Languages','NameGL','«'.$instrow['URI'].'»')); $NameIt=myesc($link,truncs(mb_ucfirst(locale_get_display_name($lang,'it')),'Languages','NameIT','«'.$instrow['URI'].'»')); - $q = 'INSERT INTO Languages (ID, Code, NameOrig, NameUK, NameCA, NameEN, NameES, NameFR, NameGL, NameIT) VALUES (NULL, \''.$code.'\', \''.$NameOrig.'\', \''.$NameUk.'\', \''.$NameCa.'\', \''.$NameEn.'\', \''.$NameEs.'\', \''.$NameFr.'\', \''.$NameGl.'\', \''.$NameIt.'\')'; + $q = 'INSERT INTO Languages (ID, Code, NameOrig, NameDE, NameUK, NameCA, NameEN, NameES, NameFR, NameGL, NameIT) VALUES (NULL, \''.$code.'\', \''.$NameOrig.'\', \''.$NameDe.'\', \''.$NameUk.'\', \''.$NameCa.'\', \''.$NameEn.'\', \''.$NameEs.'\', \''.$NameFr.'\', \''.$NameGl.'\', \''.$NameIt.'\')'; if (!$opts['dryrun']) { mysqli_query($link, $q) or mexit(__LINE__.': '.mysqli_error($link).N,3); $langid=mysqli_insert_id($link); diff --git a/web/clitools/mustool.php b/web/clitools/mustool.php index c7ef355..b7de73e 100755 --- a/web/clitools/mustool.php +++ b/web/clitools/mustool.php @@ -143,7 +143,7 @@ if ($opts['updstats']) { 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', 'ffffffffffffffffffffffffffffffff' ); - $langs=array('ca','en','es','fr','gl','it','uk'); + $langs=array('ca','de','en','es','fr','gl','it','uk'); $urls=array('home','instances','about','stats','contribute','404'); for ($i=0; $i<1460; $i++) mysqli_query($link,'INSERT INTO ZHits (UID,URL,Lang,TS) VALUES ("'.$uids[rand(0,count($uids)-1)].'","'.$urls[rand(0,count($urls)-1)].'","'.$langs[rand(0,count($langs)-1)].'",'.rand($now-365*24*60*60,$tdstart).')'); } @@ -163,7 +163,7 @@ if ($opts['updstats']) { $inserts++; $hits=0; // this line below must be synced with $supplangs in ../site/index.php - $hitslang=array('ca'=>0, 'en'=>0, 'es'=>0, 'fr'=>0, 'gl'=>0, 'it'=>0, 'uk'=>0); + $hitslang=array('ca'=>0, 'de'=>0, 'en'=>0, 'es'=>0, 'fr'=>0, 'gl'=>0, 'it'=>0, 'uk'=>0); // this line below must be synced with the urls we consider, see ../site/index.php $hitspage=array('home'=>0, 'instances'=>0, 'about'=>0, 'stats'=>0, 'contribute'=>0, '404'=>0); $visits=0; diff --git a/web/site/index.php b/web/site/index.php index 497889b..e4e7618 100644 --- a/web/site/index.php +++ b/web/site/index.php @@ -29,7 +29,7 @@ if (strlen($path)>0) { } } -$supplangs=['ca','en','es','fr','gl','it','uk'];// when adding a language code here, it is necessary to add it also to "$menu" in this same file, to "$hlmap" in stats.php, to "$hitslang" and "$langs" in ../clitools/mustool.php, to "langs" in ../clitools/updtrans.bash, to function "langs" in ../clitools/crawler.php; and to run "../clitools/addlang.php " locally and on the server +$supplangs=['ca','de','en','es','fr','gl','it','uk'];// when adding a language code here, it is necessary to add it also to "$menu" in this same file, to "$hlmap" in stats.php, to "$hitslang" and "$langs" in ../clitools/mustool.php, to "langs" in ../clitools/updtrans.bash (if missing), to function "langs" in ../clitools/crawler.php; and to run "../clitools/addlang.php " locally and on the server if (preg_match('#/('.implode('|',$supplangs).')$#',$path,$lang)===1) { $dlang=$lang[1]; $path=substr($path,0,-3); @@ -60,6 +60,7 @@ $menu=array( ), 'language'=>array('liadd'=>null, 'href'=>null, 'title'=>_('Language'), 'selected'=>false, 'submenu'=>array( 'ca'=>array('liadd'=>null, 'href'=>null, 'title'=>'Català', 'selected'=>false, 'submenu'=>null), + 'de'=>array('liadd'=>null, 'href'=>null, 'title'=>'Deutsch', 'selected'=>false, 'submenu'=>null), 'en'=>array('liadd'=>null, 'href'=>null, 'title'=>'English', 'selected'=>false, 'submenu'=>null), /* 'aa'=>array('liadd'=>null, 'href'=>null, 'title'=>'Prova', 'selected'=>false, 'submenu'=>array( 'bb'=>array('liadd'=>null, 'href'=>$conf['instpath'].'/stats/'.$dlang, 'title'=>'Statistics', 'selected'=>false, 'submenu'=>null), diff --git a/web/site/stats.php b/web/site/stats.php index 93af67f..401c1a7 100644 --- a/web/site/stats.php +++ b/web/site/stats.php @@ -33,6 +33,7 @@ $limit=$tdstart-(30*24*60*60); $res=mysqli_query($link,'SELECT * FROM ZStats WHERE TS >= '.$limit.' ORDER BY TS DESC') or muorimeglio(__LINE__.': '.mysqli_error($link),true); $hlmap=array( 'ca'=>_('Catalan'), + 'de'=>_('German'), 'en'=>_('English'), 'es'=>_('Spanish'), 'fr'=>_('French'),