mirror of
https://github.com/flarum/framework.git
synced 2024-12-05 09:03:36 +08:00
Temporary solution to resolve translation references
Just implemented this roughly so I can keep working :D /cc @franzliedke
This commit is contained in:
parent
5cce4b2be7
commit
840461499f
|
@ -34,6 +34,14 @@ class TranslationCompiler
|
|||
$translations = array_replace_recursive($translations, Yaml::parse(file_get_contents($filename)));
|
||||
}
|
||||
|
||||
// Temporary solution to resolve references.
|
||||
// TODO: Make it do more than one level deep, unit test.
|
||||
array_walk_recursive($translations, function (&$value, $key) use ($translations) {
|
||||
if (preg_match('/^=>\s*([a-z0-9_\.]+)$/i', $value, $matches)) {
|
||||
$value = array_get($translations, $matches[1]);
|
||||
}
|
||||
});
|
||||
|
||||
return $translations;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user