modxcms/revolution — pull request #11394 by exside (2014-05-22 01:21:47+00:00)
Title: First attempt to make multilanguage TVs (in Backend) possible

This was inspired by the forum threads here:

http://forums.modx.com/thread/90958/lexicon-setting-of-the-template-variables-transport-package#dis-post-498390

and subsequently here:

http://forums.modx.com/thread/31482/multi-language-tv

This could come in handy in some scenarios (especially with the envato marketplace available now...so authors could submit multilanguage themes, but in a multilanguage manager...!)

I took @MarkH s idea of making it work like it does for action lexicon entries, e.g. namespace.lexiconkey, so if you do something like that in a TV setup:

![bildschirmfoto 2014-05-22 um 03 08 55](https://cloud.githubusercontent.com/assets/445501/3048772/997b2786-e14e-11e3-96de-b61fe2f406d0.png)

and add the appropriate lexicon files under core/components/namespace/lexicons/CULTUREKEY/default.inc.php + a namespace with core path value of {core_path}components/namespace/ in the manager...

an example lexicon file default.inc.php (english) for the image above could look like:

```
/**
* Custom English language file for manager TVs
*/

$_lang['tv.tvname'] = 'TV Name';
$_lang['tv.tvname.desc'] = 'That\'s a TV description';
```

I'm not sure about the performance hit of something like this (as the $modx->lexicon->load() method doesn't return something I could check in an if statement...which then unavoidably triggers a debug message in the if check on $modx->lexicon()...but yeah, if you set log_level_debug you get many of exactly these messages anyway...see this as an idea, improvements and discussions are very welcome!