Skip to content

add option to sorting message by a locale's order#703

Merged
terales merged 2 commits into
lokalise:mainfrom
dantman:locale-sort
Aug 27, 2023
Merged

add option to sorting message by a locale's order#703
terales merged 2 commits into
lokalise:mainfrom
dantman:locale-sort

Conversation

@dantman
Copy link
Copy Markdown
Contributor

@dantman dantman commented Dec 8, 2021

i18n Ally uses a binary sort when it sorts keys. This is unexpected ("O" is sorted before "o") and doesn't take differences in how languages sort things into account.

This change adds two config settings sortCompare and sortLocale.

  • By default sortCompare is binary which is the current behaviour
  • You can set sortCompare to locale and set sortLocale to en and keys will be ordered according to English rules for sorting text.
  • Alternatively you can set sortCompare to locale and leave sortLocale unspecified and each messages file will be sorted according to its own locale (e.g. en/common.json will be sorted using English order, while es/common.json will be sorted according to Spanish order).

Fixes #702

@traverse
Copy link
Copy Markdown

Is there anything that can be done to move this along? Would really love to be able to use this feature.

@dantman
Copy link
Copy Markdown
Contributor Author

dantman commented Mar 29, 2022

I don't know. Nothing has been committed to this project since October. And an issue discussing the state of the project (#694) was closed by the opener because maintenance was promised to happen in December and then the maintainers disappeared.

@arnonrdp
Copy link
Copy Markdown
Contributor

Maybe, it is better to work on a fork: openscript-ch#1

@terales terales requested a review from kibertoad as a code owner August 27, 2023 20:57
@terales terales merged commit ae6972a into lokalise:main Aug 27, 2023
huacnlee pushed a commit to huacnlee/i18n-ally that referenced this pull request Aug 28, 2023
)

* add option to sorting message by a locale's order

Fixes lokalise#702

* Empty commit to trigger CI

---------

Co-authored-by: Alex Terehov <terales@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Allow keys to be sorted alphabetically instead of binarily

4 participants