Hi, I'm using the translation table to localize CCK labels and taxonomy terms.
It is a very useful module !
There is only an annoying issue when saving a page which contains already translated strings.

For example, I go a first time to the /admin/build/translate/table/cck page to translate certain labels: after populating all the fields, I press the Save button.
Then other CCK fields are created, so I have to return there to translate the new labels.
The already translated strings are populated, so it is very easy to individuate those new to localize.

Then I populate the empty fields and press the Save button but a message like the following pops up:

user warning: Duplicate entry 'en-9798-0' for key 'PRIMARY' query: INSERT INTO locales_target (lid, language, translation) VALUES (9798, 'en', 'Package quantity') in ...\sites\all\modules\translation_table\includes\admin.inc on line 95.

It's not a show stopper since the new translations are evenly saved, but it would be better to have a merge approach: insert the new strings or update those already there only if different.

CommentFileSizeAuthor
#2 admin.inc_.diff626 bytestangent

Comments

Sinan Erdem’s picture

subscribe

tangent’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new626 bytes

Please accept the attached patch which resolves this bug. Similar to the variable_set() function, the INSERT query must be prepended with @ due to platform variability.

dimitriseng’s picture

Hi, I have tested this patch on Drupal 6.22 + translation_table 6.x-1.4 and I can confirm that this removes the warnings and resolves the issue. Can this be committed? Thank you.

carvalhar’s picture

#2 worked for me also.

castawaybcn’s picture

#2 worked for me as well

pasqualle’s picture

due to platform variability

Can you explain what is the source of this problem?