Every time i'm trying to update a PO file with a newly generated POT i get many duplicate message definition errors and the update fails.

I've tested this with OG 5.0, but have had this error on every other file, too. Attached you will find an update og.pot and the german po of OG. Simply open the de.po in poedit and "update from POT file"...

CommentFileSizeAuthor
#4 potx_D5_1x.patch802 byteshass
poedit_errors.png54.98 KBhass
de.po_.txt39.73 KBhass
og.pot_.txt34.03 KBhass

Comments

gábor hojtsy’s picture

Yes, there are strings marked with (duplicate) at the end of the .po file, if you check it out. These are the strings used in install time and runtime as well, so they are exported for both install time and runtime. Potx has this limitation that it exports one file for you, so it merges these together (although it should not). One option is to skip exporting strings which are installer only or are both in the installer and in the runtime, so you will not be able to use potx to create a complete translation.

You are a big advocate of exporting one file instead of smaller ones. Now this is a situation, where it fires back. (Anyway, installer translations for contrib modules are only ever used if the builder of an installer profile merges them to the profile translation, they are not searched for in install time even in Drupal 6; this could be a feature request against Drupal 7; not a potx issue :).

hass’s picture

This is not from translation server... i place the two files in the file system and call "php potx-cli.php" and one "general.pot" is generated from all files in this directory. After this the general.pot file should work without any errors.

gábor hojtsy’s picture

Who said it is from translation server? I said potx has this limitation when used on its own. You can use a multifile mode on the command line, just the one file mode is the default to make sense with the web interface, where that's the only mode.

hass’s picture

Version: 5.x-1.2 » 5.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new802 bytes

Here is a patch for the duplicate issue. The source was the "less then 10 strings in a file are merged into general.por" logic used in D5 and no more used in D6. I've added the installer.pot to the blacklist of files that are allowed to be merged and that's all. The patch should also apply to 5.x-2.x branch.

This bug does not exist in D6!

gábor hojtsy’s picture

Status: Needs review » Fixed

Committed to both 5.x branches, thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.