Posted by Damien Tournoud on June 7, 2009 at 4:01pm
| Project: | Localization server |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
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.poThere 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.
Comments
#1
you should use the "All in one file" format when exporting a translation..
see:
#337287: Flat package for CVS commit
#325885: Identify submodules for filtering, export
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
Agreed with Damien that we need to collapse.
#3
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
as we discussed it here #325885: Identify submodules for filtering, export, 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
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
ok, so that means views_ui is not a submodule? No, it is not the only example which does not fit your definition..
#7
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
OK, what about we first rename "Drupal 6 package format" to "Drupal 6 core package format"?
#9
Committing this patch to rename the formats properly as discussed. We might still want to work on sensible contrib export formats without exporting a full .po file. Currently the full .po export (with the compact option) is used to generate downloads for core and contrib and we are working on a batch-able .po importer at #569004: Add support for seek based batch import of .po files which solves it for the long term, so we might end up skipping this for good.
#10
BTW I did not change status since I've committed the patch in #9 but do not consider this solved entirely.
#11
This cause critical core bug #853748: Folders in includes/database that do not contain an (installable) driver are used anyway.
#12
We are going ahead with simple to track, simple to understand, no-need to extract, not mixing into your source tree, simple to import single .po files. Hosting .po files in version control is about to be phased out with the git migration, so not going to work on this.