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.
When having file in sites/default/files/translation/install.nl.po and installing in Dutch the following error comes
Notice: Use of undefined constant LOCALE_NOT_CUSTOMIZED - assumed 'LOCALE_NOT_CUSTOMIZED' in _locale_import_read_po() (line 98 of /Users/clemens/Sites/drupal/d8/www/core/includes/gettext.inc).
Do we have to include core/modules/locale/locale.module which defines it?
const LOCALE_NOT_CUSTOMIZED = 0;
This probably related to #1445004: Implement customized translation bit on translations
Comment | File | Size | Author |
---|---|---|---|
#2 | 1617598-2.patch | 758 bytes | Gábor Hojtsy |
Comments
Comment #1
Gábor HojtsyYes, looks like it (for now). As you know but others reading the issue might not, #1189184: OOP & PSR-0-ify gettext .po file parsing and generation is targeted to decouple locale from the gettext parser though, at which point this should not be an issue anymore. Currently they are hopelessly intertwined.
Comment #2
Gábor HojtsyI think this should do it. I'm not sure we should elaborate on the fact that a better solution is being worked on at #1189184: OOP & PSR-0-ify gettext .po file parsing and generation, just get this simple fix in if we need this bug fixed ASAP and get moving on #1189184: OOP & PSR-0-ify gettext .po file parsing and generation instead :)
Comment #3
clemens.tolboomHe ... this issue was intended for the sprint :p
The guy who solved it could then help me with #1189184: OOP & PSR-0-ify gettext .po file parsing and generation.
I wonder why #1445004: Implement customized translation bit on translations passed the testbot install process. Thus +needs tests.
Let's briefly talk (office hours) about this issue esp. tests as I need loads of info about install tests for #1189184: OOP & PSR-0-ify gettext .po file parsing and generation.
Comment #4
Gábor HojtsyI think #1189184: OOP & PSR-0-ify gettext .po file parsing and generation is complex enough on its own. The installer does not have tests to cover multilingual installation, and we are to work to change that process anyway. It would be good to focus on finally solving #1189184: OOP & PSR-0-ify gettext .po file parsing and generation instead of finding new ways to extend its scope. :/
Comment #5
Gábor HojtsyComment #6
Gábor Hojtsyre: Tests, I think the main complication we encountered before with this is that we'd need to set the .po file directory to some custom directory *before* invoking install.php for it to display/recognize a list of languages, at which point there is no DB available yet for the site being tested. The only place where install.php seems to be invoked from tests is core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php, which does not really test the installer, it tests the simpletest browser. So sounds like writing tests for this would require #630446: Allow SimpleTest to test the non-interactive installer being fixed first. I'm not sure we want to postpone our fix getting in sooner though.
Comment #7
Gábor HojtsyI think some manual testing of the patch would be useful and then we can get in the fix to advance work like #1189184: OOP & PSR-0-ify gettext .po file parsing and generation without waiting on changing the testing system.
Comment #8
rvilarThe patch in #2 works for me.
Comment #9
Gábor Hojtsy@rvilar: can you explain what did you do and what did you experience? Could you reproduce the error? Could you reproduce that it was fixed by this patch? A little bit more background on what you did would be useful.
Comment #10
rvilarFirst of all, I downloaded the Catalan translation for Drupal core and located to sites/default/files/translations/install.ca.po
When trying to install Drupal in another language different from English, Catalan for example, the following errors comes in every page in the installation process:
When applying the patch from #2, the message disappears and everything works fine.
Comment #11
Gábor HojtsyThanks, that looks good. Given that we cannot do automated tests for this, I think this should be good to go now.
Comment #12
webchickOk, this looks reasonable as a stop-gap fix.
Courtesy of the great #d8mi sprint in #drupaldevdays, committed and pushed to 8.x! This is my first 8.x-only patch. Gulp. :)
Comment #13
Gábor HojtsyDone, removing sprint tag. Thanks all!
Comment #15
Gábor HojtsyFix tag.