Translation problem with CDD

Status
Not open for further replies.

jfquestiaux

Well-Known Member
Thanks to the {lang} tag, you can easily have the options values available in the correct language in the databasejoin element.

Unfortunately, in CDD, the "Label" dropdown in the "data" tab connects to the LABEL of the joined element and not its value, therefore the {lang} trick does not work.
Using it produces a 500 error.
 
I made some pics so it's more clear:
  • pic1 shows the databasejoin options. They are the label of the column in the DB, so you can use {lang} to connect to the right one (pic2)
  • pic3 shows the CDD. They are the label of the element itself, so in this case using {lang} causes the server to crash
databasejoin.png2013-08-24 09.34.52.pngcdd.png
 
Ah, OK, now I understand.

Yeah, the id and label are 'listfields' type in the join element, and 'element' in the CDD.

Wouldn't be that hard to change, but I'd need to get an opinion from rob before I did it.

What is pic2 a pic of? I'm interested, as I've never used {lang}, and it's not entirely clear where you are applying that.

-- hugh
 
pic2 is the "or CONCAT label" box (just below the "label" dropdown).
The way to use it is to have as many colums as you have languages in the joined database, with names like "something_en", for English, "something_fr", for French... and access them in the "or CONCAT label" box with "something_{lang}".

It's a great feature, and actually I should thank Jaanus for having brought to my attention the existence of this {lang} placeholder.
Coupled with the new Fabrik ability to translate (almost) all the lebels, options, tips, validation messages,... you get a very powerful app to be use on multilanguage sites.
 
Its nothing to do with the xml elements, just that the parsemessageforplaceholder wasn't parsing {lang} for the cdd concat field. I've altered the main parseMessageForPlaceholder call so that it will always add in the lang property if not already present in the replace data.
 
OK, it's working now.
Be aware however than now {lang} returns the language tag, which is usually like "en-GB", but MySQL does not accept the "-" in their column name, so you have to use "en_GB" in your element name: for instance "country_en_GB". You would then put "country_{lang} in the "concat label" box for the databasejoin.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top