Postponed (maintainer needs more info)
Project:
Drupal core
Version:
main
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
8 Oct 2012 at 18:18 UTC
Updated:
21 May 2026 at 18:03 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jose reyero commentedIt seems the answer is in Drupal\Core\CoreBundle.php
Thus we'll need to create a LocaleBundle class, and register the storage like this:
This seems to work and be a clean usage of DIC. More feedback welcomed though.
Note: if you couldn't find any documentation either: Classes in mymodule/lib/Drupal/mymodule/MymoduleBundle are automatically loaded by Drupal core from DrupalKernel::registerBundles(). Note the capital 'M' in 'Mymodule'
Comment #2
jose reyero commentedThat approach above seems to work, but not for install/update, for which the storage seems not to be created, though locale_storage() is invoked causing a DIC exception. This may be related to #1807272: Mixed locale issues with upgrade scripts, unit tests, 'Table simpletest..locales_source doesn't exist', etc...
Comment #3
jose reyero commentedThis is the working patch atm for locale storage controller. This is quite some special case, as noted in the locale_storage() function's comments so we need to handle the case of no locale storage present in DIC too.
Comment #4
tstoecklerI don't think the second argument is necessary. If I wanted locale.storage to use a non-default database, I would do the following:
That way local.storage doesn't need to know about database targets.
Comment #5
tstoecklerRestoring tag. The previous was a x-post.
Comment #6
tstoecklerOh, I just saw, that DatabaseStringStorage already takes an $option parameter, so #4 is bogus. (Or if at all, a follow-up.)
Comment #8
jose reyero commentedWell, the patch fails but it actually fixes some issues. We get now real exceptions instead of "another exception thrown while handling one exception", which was happending before (because of #1808864: Exception handling is not 'locale safe' (thus not database safe))
This error is triggered by javascript file translation from the installer and would be in principle easy to fix, though this may not be the best solution:
I'll be exploring other options like initializing the storage on locale_language_init(). Though the indicated place to do it is LocaleBundle, this seems not to be installer/update safe, which is too bad :-(
Comment #9
jose reyero commentedAfter some more research, it seems the locale storage is not a good candidate for a clean initialization because of the reasons outlined here, https://drupal.org/node/1807272#comment-6595134
Comment #10
jair commentedNeeds reroll
Comment #11
alansaviolobo commentedComment #13
rpayanmrerolling...
Comment #16
chishah92 commentedComment #17
chishah92 commentedRerolled the patch.
Comment #19
chishah92 commentedComment #21
hitesh-jain commentedComment #22
yogeshmpawarI have rerolled the patch to work with 8.2.x branch.
Comment #24
hitesh-jain commentedComment #25
hitesh-jain commentedPatch rerolled against 8.3.x branch.
Comment #27
manuel garcia commentedComment #41
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #43
smustgrave commentedWanted to bump 1 more time, if no follow up could be closed in 3 months.