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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | admin.inc_.diff | 626 bytes | tangent |
Comments
Comment #1
Sinan Erdem commentedsubscribe
Comment #2
tangent commentedPlease 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.
Comment #3
dimitriseng commentedHi, 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.
Comment #4
carvalhar commented#2 worked for me also.
Comment #5
castawaybcn commented#2 worked for me as well
Comment #6
pasqualleCan you explain what is the source of this problem?