Hi everybody,
I have a dropdown field with values dinamically taken form a DB Table, used to present to the user a list of all the countries in the world.
Since my site is multilingual (italian and english), I'd like to know if it's possible to choose to load the list of countries in italian or in english, depending on the language in use.
The table already has two different fields, containing the names in the two languages.
Thank you in advance for your help!
I have a dropdown field with values dinamically taken form a DB Table, used to present to the user a list of all the countries in the world.
Since my site is multilingual (italian and english), I'd like to know if it's possible to choose to load the list of countries in italian or in english, depending on the language in use.
The table already has two different fields, containing the names in the two languages.
Thank you in advance for your help!
Hi enriture,
If you load the table data using the ChronoForms DB Load action you can add PHP to the WHERE box to check the current language and select the values you need.
Bob
If you load the table data using the ChronoForms DB Load action you can add PHP to the WHERE box to check the current language and select the values you need.
Bob
Thank you GreyHead,
about the PHP in the WHERE box, can you please give me any other clue?
In a previous topic I found this
that should add the current language tag to the form data array, is it correct?
And what about the code to select the correct values depending on that tag?
about the PHP in the WHERE box, can you please give me any other clue?
In a previous topic I found this
<?php
$lang =& JFactory::getLanguage();
$form->data['lang_tag'] = $lang->getTag();
?>
that should add the current language tag to the form data array, is it correct?
And what about the code to select the correct values depending on that tag?
Hi enriture.
Assuming that you have used the language tags in your database table e.g. fr-FR, en-GB, etc. then your WHERE clause would be something like
Bob
I also have a paid Custom Select [GH] action that will handle this for you.
Assuming that you have used the language tags in your database table e.g. fr-FR, en-GB, etc. then your WHERE clause would be something like
`language` = '{lang_tag}'
Bob
I also have a paid Custom Select [GH] action that will handle this for you.
Hi GreyHead,
I'm back working on this project and in the meantime I've upgraded to Chronoforms 5. Does your action also work with this version of the component?
Thanks
I'm back working on this project and in the meantime I've upgraded to Chronoforms 5. Does your action also work with this version of the component?
Thanks
This topic is locked and no more replies can be posted.