locale.inc expects filenames like de.po or some_characters_.de.po
see // $Id: locale.inc,v 1.174.2.13 2010/05/28 13:07:27 goba Exp $
line 2567
$files = array_merge($files, file_scan_directory(dirname($component->filename) .'/translations', '(^|\.)'. $langcode .'\.po$', array('.', '..', 'CVS'), 0, FALSE));
in the l10n_server
the filename is in this way defined for the manual export, that results in files like
twitter-6.x-3.0-beta2-de.po
this means there is a "-" prefix to the $language.po
some lines causing this (-not sure):
/l10n_server/l10n_community/export.inc lines: 267-277
Renaming the files is an extra effort and a source of errors.
So i ask for ideas how to fix this.
i found some lines in
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | dotextension.patch | 983 bytes | gábor hojtsy |
| #7 | 838994_laguage-prefix.patch | 1.19 KB | Thomas_Zahreddin |
Comments
Comment #1
eugenmayer commentedI think this is even to be marked as critical.
As currently the localization server is about to get spreaded and "accpeted" we must make the hurdles as small as possible. Non devs are expected to imported languages, so they might not be able to get a clue like Thomas explained here. So renaming is not a "extra effort", rather might be show-stopper.
I also think, thats pretty trivial :)
Comment #2
gábor hojtsyHm, the single file export surely names files with .$langcode.po (see http://ftp.drupal.org/files/translations/6.x/drupal/). Which mode does not?
Comment #3
eugenmayer commentedGabor looked into the code before, i think it was the "all in one file" one. All / are replace by -, so the last one.
Comment #4
Thomas_Zahreddin commentedits as Eugen supposed:
Most of the time i download files in the format / with these options:
- Include both English originals and translations
- All in one file
- Verbose files useful for desktop translation
these options result in filenames like twitter-6.x-3.0-beta2-de.po
means a - infront of de.po which fits not to the regex of local.inc.
I.m.h.o. filenames like twitter-6.x-3.0-beta2.de.po with a dot preceding de.po would be more suitable with other modules.
Comment #5
blackice2999 commentedHi,
some new infos about that ?
best regards
Dennis
Comment #6
Thomas_Zahreddin commentedhi,
i tried to fix this via another regex for po_re_importer. I got the regex to work, but found:
this approch fails with languages like gsw-berne or de-informal and so on.
There is no chance to decide for the regex or in the process of scaning the files what parts belong to the language, think of a file like acl-all-gsw-berne.po -> if the script takes the last - and .po as delimiters for the language, then the non existing language „berne“ is extracted from the filename.
The other approach to solve this from the script side is to extract the language-codes from ftp://ftp.osuosl.org/pub/drupal/files/translations/l10n_server.xml
and check the filenames against this list.
-> also possible, but much slower.
Any suggestions?
Comment #7
Thomas_Zahreddin commentedpatch against dev- Version
// $Id: export.inc,v 1.1.2.15.2.24.2.11 2010/06/24 09:21:57 goba Exp $
i changed '-' to '.'
hope i found the right place :-)
Comment #8
gábor hojtsyI'd only take the first change, since that fixes the all-in-one file exports. The tgz file exports contain files that are properly named themselves with this code when generating files for them:
The tgz would look odd with this name: drupal-all.de-translations.tgz instead of drupal-all-de-translations.tgz (as it is currently). The dot in the middle of the filename looks odd IMHO. So took the first change and committed, thanks.