Hi,
I am looking for a way to translate the fields of a form into another language. I imagine it like this: If "French" is selected in a dropdown, the labels are translated into French. If "English" is selected, the default text is displayed. In other words, the language of the logged in user should not be used. The user selects the language of the form. Can I use the inbuilt translation for this?
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Translation
Re: Translation
marc,
You can try this...
I find this page very helpful when using jQuery...
https://www.w3schools.com/jquery/jquery ... ectors.asp
Steven
You can try this...
Code: Select all
$("[id^='label_']").each(function( index ) {
var h = $(this).html();
var t = nuTranslate(h);
$(this).html(t);
});
https://www.w3schools.com/jquery/jquery ... ectors.asp
Steven
-
- Posts: 92
- Joined: Mon May 14, 2018 3:26 pm
Re: Translation
Steven, how can I set the language using your code?
I select French, from the dropdown, the GUI elements are translated to French. The same for English.
And as mentioned above, this should work no matter what language the user has set.
I select French, from the dropdown, the GUI elements are translated to French. The same for English.
And as mentioned above, this should work no matter what language the user has set.
You do not have the required permissions to view the files attached to this post.
Re: Translation
marc,
I didn't notice you say...
The best thing you can do is create an array of Label names and the text to go in them - for each language.
Steven
I didn't notice you say...
My way won't work for you.the language of the logged in user should not be used.
The best thing you can do is create an array of Label names and the text to go in them - for each language.
Steven