With sublanguages (e.g. fr-be), the suggest link produce an error "invalid
translation language pair".
The following patch fix that -- not sure it's the best way, though.
--- rosetta.js 2011-08-16 10:56:38.000000000 +0200
+++ rosetta-patched.js 2011-08-22 17:34:14.000000000 +0200
@@ -13,7 +13,7 @@
trans=$('textarea',a.parent());
orig = unescape(orig).replace(/<br\s?\/?>/g,'\n').replace(/<code>/g,'').replace(/<\/code>/g,'').replace(/>/g,'>').replace(/</g,'<');
a.attr('class','suggesting').html('...');
- google.language.translate(orig, '{{MESSAGES_SOURCE_LANGUAGE_CODE}}',
'{{rosetta_i18n_lang_code}}', function(result) {
+ google.language.translate(orig, '{{MESSAGES_SOURCE_LANGUAGE_CODE}}',
'{{rosetta_i18n_lang_code|slice:":2"}}', function(result) {
if (!result.error) {
trans.val(unescape(result.translation).replace(/'/g,'\'').replace(/"/g,'"').replace(/%\s+(\([^\)]+\))\s*s/g,' %$1s '));
a.hide();
Original issue reported on code.google.com by ppolleunus on 22 Aug 2011 at 3:56
Original issue reported on code.google.com by
ppolleunus
on 22 Aug 2011 at 3:56