Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Google translate supports now also Dutch - English and English - Dutch translations. How can I use this in this module? I can't find Dutch in the list box in admin section of this tool.
Best regards,
Sjaak Terwindt
Comment | File | Size | Author |
---|---|---|---|
#6 | babeltr.zip | 8.42 KB | xeladrane |
Comments
Comment #1
xeladrane CreditAttribution: xeladrane commentedYou can add other languages and the order they're displayed in the dropdown by updating the function in the bottom of the file "gtrans.module". I discovered this by updating "Deutsch" to be "German":
function gtrans_get_avail_langs(){
return array(
'ar'=>t('Arabic'),
'en'=>t('English'),
'fr'=>t('French'),
'de'=>t('German'),
'it'=>t('Italian'),
'es'=>t('Spanish'),
'pt'=>t('Portugese'),
'ja'=>t('Japanese'),
'zh-CN'=>t('Chinese'),
'ko'=>t('Korean'),
);
}
So you can add another item, i.e. something like
'nl'=>t('Dutch'),
Similarly you can update the language that appears by default for translation by updating this line in the same file and replacing 'fr' for French with say 'it' for Italian:
'#default_value' => ($_SESSION['hl']? $_SESSION['hl'] : 'fr'),
The bit I have a problem with is that it returns a blank page and does not translate, and the error message I get seems to imply that google translate is trying to translate the SRC for the images I have embedded in the content on the page, i.e.
Message: Attempt failed to translate page /blah/blah/files/images/image5.jpg to Italian:
Content I got was:
Severity: notice
Anyone that can help with this I'd appreciate it. I figured out it's working by opening a PHP socket connection to the google translate engine and then grabbing all the returned text content. However, it's clearly failed to get any content at all, which isn't surprising if it's trying to translate an image!
Comment #2
sjaakter CreditAttribution: sjaakter commentedHi,
Thanks. I too have the problem that the pages aren't returned translated. I'll try to find another module. It seems to me this module isn't maintained anymore.
Best regards,
Sjaak Terwindt.
Comment #3
xeladrane CreditAttribution: xeladrane commentedI think it's probably not something that Google are in support of, since it strips their branding.
You could try updating the line about the Google URL, as it appears google have moved their hosting, i.e. change:
to
Also you might try the patch suggested in http://drupal.org/node/146017, replace the line where it assigns $content to $content_array[1] with:
Hope this works for you. Agree there seems to be little or no active support on this module at the moment, but I can't find anything else quite like it. Also tried a port to Babelfish but it's more tightly controlled by the looks of things.
Comment #4
owahab CreditAttribution: owahab commentedComment #5
owahab CreditAttribution: owahab commentedI have added new languages (Greek, Dutch, Traditional Chinese, etc) to the upcoming 1.5 version.
Will be released very soon.
Comment #6
xeladrane CreditAttribution: xeladrane commentedSounds great, I was wanting Dutch as well.
Did you find the issue with JSTools I think it is, where it introduces extra "\r\n" items within the genuine page content, and hence the content_array[1] item does not contain the full page?
Also, I found that having images in the page generates additional GET requests from the web browser, which naturally enough Google cannot translate, so there appear irrelevant lines in the watchdog and unecessary delays in loading the page.
Let me know if you'd rather these were logged as separate issues on here, or if I can do anything useful to help. I'm new to PHP I'm afraid but it makes sense just reading it through if I don't need to change much.
PS. Did you consider writing a Babelfish version, it looks like it might work and you won't need to undo edited links etc. I had a go (as attached) but it fails to run just now so I've made a PHP syntax error somewhere and my Ultraedit isn't configured to help me debug.
Comment #7
owahab CreditAttribution: owahab commentedFirst, I didn't have time for testing JSTools actually. I am planning to re-write this module for D6.
Second: I didn't have this issue before sine images aren't actually sent to Google in my test cases.
Third: Yes, please report any bug you see, to have more users contributions like confirming it or adding more details.
Fourth: I do not really have that much time to do a bablefish version. If you can provide a patch to this module that would be great, sending a zip file doesn't help really.
Comment #8
xeladrane CreditAttribution: xeladrane commentedThanks for your reply. I'll look out for v1.5 and then test it with and without the Javascript Tools module. I expect the images issue will go away by itself. Have given up on the Babelfish idea, it gets stuck in a refresh loop and forces the upper frame to exist as far as I can tell.
Comment #9
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #10
v8powerage CreditAttribution: v8powerage commentedHi
Last times Google added a lot new languages, could somebody update this module, please?
Comment #11
edo888 CreditAttribution: edo888 commentedTry the last version for Drupal 6.x