Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
i have upgraded my theme to D6 and activated the theme having language files in the folder sites\all\themes\mytheme\translations
. After pressing "Save configuration" i get tons of the following errors.
Only one example:
user warning: Data too long for column 'language' at row 1 query: INSERT INTO locales_target (lid, language, translation, plid, plural) VALUES (313, 'all/themes/mytheme/translations/de', 'Zur Navigation springen', 0, 0) in C:\Inetpub\wwwroot\drupal6\includes\locale.inc on line 1285.
Comment | File | Size | Author |
---|---|---|---|
#4 | language_code.patch | 988 bytes | Gábor Hojtsy |
Comments
Comment #1
Gábor HojtsyThis looks like your PO file is broken. Can you post the first 30 lines of your de.po file for the theme here?
Comment #2
hass CreditAttribution: hass commentedI think the bug is caused by
all/themes/mytheme/translations/de
... and this is not POT file related... The insert is trying to insert a path where it should only insert the language iso code...Nevertheless, the first 30 lines from the POT:
Comment #3
Gábor HojtsyAh, I see. This might have something to do with how the language code is computed there, which looks quite interesting.
Comment #4
Gábor HojtsyHm, this is the code which tried to find out the language code from the filename:
This matches file path endings like "/de.po" or "something.de.po". Seems like the ([^\.]+) part is a bit too greedy here, and it should also exclude slashes. Please try to use the
'!(/|\.)([^\./]+)\.po$!'
pattern (so we exclude / from the language code we match against), and report results.Comment #5
hass CreditAttribution: hass commentedThis patch works for me. All strings successfully imported without any errors :-).
Aside are you able to give me a hint, about the plan for the splitted files for complete translation, please? Is the final plan to create in every modules directory a sub directory "translations" and place the small appropriate files for every language there, or is there any global directory planed, where we drop all splitted files in? I don't like to put 15 files of 10 languages in the website root or the same directory :-(.
Comment #6
Gábor HojtsyThanks, patch committed.
The idea of course is that every module would have a translations subfolder with files *for that module* per language. This allows us to only load what's really required, and not load extra stuff, which would be unused and would slow down your site. Example tarball: http://drupal.org/node/176141 Now extractor.php / potx-cli.php generated files can be automatically packaged to this kind of tarballs with po-packager: http://cvs.drupal.org/viewvc.py/drupal/contributions/tricks/po-packager/ Although this is just a dirty trick for now, and there supposed to be a better solution for translators which will autogenerate tarballs in this format. See http://hojtsy.hu/drop/LocalizationServer.swf This is still in the works, but it accessible and possible to try out: http://drupal.org/project/l10n_server A copy of this will be hosted at drupal.org to provide a central collaboration interface for translations.
Comment #7
hass CreditAttribution: hass commentedCOOOOOOL. THX... the po-packager was the thing i'm searching and tried to build myself... i will give it a try.
Comment #8
(not verified) CreditAttribution: commented