echterhoff / plg-globalvariables

Joomla Plugin GlobalVariables (plg-globalvariables)
2 stars 2 forks source link

Multilanguage #1

Closed lucavee closed 9 years ago

lucavee commented 9 years ago

Hi, how do I define variable for multilanguage use, so that Joomla will select the right value for that variable according to language?

Example, I have a variable "name", for English pages it has to be set to "EN" and for Italian to "IT" and so on...

I tried to define

name.en_EN="EN" name.it_IT="IT" but it doesn't work.

Thank you.

echterhoff commented 9 years ago

Hi lucavee,

maybe you can give me more information about what "extension" you use for language/translation management. E.g. plain build-in Joomla logic or falang.

Maybe I can give you a hint on what is going on with the country codes: If you call a page with a given country code, eg. en-GB global variables queries the resource. Since the resource can be a plain txt file hosted somewhere, the plugin looks in first instance for a matching variable name with the country code extension. If there is no such key, it falls back to simple variable name.

If the resource is an article keep in mind, the article gets selected throught the language/translation system. There is no need to extend the variable names with country codes.

Whatever the case is, I am gonna dig a little into this, since it seems a bit weird and needs some more assisstance during the setup.

Let me know if I could help you Lars

echterhoff commented 9 years ago

@lucavee okay... digged into it and found several problems regarding the internal variable editor. Gonna fix it asap. Lars

echterhoff commented 9 years ago

@lucavee I simplified serveral things in the most recent version. Now the plugin looks up the definitions like: In case there is a variable named varname.en-gb return it otherwise -> Go on in case there is there a variable named varname.en return it otherwise -> Go on in case there is there a variable named varname return it otherwise -> Can't resolve!

If you use a plugin like falang this is only important if you use external sources. If you use falang, you should make sure you created a translated version of the article that is serving the variables.

Hope this solution works for you. I am looking forward to receive a short and honest review from you at: http://extensions.joomla.org/extensions/extension/edition/replace/global-variables

Regards Lars