Localization/CN

* fix excess whitespaces betweeen number and unit
This commit is contained in:
Sarjuuk
2025-11-15 20:34:14 +01:00
parent 03bab92cb8
commit a2b87da285
7 changed files with 14 additions and 10 deletions

View File

@@ -141,6 +141,7 @@ class DateTime extends \DateTimeImmutable
public static function formatTimeElapsedFloat(int $delay) : string
{
$delay = abs($delay);
$nbsp = Lang::getLocale()->isLogographic() ? '' : self::NBSP;
for ($i = 0; $i < count(self::RANGE); ++$i)
{
@@ -148,10 +149,10 @@ class DateTime extends \DateTimeImmutable
continue;
$v = round($delay / self::RANGE[$i], 2);
return $v . self::NBSP . Lang::timeUnits($v === 1.0 ? 'sg' : 'pl', $i);
return $v . $nbsp . Lang::timeUnits($v === 1.0 ? 'sg' : 'pl', $i);
}
return '0' . self::NBSP . Lang::timeUnits('pl', 6); // 0 seconds
return '0' . $nbsp . Lang::timeUnits('pl', 6); // 0 seconds
}
/**
@@ -181,9 +182,10 @@ class DateTime extends \DateTimeImmutable
$i2 = $subunit[$i1];
$delay %= self::RANGE[$i1];
$v2 = floor($delay / self::RANGE[$i2]);
$nbsp = Lang::getLocale()->isLogographic() ? '' : self::NBSP;
if ($v2 > 0)
return self::OMG($v1, $i1, true) . self::NBSP . self::OMG($v2, $i2, true);
return self::OMG($v1, $i1, true) . $nbsp . self::OMG($v2, $i2, true);
}
return self::OMG($v1, $i1, false);
@@ -206,7 +208,9 @@ class DateTime extends \DateTimeImmutable
if ($abbrv && !Lang::timeUnits('ab', $unit))
$abbrv = false;
return $value .= self::NBSP . match(true)
$nbsp = Lang::getLocale()->isLogographic() ? '' : self::NBSP;
return $value .= $nbsp . match(true)
{
$abbrv => Lang::timeUnits('ab', $unit),
$value == 1 => Lang::timeUnits('sg', $unit),

View File

@@ -1653,7 +1653,7 @@ $lang = array(
'_range' => "Reichweite",
'_castTime' => "Zauberzeit",
'_cooldown' => "Abklingzeit",
'_distUnit' => "Meter",
'_distUnit' => " Meter",
'_forms' => "Gestalten",
'_aura' => "Aura",
'_effect' => "Effekt",

View File

@@ -1653,7 +1653,7 @@ $lang = array(
'_range' => "Range",
'_castTime' => "Cast time",
'_cooldown' => "Cooldown",
'_distUnit' => "yards",
'_distUnit' => " yards",
'_forms' => "Forms",
'_aura' => "Aura",
'_effect' => "Effect",

View File

@@ -1653,7 +1653,7 @@ $lang = array(
'_range' => "Rango",
'_castTime' => "Tiempo de lanzamiento",
'_cooldown' => "Reutilización",
'_distUnit' => "metros",
'_distUnit' => " metros",
'_forms' => "Formas",
'_aura' => "Aura",
'_effect' => "Efecto",

View File

@@ -1653,7 +1653,7 @@ $lang = array(
'_range' => "Portée",
'_castTime' => "Incantation",
'_cooldown' => "Recharge",
'_distUnit' => "mètres",
'_distUnit' => " mètres",
'_forms' => "Formes",
'_aura' => "Aura",
'_effect' => "Effet",

View File

@@ -1653,7 +1653,7 @@ $lang = array(
'_range' => "Радиус действия",
'_castTime' => "Применение",
'_cooldown' => "Восстановление",
'_distUnit' => "метров",
'_distUnit' => " метров",
'_forms' => "Форма",
'_aura' => "аура",
'_effect' => "Эффект",

View File

@@ -119,7 +119,7 @@ endif;
</tr>
<tr>
<th><?=Lang::spell('_range');?></th>
<td><?=$this->range.' '.Lang::spell('_distUnit').' <small>('.$this->rangeName.')</small>';?></td>
<td><?=$this->range.Lang::spell('_distUnit').' <small>('.$this->rangeName.')</small>';?></td>
</tr>
<tr>
<th><?=Lang::spell('_castTime');?></th>