Multilanguage value select attribute1 user found helpful
Can it be done by adding values to the translations files?
- if your select resides in a custom block : use t("your option") in the block and then extract strings from your block and translate them into your block LOCALES.
- in a form block (no coding involved), the option string actually resides in the database, so there is no way (currently) to have a multilanguage support here. The workaround is to have different pages serving different languages (use the Internationalization addon for this).
Guessing these values end up in the database?
From a users perspective not really the way to. Instead of selecting an attribute once, with 4 languages this needs to be done 4 times.
Would be great if you could enter values in multiple languages.
Same for setting up page types. The default values can only be in one language. Why not set a page type up for multiple languages. Would reduce the amount of page types a lot.
Ok for for easy simple sites it doesn't really matter but as soon you want more, the easy user-friendliness of concrete5 becomes quite the apposite.
But still, looking for a work around. :)
Load the values in a block and then translate them, would that work? (except for the nondynamic part)
I have page attributes and their respective option values that need to be translated - so e.g. - I have a select attribute called 'colour', with options: blue, green, red, etc.
it seems that I needed just to re-index the site in order for the 'Translate special items' page to appear in the dashboard. Strange, but when I first installed the package, and went to the localizer page, it would only show me the 'options' page. I re-indexed the site and the 'Translate special items' page is now there too.
As an example - I have a page select attribute called 'colour', with option values of Blue, green and Red. Each page of a particular page type will have 1 of these attribute options selected. I need to show the selected translated option on the site - so in the page template file I am using the following code:
echo $c->getCollectionAttributeValue(tc('SelectAttributeValue', 'colour'));
Which outputs the default value, but it's not translated, it just shows it's default 'en_GB' value.
NB - I have tried the method outlined here (ie retrieving the locale of the current page):
- and it doesn't seem to make any difference
Can anyone help me out on the correct syntax to use please?
echo tc('SelectAttributeValue', $c->getCollectionAttributeValue());
Thank you Remo, that's very much appreciated.