learningequality / le-utils

Utilities and constants shared across Kolibri, Ricecooker, and Kolibri Studio
MIT License
2 stars 31 forks source link

Implemented getlang_by_native_name for easier lookups #31

Closed ivanistheone closed 6 years ago

ivanistheone commented 6 years ago

While looking at this site http://nalibali.org/story-library/multilingual-stories it became apparent we might need a lookup function for languages by native name.

This PR implements this. See tests for example usage.

Currently only two languages of the ones on nalibali.org are missing so we should add them to our internal json DB: [u'Sepedi', u'Tshivenda'] see https://en.wikipedia.org/wiki/Northern_Sotho_language https://en.wikipedia.org/wiki/Venda_language already have Venda but the native name is different, so we could add it after a comma.

Modify:

  "ve":{
    "name":"Venda",
    "native_name":"Tshivenḓa"
  },

To:

  "ve":{
    "name":"Venda",
    "native_name":"Tshivenḓa, Tshivenda"
  },