Hi! I have a YAML file with options to be used in a dropdown menu
workspaces.yaml
school: author.plugin::lang.workspace.school
home: author.plugin::lang.workspace.home
office: author.plugin::lang.workspace.office
In my lang file plugins/author/plugin/lang/en/lang.php I have:
return [
'workspace' => [
'school' => 'School',
'home' => 'In my home',
'office' => 'I prefer my office',
],
];
I use the ParseFile yaml function in order to get the content file
public function populate()
{
$parser = new Yaml;
$path = plugins_path() . '/author/plugin/additional/populate/workspaces.yaml';
$options = $parser->ParseFile($path);
return $options;
}
The next step is use the populate function in the onRun() function component in order to pass the options to the front end
public function onRun()
{
$this->page['workspaces'] = $this->myOwnClass->populate();
}
Everything in the process works great, except the translation. The string author.plugin::lang.workspace.school pass as it is to the front end, without be translated.
What is going on? :S