So empty strings in a .po file override already translated strings if I import them...
I know the current system of contrib translation is far from good and people are working on it (d6, SoC...). Anyways, here's my scenario:
I started translating some contrib modules I use (into German). Of course I want my work to be commited to the drupal CVS. I read the translations handbook and got used to some gettext tools, merging etc. What I did was extracting a fresh .pot file, merging it with the core de.po into the module's de.po and started translating the still empty strings. Sometimes it's too much work and it seems to be enough to only translate the strings that will be visible to the end-user leaving the rest of the strings empty. After importing and testing I filed issues in the respective projects attaching my de.po files.
Now I found out that empty translation strings will override already translated strings in the override mode of the import feature of drupal. As I merged the core .po file with my .pot this is only a problem if the string doesn't exist in core but does in another contrib module with an existing translation which is already imported. I cannot merge all module's translations with the one I'm about to create. So it may happen that I override an existing translation of a contrib module with an empty string of another's module's translation. To me it makes sense to keep empty string in my translation file as I or someone else will propably continue to work on that file. But as these empty strings are soon part of the official stable modules they can override other's translations too. Of course I could import them without overriding existing strings but sometimes I want to update my translation...
Is there any solution to this problem? A tool to delete the empty strings as a workaround? What kind of .po files should I commit in the future?
Sorry for the long text and repetitions...
Cheers, Standart
IMHO you should never import contrib translations in "override" mode. The autoimport feature built into Drupal 6 also always imports in "keep" mode, but it still does delete stuff in your database if you "override" it with an empty string. I am not sure overriding with an empty string is a good idea, and with Drupal 6, it also means deletion of the database entry.
Gabor
Martin Stadler wrote:
So empty strings in a .po file override already translated strings if I import them...
I know the current system of contrib translation is far from good and people are working on it (d6, SoC...). Anyways, here's my scenario:
I started translating some contrib modules I use (into German). Of course I want my work to be commited to the drupal CVS. I read the translations handbook and got used to some gettext tools, merging etc. What I did was extracting a fresh .pot file, merging it with the core de.po into the module's de.po and started translating the still empty strings. Sometimes it's too much work and it seems to be enough to only translate the strings that will be visible to the end-user leaving the rest of the strings empty. After importing and testing I filed issues in the respective projects attaching my de.po files.
Now I found out that empty translation strings will override already translated strings in the override mode of the import feature of drupal. As I merged the core .po file with my .pot this is only a problem if the string doesn't exist in core but does in another contrib module with an existing translation which is already imported. I cannot merge all module's translations with the one I'm about to create. So it may happen that I override an existing translation of a contrib module with an empty string of another's module's translation. To me it makes sense to keep empty string in my translation file as I or someone else will propably continue to work on that file. But as these empty strings are soon part of the official stable modules they can override other's translations too. Of course I could import them without overriding existing strings but sometimes I want to update my translation...
Is there any solution to this problem? A tool to delete the empty strings as a workaround? What kind of .po files should I commit in the future?
Sorry for the long text and repetitions...
Cheers, Standart _______________________________________________ translations mailing list translations@drupal.org http://lists.drupal.org/mailman/listinfo/translations
IMHO you should never import contrib translations in "override" mode.
I try to avoid it, too, but wouldn't that mean you can't update any contrib module's translation ever? That doesn't appear acceptable to me...
The autoimport feature built into Drupal 6 also always imports in "keep" mode, but it still does delete stuff in your database if you "override" it with an empty string. I am not sure overriding with an empty string is a good idea, and with Drupal 6, it also means deletion of the database entry.
Is there any reason why empty strings can override existing strings? I can imagine the rare case that I decide to not translate a certain string in a later version of my translation and want to update my old one. In this special case I could translate this string just with the English original to avoid conflicts. How can I maintain a translation file (.po)? There will be empty string until the translation is perfect which is not a usual case in an open source community. And still, I wanr people to be able to update the translation to the latest version without deleting other's translations.
Gabor
Martin Stadler wrote:
So empty strings in a .po file override already translated strings if I import them...
I know the current system of contrib translation is far from good and people are working on it (d6, SoC...). Anyways, here's my scenario:
I started translating some contrib modules I use (into German). Of course I want my work to be commited to the drupal CVS. I read the translations handbook and got used to some gettext tools, merging etc. What I did was extracting a fresh .pot file, merging it with the core de.po into the module's de.po and started translating the still empty strings. Sometimes it's too much work and it seems to be enough to only translate the strings that will be visible to the end-user leaving the rest of the strings empty. After importing and testing I filed issues in the respective projects attaching my de.po files.
Now I found out that empty translation strings will override already translated strings in the override mode of the import feature of drupal. As I merged the core .po file with my .pot this is only a problem if the string doesn't exist in core but does in another contrib module with an existing translation which is already imported. I cannot merge all module's translations with the one I'm about to create. So it may happen that I override an existing translation of a contrib module with an empty string of another's module's translation. To me it makes sense to keep empty string in my translation file as I or someone else will propably continue to work on that file. But as these empty strings are soon part of the official stable modules they can override other's translations too. Of course I could import them without overriding existing strings but sometimes I want to update my translation...
Is there any solution to this problem? A tool to delete the empty strings as a workaround? What kind of .po files should I commit in the future?
Sorry for the long text and repetitions...
Cheers, Standart
Martin Stadler wrote:
IMHO you should never import contrib translations in "override" mode.
I try to avoid it, too, but wouldn't that mean you can't update any contrib module's translation ever? That doesn't appear acceptable to me...
The autoimport feature built into Drupal 6 also always imports in "keep" mode, but it still does delete stuff in your database if you "override" it with an empty string. I am not sure overriding with an empty string is a good idea, and with Drupal 6, it also means deletion of the database entry.
Is there any reason why empty strings can override existing strings? I can imagine the rare case that I decide to not translate a certain string in a later version of my translation and want to update my old one. In this special case I could translate this string just with the English original to avoid conflicts. How can I maintain a translation file (.po)? There will be empty string until the translation is perfect which is not a usual case in an open source community. And still, I wanr people to be able to update the translation to the latest version without deleting other's translations.
Last time I checked Gerhard Killesreiter was strongly against removing this "feature" to delete stuff when you import empty translations for it. I am not sure this is a good "feature", so I'll try to hook up with him and discuss.
Gabor