Postponed
Project:
Drupal core
Version:
main
Component:
locale.module
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 Nov 2016 at 01:57 UTC
Updated:
15 May 2026 at 01:57 UTC
Jump to comment: Most recent
#3581303: Convert locale batch callbacks
See:
locale.module
Deprecate the constants and replace them according to the following table:
| Deprecated constant | Replaced by |
|---|---|
No public replacement |
|
| LOCALE_JS_STRING | moved as local variable to _locale_parse_js_file() |
| LOCALE_JS_OBJECT | moved as local variable to _locale_parse_js_file() |
| LOCALE_JS_OBJECT_CONTEXT | moved as local variable to _locale_parse_js_file() |
| LOCALE_NOT_CUSTOMIZED | FALSE |
| LOCALE_CUSTOMIZED | TRUE |
| LOCALE_TRANSLATION_OVERWRITE_ALL | moved as protected constant in LocaleSettingsForm |
| LOCALE_TRANSLATION_OVERWRITE_NON_CUSTOMIZED | moved as protected constant in LocaleSettingsForm |
| LOCALE_TRANSLATION_OVERWRITE_NONE | moved as protected constant in LocaleSettingsForm |
| LOCALE_TRANSLATION_STATUS_TTL | moved as protected constant in TranslationStatusForm |
Converted to enums |
|
| LOCALE_TRANSLATION_USE_SOURCE_LOCAL | \Drupal\locale\Model\UsedSourceType::Local |
| LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL | \Drupal\locale\Model\UsedSourceType::RemoteAndLocal |
| LOCALE_TRANSLATION_REMOTE | \Drupal\locale\Model\TranslationSource::Remote |
| LOCALE_TRANSLATION_LOCAL | \Drupal\locale\Model\TranslationSource::Local |
| LOCALE_TRANSLATION_CURRENT | \Drupal\locale\Model\TranslationSource::Current |
None.
None.
New enums, see above.
None.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mpdonadioComment #12
gábor hojtsyReparenting to #3215707: [META] Modernize Locale module where it has more likeliness to be fixed now. I think this may be resolved piece by piece as various include files and global functions that use the constants become services. So it may be that no direct work will be needed in this issue.
Comment #17
nicxvan commentedComment #18
claudiu.cristeaI think grouped constants should be moved to backed enums:
For instance LOCALE_TRANSLATION_USE_SOURCE_LOCAL and LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL:
Same for LOCALE_TRANSLATION_OVERWRITE_* and LOCALE_TRANSLATION_* and LOCALE_TRANSLATION_SOURCE_COMPARE_*
Comment #19
claudiu.cristeaLet's try...
Comment #20
claudiu.cristeaComment #21
claudiu.cristeaComment #23
claudiu.cristeaUpdate IS
Comment #24
claudiu.cristeaComment #25
claudiu.cristeaUpdate IS
Comment #26
claudiu.cristeaComment #27
claudiu.cristeaUpdated the CR
Comment #28
claudiu.cristeaComment #29
claudiu.cristeaComment #30
nicxvan commentedI'd propose that the constants in locale.translations.inc
Be addressed in: #3569328: Modernize locale.translations.inc
It keeps everything nicely self contained.
Comment #31
claudiu.cristeaDid some progress but I still need to reflect on BC. This issue is part of modernizing Locale meta, and I think we need some refactoring not only moving the code around.
Comment #32
claudiu.cristeaUpdating IS
Comment #33
claudiu.cristeaComment #36
claudiu.cristeaThis is ready for review
Comment #37
claudiu.cristeaComment #38
claudiu.cristeaComment #39
nicxvan commentedCouple of questions, I didn't finish my review.
Comment #40
nicxvan commentedPostponing on #3577671: Modernize locale file handling #3037031: Convert locale.compare.inc to a service and the batch conversion in .inc I haven't created yet.
I spoke briefly with @claudiu.cristeau about the overall order and he agreed this is ok.
Comment #41
nicxvan commentedComment #42
nicxvan commented#3581303: Convert locale batch callbacks
Comment #43
nicxvan commentedLooking at what remains, this is actually the easiest to do, we should probably do this last since it won't require any dependency injection changes.