Locale.admin.inc is over 2000 lines of code, with locale.inc topping up at yet another 2300. Locale.module is doing 4-5 different big things but these are too intermixed, and we should split their functionality and then clean them up individually. Naming conventions are way off, there are no clear standards, anything goes. Let's start this with setting up per-system include files.
One of the subsystems is the editing UI for translations. This consists of an overview screen for the status of translations and editing UI for all of them and a deletion screen for all of them. The code for this is all around locale.admin.inc and locale.inc. The locale.inc portion for example has the search screen and function as well as theming for the list of languages on edit screens, but not the main listing screen or the edit screens. Haha. These are also very highly intermixed with other functions, the JS regeneration code is grouped under the search code. It is just a big sorry mess. I hope we can clean this up gradually (and once again not aiming to clean everything up in one patch, that would be unreviewable).
The attached patch just moves the related functionality finally to its right place in one include file. The file is named as per @sun's preference as locale.pages.inc file. I don't necessarily think this is the best name we can get (I'd prefer locale.translate.inc), but understand that arbitrary "admin-like" functionality is not usually named with other names, and we don't have any good naming conventions to use.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | locale-translation-pages.patch | 37.47 KB | gábor hojtsy |
| locale-translation-pages.patch | 37.5 KB | gábor hojtsy |
Comments
Comment #1
gábor hojtsyWups, noticed outdated copy-pasted group header, fixed.
Comment #2
sunOriginal issue and discussion that attempted to move other administration functionality instead of the string translation functionality:
#1219196: Move negotiation settings out to their own include file
So this makes a lot more sense to me. Also yay! for removing totally needless clutter from includes/locale.inc ;)
The reasoning for locale.pages.inc in aforementioned discussion was that our current module-splitting standard foresees $module.admin.inc and $module.pages.inc only. And since the core UI for managing string translations is an extremely poor implementation of its own, which badly should be replaced with a more modern and usable UI like http://drupal.org/project/l10n_client - which does not live on an "admin/*" path per-se but rather on all pages - it makes sense to move this UI functionality into locale.pages.inc.
Comment #3
catchLovely patch.
Comment #4
gábor hojtsyTagging with framework. In line with "Move functionality that is in include files, but not required to run Drupal, into a module (or a stand-alone class)." on #1224666: [meta] Unofficial Drupal 8 Framework initiative.
Comment #5
xjmTagging issues not yet using summary template.
Comment #6
dries commentedCommitted to the 8.x branch. Thanks!
Comment #8
gábor hojtsyAdding UI language translation tag.