sillsdev / sillsdev/silnlp

Have code treat all languages equally.

Open
#74 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
39
Forks
7
Avg merge
1d 9h
Merged PRs (30d)
5

Description

I can preface this with the fact that this is rather an ideological issue. However it is one with a very practical application.
The ideological side of the argument says that it is important not to be ethnocentric, even in our code. The pragmatic side of the argument is that it's important that our code works well and is as reliable as possible. Treating languages equally helps to make code as reliable as possible would mean that some errors will be caught much sooner, and caught by English speakers not left for speakers of other languages to catch.

In this snippet of code we have the English iso string 'en' hard coded as a default. Having English as a default is non treating all languages equally.

def get_terms_glosses_path(list_name: str, iso: str = "en") -> Path:
    iso = iso.lower()

Imagine that for other languages we rely on some code to read the iso code from an environment variable or file. We're not going to test that code in our everyday use, which means that issues in that code are more likely. If instead to read in the iso code for English then we will automatically test the code every time we use it.

Our code has to interact with code from others, and unfortunately this idea is not yet widespread. Therefore it is occasionally necessary to have language specific code. An example is when we are reading Biblical terms from Paratext files since those files have a different naming convention for their English data files than they do for those of other languages. Having language dependent code perpetuates the problem.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the shown get_terms_glosses_path function and inspect how its iso argument is supplied, especially where the English default is used. Done means the language-specific handling no longer gives English a special default and the relevant behavior is verified across supported languages.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
internationalization
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.