This is the final part of locale module cleaning out of things that are not related to interface translation. The date format translation storage and retrieval is mostly in system module, there are only a couple functions in locale module which is pretty very strange. The date format functions should be moved entirely to system module like we separated concerns before with moving node language to node, path language to path, etc. which in all cases handled it themselves already with minimal code from locale module. Same should apply here.
Comments
Comment #1
hairqles CreditAttribution: hairqles commentedComment #2
hairqles CreditAttribution: hairqles commentedThe following patch should solve this issue.
Comment #3
Gábor HojtsyI think this looks good. The schema is already in system module and although it is keyed by locale, etc. we will hopefully covert this to CMI later, so there is no point to touch any of the code outside of putting it at its true place :) Only one thing we should possibly discuss AFAIS. Otherwise looks good.
We need to figure out if we need to do this with a module exists or put the same thing in an access callback for the page.
Comment #5
Gábor HojtsyDoes not apply, should be rolled against latest Drupal 8!
Comment #6
hairqles CreditAttribution: hairqles commentedComment #7
Gábor HojtsyThe code basically renames and moves things around, and this code is going to be further cleaned up when being converted to CMI, so I don't think we should do any further cleanup here. This is purely about moving the functions/tests to their right place, where its schema and API is.
Needs work for the rename, needs review for the module_exists().
Should not be named "Locale..." if its not in locale. I'd name it DateFormatsLanguageTest
I'd value more feedback on what people think this is better vs. making an access callback which wraps the module_exists() instead. The menu cache is rebuilt when modules get enabled either way, the behavior is the same.
Comment #8
floretan CreditAttribution: floretan commentedSmall update: Rename the test and move it to core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php, next to the other Date Format test.
Also updated the form function names. By renaming 'locale_date_format_form' to 'system_date_format_form' we lose the fact that we're dealing with the date localization form and not the main date format form. Updated the name to 'system_date_format_localize_form'.
Comment #9
floretan CreditAttribution: floretan commentedRegarding the module_exists('language') issue, I find the current version better than creating a new access callback. The latter would be more verbose and would also be slightly less performant. As Gábor mentioned though, the functionality is not affected.
Comment #10
Gábor HojtsyLooks good, just one thing now :)
Comment in @file has wrong namespace name mentioned.
Comment #11
hairqles CreditAttribution: hairqles commentedFixed the @file namespace name.
Comment #12
Gábor HojtsyGet it tested.
Comment #14
Gábor HojtsyPatch is also 3k smaller than previous patches. Did you forget to add/remove a file?
Comment #15
webflo CreditAttribution: webflo commentedRerolled and fixed docs in DateFormatsLanguageTest.
Comment #16
Gábor HojtsyNow looks great, thanks. Does not miss the testfile anymore :)
Comment #17
webchickCommitted and pushed to 8.x. Thanks! :) Woohoo for cleaner code organization!
Comment #18
Gábor HojtsyThanks, moving off sprint.