Page MenuHomePhabricator

Don't enforce alphabetical order of keys in i18n JSON files
Closed, ResolvedPublic

Description

Some extensions enforce alphabetical order of keys in i18n JSON files. This is unnecessary and harmful. The order of keys is supposed to be convenient for translators: keys should be sequenced by the topic of their content and not by arbitrary alphabetical order.

I found this in DiscussionTools, SimilarEditors, and VisualEditor, although perhaps it appears in more places.

Event Timeline

Change 822617 had a related patch set uploaded (by Amire80; author: Amire80):

[mediawiki/extensions/DiscussionTools@master] Don't enforce alphabetical order in i18n files

https://gerrit.wikimedia.org/r/822617

Change 822618 had a related patch set uploaded (by Amire80; author: Amire80):

[mediawiki/extensions/SimilarEditors@master] Don't enforce alphabetical order in i18n files

https://gerrit.wikimedia.org/r/822618

My understanding is that the motivation here is that translatewiki shows messages in the order they're found in the JSON files, and thus we could better-sort the messages to produce a logical flow for translators. (The structure of the keys means they're already fairly topic-sorted, just not necessarily ordered usefully.)

Yes: translatewiki shows messages in the order they're found in the JSON files, and the keys should be sorted to produce a logical flow for translators.

It's easy and natural to just do it manually. Enforcing alphabetical order is arbitrary and not useful, and it's not done in most extensions.

We talked today and @matmarex @Esanders @DLynch all agreed that this seems fine, at least for the code we maintain. We didn't realize that Translatewiki displayed messages in this order and it seemed nice to ensure consistency between en and qqq.

If you submit patches for other repos, I'd be happy to merge them as well.

Change 822617 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Don't enforce alphabetical order in i18n files

https://gerrit.wikimedia.org/r/822617

Change 822618 merged by jenkins-bot:

[mediawiki/extensions/SimilarEditors@master] Don't enforce alphabetical order in i18n files

https://gerrit.wikimedia.org/r/822618

Change 826930 had a related patch set uploaded (by Amire80; author: Amire80):

[VisualEditor/VisualEditor@master] Don't enforce alphabetical order in i18n files

https://gerrit.wikimedia.org/r/826930

Change 826930 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] Don't enforce alphabetical order in i18n files

https://gerrit.wikimedia.org/r/826930

Amire80 claimed this task.

As far as I can see, this is no longer done anywhere. Thanks for the reviews!

Change 828085 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (059f7d91d)

https://gerrit.wikimedia.org/r/828085

Change 828085 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (059f7d91d)

https://gerrit.wikimedia.org/r/828085