Please have a look to bug http://drupal.org/node/130538 and think about - if there should be done something in autolocale module or not!?

Comments

hass’s picture

Additional check out http://drupal.org/node/130691

gábor hojtsy’s picture

Status: Active » Fixed

So to summarize, the problem is that improper contrib translations could mess up your existing translations. This is easily fixed by not using the overwrite method for imports, but opting for the 'keep' method. As far as I see, there should be no general problem by using that method, so I modified the code to use 'keep'.

hass’s picture

Version: » 5.x-1.x-dev
Status: Fixed » Active

But if you simply say "keep" it is possibly that a module translation is imported first and then we say "keep" if the core translation is imported... this will result the same problems...

We should use a filter like looking FIRST for "drupal*.[$locale].po" to install the core files located in the autolocale po directory (should be with 'overwrite') and everything else like modules and themes with 'keep', but only AFTER core translation has been imported. Isn't it?

gábor hojtsy’s picture

We don't know what is a core module, unless we add a definitive list of core modules into autolocale. Modules can be placed anywhere, intermixed with core modules.

hass’s picture

we don't need to know about core modules or not. core module translations are inside the core PO files named like "de.po"... we only need to do establish an file naming convention for "autolocale". for e.g. we say:

1. if you'd like to import core files with "autolocale" it should be named "drupal*.[$locale].po" (for e.g. drupal-5.x-1.x-dev.de.po, drupal-5.x-1.x-dev-installer.de.po or drupal-5.x-1.x-dev-1.ru.po, drupal-5.x-1.x-dev-2.ru.po, drupal-5.x-1.x-dev-3.ru.po, drupal-5.x-1.x-dev-installer.ru.po). In this case "autolocale" will import this Core PO's first.

2. we look for modules and themes PO files and import them with 'keep' for not destroying the prior imported core files

gábor hojtsy’s picture

No, core translations are not in one file. Core translations can be in any number of files. You'd better read the reasons behind autolocale development the first place: http://drupal.hu/english/node/7 Look, a core translation could easily be 30-40 files. This functionality will be built into Drupal 6 core as it seems now, so we need to think in "core level solutions" as far as autolocale advancement goes.

How would you distinguish the core modules from the contrib modules in this case? Sure, we tell people not to unzip modules into the modules folder, but use the sites/all/modules or sites/$sitename/modules folders, but noone can stop people from putting modules directly into the modules folder.

hass’s picture

ok, i understand you are a step forward i don't know about. if you will not have one file for a core translation in future that will be difficult... i have no idea how to solve this without a positive list of core modules...

But however we try to turn it, 'keep' is no solution for the above problem... if the buggy "de.po" of CCK is imported first and then the drupal core files with 'keep' i have the same situation as i have with 'overwrite' mode. i only thought to use 'overwrite' for core to solve the order of imports... and solving the problem that modules overwrite the core translation, today.

gábor hojtsy’s picture

Status: Active » Fixed

Well, autolocale imports component (module, theme) PO files in the order of appearance in the system table (in the order of a SELECT SQL query returning them). MySQL at least returns the rows in insert order, so core modules inserted before contrib modules will have their translations imported first. We cannot do anything about core translations imported later then contrib modules (ie. core modules enabled a few days or weeks later), but at that time, you already should be familiar with translations in your database, so you would get surprised if a core translation modifies existing strings.

That said, using 'keep' is also better to keep user modified translations, altered using the web interface (which we also could not distinguish from imported translations). My 'overwrite' default behavior was a deliberate attempt to push a solely PO file based translation approach, but that does not fit Drupal core either, so it was time to modify it to 'keep'.

Anonymous’s picture

Status: Fixed » Closed (fixed)
hass’s picture

Title: overwrite mode destroyes core import » core import first > then contrib
Category: bug » support
Priority: Critical » Normal
Status: Closed (fixed) » Active

Have you already taken this sort order in account for D6 so that core will be imported first?

gábor hojtsy’s picture

The localization server in development (which will provide a web interface for translations) will enforce translation sharing between core and contrib, so contrib translations will not be able to mess up your existing strings at all, even when imported with overwrite mode.

hass’s picture

Is this a Drupal module? Anything to see or only on your box? :-)

hass’s picture

Status: Active » Closed (won't fix)