Hello,
In the contribs I just found a few xxx-module.hu po files. According to the handbook[1] they should have been named 'hu.po'. Did I miss a change in policy, and if so, can someone explain the new policy so that I can update the handbook page? If I did not miss omething, is it okay if I rename the files when I encounter them to the proper naming scheme?
Bèr
[1] http://drupal.org/node/11396
Bèr, you probably mean xxx-module.hu.po files. These are admittedly against the current guidelines (although I cannot access drupal.org to check now due to the scheduled downtime, which manifests itself in DB errors unfortunately).
A few points:
- the guideline is in place so people can identify files to import (by hand)
- autolocale module for Drupal 5.x can automatically import translation files in {langname}.po or something.{langname}.po name format.
- Drupal 6.x-dev automatically imports files in the same name format as autolocale (in Drupal install time, when you install modules enable themes and when you add a language)
The idea behind allowing some prefix before the language code and .po extension is that you can segment the translation job. Theoretically you could also match the translation files to modules, when having more modules in the same folder. Take views module for example. It has 4 modules in the same folder with one shared po subfolder. Now with the current guideline, you need to have only one {langname}.po file, so you need to merge the translations for all four modules into one big PO file and import them all at once. There is no way to optimize this by providing matching named PO files, so you can optimize DB usage by only loading translations for the modules you actually use.
Now unfortunately Drupal 6.x does not do module <-> po file matching for module suites, it blindly imports everything matching the above mentioned patterns when you enable a module, so it would import translations for all four modules in views for the given language in its current state. It would be nice to fix this up with an improved naming convention, maybe with the one we are already using in the Hungarian translation (the extractor script generates such filenames), and coding some logic into Drupal 6 so it can better identify relevant PO files for module suites.
Anyway, there is a problem with only allowing one file per language for a contrib module suite. It would not be a problem, if it would be a module, and not a suite of modules. As far as I remember, the PO naming guidelines date back to the day before these big module suites, where you are not necessarily interested in turning all the modules on. So I would say that the naming convention is ready for a change. (And an optimizing patch should hit Drupal 6 :)
(BTW smaller PO files also help Drupal 6 to build a batch and not time out while parsing a big PO file, although the existing monolithic PO files for views are small enough already for not timing out :).
Gabor
Bèr Kessels wrote:
In the contribs I just found a few xxx-module.hu po files. According to the handbook[1] they should have been named 'hu.po'. Did I miss a change in policy, and if so, can someone explain the new policy so that I can update the handbook page? If I did not miss omething, is it okay if I rename the files when I encounter them to the proper naming scheme?
Bèr
[1] http://drupal.org/node/11396
translations mailing list translations@drupal.org http://lists.drupal.org/mailman/listinfo/translations
Op woensdag 23 mei 2007, schreef Gabor Hojtsy:
Bèr, you probably mean xxx-module.hu.po files.
Yes
Anyway, there is a problem with only allowing one file per language for a contrib module suite. It would not be a problem, if it would be a module, and not a suite of modules. As far as I remember, the PO naming guidelines date back to the day before these big module suites, where you are not necessarily interested in turning all the modules on.
Makes sense. How about turning this {$modulename}-{$extension}.{$lang_code}.po into the new, official guideline? That way we have consisten naming.
Bèr
Bèr Kessels wrote:
Op woensdag 23 mei 2007, schreef Gabor Hojtsy:
Bèr, you probably mean xxx-module.hu.po files.
Yes
Anyway, there is a problem with only allowing one file per language for a contrib module suite. It would not be a problem, if it would be a module, and not a suite of modules. As far as I remember, the PO naming guidelines date back to the day before these big module suites, where you are not necessarily interested in turning all the modules on.
Makes sense. How about turning this {$modulename}-{$extension}.{$lang_code}.po into the new, official guideline? That way we have consisten naming.
I am fine with it, but I would not like to see "blind following" of that rule either. It would not be a good idea to have all the {$langcode}.po files suddenly removed and re-added with new names.
Gabor
On May 28, 2007, at 10:47 AM, Bèr Kessels wrote:
How about turning this {$modulename}-{$extension}.{$lang_code}.po into the new, official guideline?
i can't speak to all the details, but pretty please, remember that the goal (my goal at least, and gabor is supposedly doing and SoC project this summer to accomplish it, so i presume it's his goal, too) ;) is to move all translations of contribs out of the "parent" contrib module and into their own projects:
i don't know if it makes sense to have {$modulename}- at the front of the filenames if we're already going to have them segregated by both module and language. perhaps it's still useful, in terms of projects that have lots of modules within them. but, just wanted to remind everyone this is the direction we are (or at least, should be) moving in.
thanks, -derek
On Tue, 29 May 2007, Derek Wright wrote:
On May 28, 2007, at 10:47 AM, B�r Kessels wrote:
How about turning this {$modulename}-{$extension}.{$lang_code}.po into the new, official guideline?
i can't speak to all the details, but pretty please, remember that the goal (my goal at least, and gabor is supposedly doing and SoC project this summer to accomplish it, so i presume it's his goal, too) ;) is to move all translations of contribs out of the "parent" contrib module and into their own projects:
i don't know if it makes sense to have {$modulename}- at the front of the filenames if we're already going to have them segregated by both module and language. perhaps it's still useful, in terms of projects that have lots of modules within them. but, just wanted to remind everyone this is the direction we are (or at least, should be) moving in.
Yes, the modulename still makes sense there if you have more modules. I tried to point out before that blindly following rules here is not a really good POW IMHO. Maybe we can formulate better rules for different situations, but I would like to point out that Drupal 6 supports any kind of filename which ends in {{$something}.]{$langcode}.po, $something and the dot being optional, and $something being possibly anything. That is the hard rule to follow for PO files.
Gabor