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.
Comment | File | Size | Author |
---|---|---|---|
#42 | drupal-1998088-42.patch | 6.47 KB | ParisLiakos |
#42 | interdiff.txt | 1.43 KB | ParisLiakos |
#40 | drupal-1998088-40.patch | 6.46 KB | ParisLiakos |
#38 | drupal-1998088-19.patch | 6.47 KB | catch |
#34 | 32-34-interdiff.txt | 1.31 KB | alexpott |
Comments
Comment #1
dawehnerAdding tags
Comment #2
ebrowet CreditAttribution: ebrowet commentedhello,
i look at this ;)
i 've got correction, the time to test the patch and i post it ;)
i make correction on my patch (only space change option ) and it's goog ;)
Comment #3
ParisLiakos CreditAttribution: ParisLiakos commented@ebrowet: still working on this?
Comment #4
ebrowet CreditAttribution: ebrowet commentedyes i still work on this ;).
comming soon
Comment #5
ebrowet CreditAttribution: ebrowet commentedHello,
I create the patch, i hope is good for you. If not tell me i recreate it ;)
Have a nice day
Eric
Comment #6
ParisLiakos CreditAttribution: ParisLiakos commentedGreat! thanks looks good:)
Some points:
we can delete that:)
this has two extra spaces in front
Also, we should provide an upgrade path using update_variable_to_config inside a hook_update_N in locale.install
Comment #7
plopescHello
Patch in #5 doesn't apply now. Re-rolling
I think that is not necessary use update_variable_to_config, given that this variable doe not exist in D7.
Regards
Comment #8
ebrowet CreditAttribution: ebrowet commentedit was my issue, I did not have too much time these last time to fix my patch
too bad, it'll be for next time
sincerely,
Eric
Comment #9
ParisLiakos CreditAttribution: ParisLiakos commentedyeah i grepped 'locale_translate_english' in D7 and i didnt find anything..so update path is not needed. lets get this in.
thanks both @ebrowet and @plopesc
Comment #10
Dries CreditAttribution: Dries commentedShouldn't this use
Drupal::config()
instead ofconfig()
?Comment #11
ParisLiakos CreditAttribution: ParisLiakos commentedyeap, i missed that
injected it to
LocaleTranslation
as wellComment #13
ParisLiakos CreditAttribution: ParisLiakos commentedComment #15
ParisLiakos CreditAttribution: ParisLiakos commentedfacepalm?
Comment #17
ParisLiakos CreditAttribution: ParisLiakos commented#15: Convert_locale_translate_english_variabletoCMI-1998088-15.patch queued for re-testing.
Comment #18
jibran#15: Convert_locale_translate_english_variabletoCMI-1998088-15.patch queued for re-testing.
Comment #19
dawehnerI am sorry but this is not the right fix.
Comment #20
ParisLiakos CreditAttribution: ParisLiakos commentednice idea! definitely much bettter:)
shouldnt we remove the empty array() argument now from
$translation = new LocaleTranslation($this->storage, $this->cache, $this->lock, $this->getConfigFactoryStub(array()));
Comment #21
Jose Reyero CreditAttribution: Jose Reyero commentedSorry to show up a bit late here but I think what we'd need is the 'locale_translatable_language_list' in the configuration. And if that's ok, then 'locale_translate_english' would be just one one element of this array. My reasons:
- Other locale components do need that full list injected into DIC somehow. Right now the only way of having it without having a dependency on locale module fully loaded is duplicating the code. See the patch here #1966538: Translation is not updated for configuration, when the config changes
- Since we have that 'locale_translatable_language_list' the fact that LocaleTranslation or LocaleConfigSubscriber don't use that list is an API consistency issue.
So I think this issue would be a good chance to fix this variable in a really useful and more generic way. My intention is to post a patch in a few hours for this provided you guys agree. Otherwise I'll just keep off this one and work on other workarounds for the problem.
Comment #22
Jose Reyero CreditAttribution: Jose Reyero commentedAlternate patch is here, #2052233: Ensure list of translatable languages is available early in bootstrap
Comment #23
mtiftFixing tags.
Also, is there a good reason why you can't just post your patch from #2052233: Ensure list of translatable languages is available early in bootstrap here and close that issue? Having duplicate issues is confusing.
Comment #24
alexpottSo let's prepare the ground for #2052233: Ensure list of translatable languages is available early in bootstrap but do the minimum to get rid of the variable.
Also added missing upgrade path.
Comment #25
Gábor HojtsyUpgrade path looks good. The schema for the config is incorrect IMHO though. It is said to be a sequence however its a language code / boolean pair. The way the schema is expressed, this is not an associative list. Otherwise looks good to me.
Comment #26
Jose Reyero CreditAttribution: Jose Reyero commentedThe patch in #24 looks like a step ahead to me, just that schema thing @Gabor mentions.
Comment #27
alexpottHmmm... so the thing is if the enable_translation is meant to be become a list of languages then isn't that a sequence.
Here's an idea - how about we change this around and make it a list of languages that have translation disabled.
Comment #28
Tor Arne Thune CreditAttribution: Tor Arne Thune commentedJust so it's not overlooked before commit: Typo Langauge -> Language.
Comment #29
Gábor HojtsyI think it looks good outside of that typo :)
Comment #30
Gábor HojtsyFixed that typo only. I think this one is good to go and can be further refined in #2052233: Ensure list of translatable languages is available early in bootstrap.
Comment #32
alexpottInterest test fails due to assumptions made about locale config :)
Comment #34
alexpottWell that was very fun. The WebTestBase:setup() method was writing an incomplete version of locale.settings.yml to the active directory so that the translation.path can be overridden whilst testing.
Comment #35
Jose Reyero CreditAttribution: Jose Reyero commentedLooks good to me, but the language check in getStringTranslation() could be simplified. I mean instead of:
We could have:
But yes, anyway we get both features for the same price :-)
I mean, other (contrib) modules can just add languages to that list.
However, this may look a bit twisted, but for the follow up patch I'd rather convert the list to a list of 'translatable ones'. One of the points of the other patch is being able to easily pull the list of translatable languages from configuration, we need to iterate over them in a few places, and by having a 'non translatable' list, we need both the full language_list() and the 'non translatable ones' for that. And then we may need that logic duplicated in locale module and in the components that go into DIC for config translation/update if we don't want one depending on the other. The catch is at that point, if we do it in two steps instead of one, that will mean an API change, right?
Comment #36
Gábor HojtsyWell, in that case, we would be better off listing the translatable languages not the untranslated languages here :)
Comment #37
ianthomas_ukI might be totally missing something here, but the comments from #21 onwards seem to be addressing three separate issues.
a) Converting the locale_translating_english variable to CMI.
Drupal is shipped in English and the Locale module allows the user to translate it into their own language. "Translating" from English to English is a bit of a confusing concept, so that ability is hidden using this variable.
b) The ability to easily tell which languages are available for translating INTO, early in the bootstrap and whatever modules are enabled. This can already be calculated by calling language_list() and removing English if appropriate. For good data integrity you should avoid storing something if you can calculate it, so I don't think we should be creating new config for this, but we might want to move locale_translatable_language_list() from locale.module to language.module.
(I'm a bit confused about the dependencies here, it doesn't seem correct to be calling Drupal::config('locale.settings') when you can't call locale_translatable_language_list(), so the proposed variable wouldn't have removed the dependency).
c) The ability to turn translation off for additional languages. Hopefully, once (a) and (b) were fixed there would be no more need to hard code 'en' into if statements, and this could be done entirely inside locale_translatable_language_list().
My suggestion is that this issue returns to the approach in #19 to fix (a). We then address (b) in #2052233: Ensure list of translatable languages is available early in bootstrap and (c) in a further followup if there is a use case for disabling other translations.
Comment #38
catchYeah I agree with #37. If the only thing that's ever going to be configured is whether English is translatable or not, that should be the only thing in the configuration.
Bumping this to critical since it's one of the very last conversions at the moment And re-uploading #19 for the bot.
Comment #40
ParisLiakos CreditAttribution: ParisLiakos commentedlets reroll
Comment #41
dawehnerthis is a boolean variable so the default value should be false instead.
We do add slashes also to Drupal in procedural code.
Comment #42
ParisLiakos CreditAttribution: ParisLiakos commentedyou are right
Comment #43
dawehnerThank you!
Comment #44
catchCommitted/pushed to 8.x, thanks!
Comment #45
Gábor HojtsyD8MI tags.
Comment #46
Gábor Hojtsy#2052233: Ensure list of translatable languages is available early in bootstrap explores the expansion of this variable (as it was for a while above) to have a full list of translatable things to avoid circular dependencies / allow for earlier caching, etc. See you there. :)