mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-11-04 03:18:49 +03:00
Revamp language system for #82
This commit is contained in:
parent
fa4d2ae9e0
commit
fa371e25bf
68 changed files with 6705 additions and 9163 deletions
|
|
@ -133,52 +133,6 @@ class Utils
|
|||
return $sResult;
|
||||
}
|
||||
|
||||
public static function ReadAndAddLang(string $sFileName, array &$aResultLang) : void
|
||||
{
|
||||
if (\file_exists($sFileName))
|
||||
{
|
||||
if ('.yml' === \substr($sFileName, -4))
|
||||
{
|
||||
$aLang = \yaml_parse_file($sFileName);
|
||||
if (\is_array($aLang))
|
||||
{
|
||||
\reset($aLang);
|
||||
$sLangKey = \key($aLang);
|
||||
if (isset($aLang[$sLangKey]) && \is_array($aLang[$sLangKey]))
|
||||
{
|
||||
$aLang = $aLang[$sLangKey];
|
||||
}
|
||||
else
|
||||
{
|
||||
$aLang = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$aLang = static::CustomParseIniFile($sFileName, true);
|
||||
}
|
||||
|
||||
if (\is_array($aLang))
|
||||
{
|
||||
foreach ($aLang as $sKey => $mValue)
|
||||
{
|
||||
if (\is_array($mValue))
|
||||
{
|
||||
foreach ($mValue as $sSecKey => $mSecValue)
|
||||
{
|
||||
$aResultLang[$sKey.'/'.$sSecKey] = $mSecValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$aResultLang[$sKey] = $mValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function FolderFiles(string $sDir, string $sType = '') : array
|
||||
{
|
||||
$aResult = array();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue