I have this line code:
$('#ss_account_submit').val('Create Account!');
So the .val() has a text within it. I wonder dow do I get to translate with qTranslate (WordPress plugin) a text within .js code like the line above:
The qTranslate allow to use quick shortcodes or regular shortcodes such as:
[:pt] For Brazilian Portuguese Language
[:en] For English Language
<!--:pt--><!--:--> For Brazilian Portuguese Language
<!--:en--><!--:--> For English Language
I tried a lot of things with my low knowledge in PHP/JS that didn't work, such as:
$('#ss_account_submit').val('[:pt]Crie uma conta![:en]Create Account!');
$('#ss_account_submit').val('<--:pt-->Crie uma conta!<--:--><--:en-->Create Account!<--:pt-->');
$('#ss_account_submit').val __(('<--:pt-->Crie uma conta!<--:--><--:en-->Create Account!<--:pt-->'));
$('#ss_account_submit').val (<?php __('<--:pt-->Crie uma conta!<--:--><--:en-->Create Account!<--:pt-->') ?>);
Another way to make translation works is by using this kind of codes:
<?php echo __('<--:pt-->Crie uma conta!<--:--><--:en-->Create Account!<--:pt-->') ?>
OR
(__('[:pt]Crie uma conta![:en]Create Account!'))
Any idea what could work for this original line?
$('#ss_account_submit').val('Create Account!');
Your formatting looks a little off. Have you tried:
Note: that will not work inside a standard .js file.