Wrong exported package hierarchy for Drupal 6

Damien Tournoud - June 7, 2009 - 16:01
Project:Localization server
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

The hierarchy exported by l10n_server for Drupal 6 packages is weird and wrong. For example, for CCK:

includes/translations/includes.fr.po
includes/panels/content_types/translations/includes-panels-content_types.fr.po
includes/views/handlers/translations/includes-views-handlers.fr.po
includes/views/translations/includes-views.fr.po
theme/translations/theme.fr.po
translations/root.fr.po
translations/general.fr.po
translations/installer.fr.po
modules/content_copy/translations/modules-content_copy.fr.po
modules/nodereference/translations/modules-nodereference.fr.po
modules/userreference/translations/modules-userreference.fr.po
modules/optionwidgets/translations/modules-optionwidgets.fr.po
modules/number/translations/modules-number.fr.po
modules/text/translations/modules-text.fr.po
modules/content_permissions/translations/modules-content_permissions.fr.po
modules/fieldgroup/translations/modules-fieldgroup.fr.po
modules/nodereference/panels/relationships/translations/modules-nodereference-panels-relationships.fr.po
modules/userreference/panels/relationships/translations/modules-userreference-panels-relationships.fr.po
modules/fieldgroup/panels/content_types/translations/modules-fieldgroup-panels-content_types.fr.po

There is no .module file under includes/ and theme/, nor under modules/*/panels/relationships/ or modules/*/panels/content_types/, so those translations will never ever be loaded by Drupal.

We need to collapse those translations to the nearest parent path that has a .module.

#1

Pasqualle - June 12, 2009 - 19:41

you should use the "All in one file" format when exporting a translation..
see:
#337287: Flat package for CVS commit
#325885: export per module

Drupal 6 package format works only for Drupal core, there is no 100% solution to make it usable for contrib modules, as there is no convention for sub module directory tree and module file names..

But sure it could be improved, although I would simply use one .po file for a contrib module as it works for every situation..

#2

Gábor Hojtsy - July 27, 2009 - 08:53

Agreed with Damien that we need to collapse.

#3

hass - August 10, 2009 - 17:49

Single file is the wrong way.

Every submodule need it's own single translation file, but I also think the others can become one file.

#4

Pasqualle - August 10, 2009 - 18:10

Every submodule need it's own single translation file

as we discussed it here #325885: export per module, it is not possible to identify files belonging to a submodule. Any file could be used by any module in the package, there is no rule..

#5

hass - August 10, 2009 - 19:48

A submodule is a module with an .info file in a subfolder of a main module. All files below this directory including the submodule main directory contains strings that need to go into the submodules translation file. This prevents imports of useless strings. It saves users of CCK from importing translatable strings they never use. Batch API was partly created only for importing the small vesus one monster PO files that may cause PHP to time out...

I was told by Gabor that the time-out issue is the reason why he never released a official/final version of http://drupal.org/project/autolocale

#6

Pasqualle - August 10, 2009 - 23:01

A submodule is a module with an .info file in a subfolder of a main module.

ok, so that means views_ui is not a submodule? No, it is not the only example which does not fit your definition..

#7

hass - August 11, 2009 - 06:15

It does not always fit this way, but often. Otherwise the views_ui.module and views_ui.info may be the files to scan for views_ui.pot. Additional check all files linked from the module. if not linked by a main module named like the main folder name "views" -> "views.module" or look for dependencies. If "views_ui" depend on "views" -> don't read files already linked by "views". Seems to becomes much easier in D7 as all files of a module need to be added to the .info file...

Are you asking for directory rules for modules?

Aside - views really have other more critical issues... for e.g. views are not translatable... :-(

#8

meba - August 18, 2009 - 12:50

OK, what about we first rename "Drupal 6 package format" to "Drupal 6 core package format"?

 
 

Drupal is a registered trademark of Dries Buytaert.