I'm currently working on a complete Danish translation of Drupal.

When I import the .po files with my translations I sometimes get duplicate strings in the database. The translation is imported but the original English text is still displayed on the site. This only seems to happen with long strings like help texts.

After the import the string "<p>Thousands of sites (particularly news sites and weblogs)..." is displayed twice on the "manage strings" page. See the following SQL query for locations (newlines have been removed from output to make it more legible):

mysql> SELECT lid, location, source FROM locales_source WHERE source like '%Thousands of sites%';
| lid | location                         | source                        |
| 210 |  modules/aggregator.module:65    | Thousands of sites (particula |
| 783 | /drupal/?q=admin/help/aggregator | <p>Thousands of sites (partic |
| 782 |  modules/aggregator.module:15    | <p>Thousands of sites (partic |
3 rows in set (0.01 sec)

I've tested this with a standard install of 4.5.1 and my translation of the aggregator module. I use poEdit on Windows to edit the .po files.

Any suggestions on what I can do to make this work correctly?


Gábor Hojtsy’s picture

Look closely, and you will surely see that these are two (slightly) different strings. You are translating a pot file which was generated for 4.5.0, or you have upgraded your 4.5.0 site to 4.5.1, and the old string is also in the DB.

wulff’s picture

I should have looked closer at the SQL dump before I posted.

The Drupal version of the string contained \r\n line endings while the imported string contained \n endings. Converting all the Drupal files to Unix format seems to solve the problem (it appears WinZip's default is to convert LF to CR/LF when handling .tar archives).

I'll get back to my translating ;-)