Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for externalised sorting per language #748

Merged
merged 9 commits into from
Sep 18, 2024
Merged

Conversation

froggleston
Copy link
Contributor

@froggleston froggleston commented Sep 17, 2024

This PR attempts to fix #724 and #254 by moving away from liquid's in-built sort function and to use a bespoke sorting provided by sort-glossary.py.

There are two important changes:

  • The makefile now runs an external python script to sort the alphabet of each language. As each language does not have the same natural sorting of terms, this needs to be stored per language (see below)
  • The main glossary.yml file used to be copied into the _data folder to act as the served content to liquid/jekyll. This has now changed in that the python script creates a _data/{lang}/glossary.yml file for each language and the template loads the specific data file based on the selected language. It also dumps out non-Latin characters in Unicode to avoid ambiguity in rendering - humans are not meant to read this _data version of the glossary!

('ve', 'Venda'),
('vi', 'Vietnamese'),
('vo', 'Volapük'),
('cy', 'Welsh'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@froggleston Welsh is already present above in line 47. Maybe sort items so that we can easier spot accidental duplicates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great spot! I've removed the duplicates.

@froggleston
Copy link
Contributor Author

froggleston commented Sep 17, 2024

Sadly we can't add netlify builds as netlify doesn't allow system level dependencies (e.g. apt-get) at build time and we now require pyicu to be built which requires the libicu-dev package.

I think this is good to go, save for the couple of small issues in the main PR message.

@elletjies elletjies added the enhancement New feature or request label Sep 18, 2024
@elletjies elletjies merged commit 1d45c12 into main Sep 18, 2024
4 checks passed
@elletjies elletjies deleted the frog-glos-sort-1 branch September 18, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[2024-06-24]: [Alphabetical ordering for Ukrainian and Portuguese languages]
3 participants