#1309742: Add inline comment clarifying use of language_list() in system_date_format_save() has background.

I'm also wondering why we used enabled (0/1) instead of status for languages, status is what we use for modules, users and maybe we could standardize on that.

Comments

catch’s picture

Component: documentation » locale.module
Issue tags: +D8MI
catch’s picture

In this case it's not reall 'in' language_list(), it's more where the return value of language_list('enabled') is used. Which makes me wonder about possibly refactoring this some more.

gábor hojtsy’s picture

I think it makes a lot of sense to standardise on this if we keep status/enabled a one bit field. However, in light of #1314250: Allow filtering/configuration of which languages apply to what (UI, nodes, files, etc) I'm not sure where to go. We are not sure how to make the UI work for that neither the backend (yet?)...

xjm’s picture

Well, in the meanwhile, do we just want to add the constants?

gábor hojtsy’s picture

@xjm: well, we are working in #1387608: Unify language_list() and locale_language_list() to remove the property argument from language_list() among other things, so the original motivation from #1309742: Add inline comment clarifying use of language_list() in system_date_format_save() should be obsolete. Now all is left are if ($language->enabled) type of code. Not sure this is easier to understand or if ($language->enabled == LANGUAGE_ENABLED)? Also, given the above suggestion I thought the result would actually be $language->status instead of $language->enabled, to rhyme with how we use status for nodes, comments, etc. Which would dictate different constant names as well, right?

It would probably help to outline the goals a bit better here.

gábor hojtsy’s picture

Issue tags: +language-base

Tagging for base language system.

gábor hojtsy’s picture

Status: Active » Closed (duplicate)