-
- 24,544 Posts
Try this:
$aCategoryName = $modx->lexicon($aCategory);
In your foreach loop, I $aCategoryName will contain the category name.
The OnResourceTVFormRender event accepts a return value, which IIRC in your plugin would have to be set in $modx->event->_output rather than a return statement, but it's hard to see how it would work since it looks like the return value must be an array and is used to set Smarty placeholders.
-
- 20 Posts
Hi Bob,
Actually, the translation is ok and the values are correctly set in the $categories array as expected.
As the $categories was a pointer, I thought that updating the array would be enough to the core (manager/controllers/default/resource/resource.class.php) to go ahead with my new values...
Anyway, your answer sounds to say that there is no "standard" procedure to translate the category names in the manager :-s
-
- 24,544 Posts
There may be a "standard" procedure, but clearly I don't know what it is.
I have a feeling that there's a way to make the categories show up in the correct language using $modx->event->_output in the plugin, but it would take some serious trial-and-error work (for me anyway) to get it right.
It's also remotely possible that MODX would accept language tags ( [[%language_key]] ) as category names and translate them for you in the Manager using the current manager_language setting if you put the lexicon keys and values (in Manage -> Lexicons) in the core namespace under a topic that's loaded for the current manager page. I've never tried it.
-
- 20 Posts
I'll test&try these 2 leads... and will give you the feedbacks!
Thanks