Gtranslate requires the use of a deprecated code for hebrew. Other languages I tested use the new code - the patch allows for translation of Hebrew, and provides the structure to add additional langcode translations should these code change in the future.

CommentFileSizeAuthor
yh.patch1.13 KByhager

Comments

greg.harvey’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
Category: bug » feature
Status: Needs review » Needs work

Thanks for the patch. Nice idea to provide a translator function for the language codes, thus avoiding having to mess with the GTranslate ini file.

I'll commit a version of this, but only when there's an admin interface for people to set this up from. Don't want to end up having to handle loads of edge-case language codes, but the principle is great. Just want that code translation array to be editable in admin somehow. I'll take a look at doing it myself, unless someone beats me to it! There are a number of other features that will require an admin page anyway. =)

greg.harvey’s picture

Title: Handle languages with old ISO-631 codes (like Hebrew) » Provide interface for altering language codes before they are sent to GTranslate

Re-titling. There are a number of reasons you might want to do this - a mistake in the GTranslate ini file, an obsolete language code you need, etc. etc. It's a valuable feature.

yhager’s picture

Originally I thought there was a gap between latest ISO 631 and GTranslate, but when I went through the supported languages (at google's web site) - I saw that most of them, besides Hebrew are already using the new codes (and not many have changed anyway).

So if I were to decide about this, I would stick it as hard coded, and wait till someone really needs to mess with that (unless you know this is already the case). Actually I like a lot the fact there is no settings page for this module. It just works(tm). :)

greg.harvey’s picture

I think many of the Asian languages will have similar issues, from what we've seen thus far, and they'll probably crawl out of the woodwork over time. I'd rather not have to patch the module each time one materialises. That's what I'm thinking. If we provide a default set for the cases we know now, and an admin box, we can forget about it. Sure, there'll be an admin page, but even if you never know it exists the module will still just work. =)

deverman’s picture

Upon testing of the module we found that the drupal language codes to not match exactly with the google language codes so drupal simplified Chinese has to be mapped from "zh-hans" to google translate "zh-CN". We modified the module to test this by putting this code on line 50 in function i18n_auto_action_node_translate.

// remap language codes
if ($langcode == "zh-hans")
{
$langcode = "zh-CN";
}

By manually mapping we were able to successfully translate but upon creation of the new Chinese node, the English translation was missing the link to the Chinese node but the Chinese node seemed to have a link to the English translation. Hopefully the patch above does things the proper way.

greg.harvey’s picture

Status: Needs work » Closed (won't fix)

Sorry, this project is no longer supported - strongly advise you move to using https://drupal.org/project/tmgmt