return static::$_allTranslations;
}
- public static function getCompiledTranslations()
+ public static function getCompiledTranslations($force = false)
{
- $raw = static::getAllTranslations();
+ $raw = static::getAllTranslations($force);
$res = [];
foreach ($raw as $code => $data) {
$res[$code] = [];
public function getDefaultTranslations($l10n = null)
{
$defaultLocale = $this->locale;
- if (null === $l10n) {
- $l10n = FluidbookTranslate::getCompiledTranslations();
+ if (null === $l10n || !isset($l10n[$defaultLocale])) {
+ $l10n = FluidbookTranslate::getCompiledTranslations(!isset($l10n[$defaultLocale]));
}
$res = $l10n[$defaultLocale];