Consider the possibility that “our languages” have been locked
This commit is contained in:
parent
0b15bcac6b
commit
db749d2e7d
1 changed files with 6 additions and 3 deletions
|
@ -643,17 +643,20 @@ if ($instanswered && isset($idata['languages']) && is_array($idata['languages'])
|
|||
}
|
||||
}
|
||||
// we try to detect languages only if it's set to the default "en", otherwise it has been explicitly set by admin and we assume it's the mostly used language
|
||||
if ($idata['languages'][0]=='en') {
|
||||
$dool=true;
|
||||
if (!is_null($oidata) && $oidata['OurLangsLock']==1) {
|
||||
$dool=false;
|
||||
} elseif ($idata['languages'][0]=='en') {
|
||||
$idata['ourlanguages']=get_instance_langs($opts['hostname']);
|
||||
while (count($idata['ourlanguages'])>5)
|
||||
array_pop($languages);
|
||||
foreach ($idata['ourlanguages'] as $key=>$lang)
|
||||
$idata['ourlanguages'][$key]=str_replace('-','_',$lang);
|
||||
eecho(1,'«'.$opts['hostname'].'»: detected languages: '.implode(', ',$idata['ourlanguages']).N);//+++
|
||||
eecho(1,'«'.$opts['hostname'].'»: detected languages: '.implode(', ',$idata['ourlanguages']).N);
|
||||
} else {
|
||||
$idata['ourlanguages']=$idata['languages'];
|
||||
}
|
||||
if (!$opts['dryrun']) {
|
||||
if ($dool && !$opts['dryrun']) {
|
||||
myq($link,'DELETE FROM InstOurLangs WHERE InstID='.$instid,__LINE__);
|
||||
$pos=0;
|
||||
foreach ($idata['ourlanguages'] as $lang) {
|
||||
|
|
Loading…
Reference in a new issue