pouriya/keshvar

Does it support name aliases?

non-descriptive opened this issue · 4 comments

The example suggest that you can use any language to lookup for country. Does it support aliases?

let country_name_in_any_language = "estados unidos"; // The US in spanish!

I've seen inside code Russian alias for the US (which generally is USA) and seen only "Соединённые Штаты", which generally doesn't used and exists in forms "Соединённые Штаты Америки", "Штаты" (informal speech) and "США" (abbrev). Does it supports such aliasing?
Also there's "США" under uk key which i believe supposed to be Ukraine (their code is ua) but has tag of United Kindom. And probably should have long form as "Сполучені Штати Америки"

For every country there is a list unofficial_name_list that contains some popular names for that country.
For example for The US, this is the list:

pub const UNOFFICIAL_NAME_LIST: &[&str] = &[
        "United States",
        "USA",
        "Vereinigte Staaten von Amerika",
        "États-Unis",
        "Estados Unidos",
        "アメリカ合衆国",
        "Verenigde Staten",
        "Соединенные Штаты Америки",
    ];

By using find_by_name function, keshvar tries to search these lists too.

If you think some names are missing in some languages. I recommend to make a contribution to our submodule library. for more info see CONTRIBUTING.md file.

What about uk/ua? Is it supposed to find things forward to english or other way around should also be working?

Found the commit. Since I could not find a separate PR for just this change, I think you can make a new PR and improve it (if you believe something's wrong).