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.

Comments

gábor hojtsy’s picture

Status: Active » Needs review
StatusFileSize
new37.47 KB

Wups, noticed outdated copy-pasted group header, fixed.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Original 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.

catch’s picture

Lovely patch.

gábor hojtsy’s picture

Issue tags: +Framework Initiative

Tagging 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.

xjm’s picture

Tagging issues not yet using summary template.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to the 8.x branch. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

gábor hojtsy’s picture

Issue tags: +language-ui

Adding UI language translation tag.