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

Language names of a country in all different cultures #2

Closed
sthewissen opened this issue Jan 7, 2021 · 8 comments
Closed

Language names of a country in all different cultures #2

sthewissen opened this issue Jan 7, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@sthewissen
Copy link
Contributor

Currently, the name of all countries is in here translated to all the different cultures. Are there plans for the future to do something similar for the language of those countries? E.g:

"languages": [
    {
      "languageCode": "EN",
      "name": "Dutch"
    },
    {
      "languageCode": "NL",
      "name": "Nederlands"
    },
    {
      "languageCode": "FR",
      "name": "Néerlandais"
    },
    ...
  ],

This package offers something similar, but is not open source and not maintained:
https://www.nuget.org/packages/IsoNames.NETStandard/

It's also missing a few things from what I can see in my applications.

@tinohager
Copy link
Member

Can you describe an example of what exactly you want?

@tinohager
Copy link
Member

Okay I now understand your request. Currently it is not planned but you are welcome to send a pull request with the extension.

@tinohager tinohager self-assigned this Jan 7, 2021
@tinohager tinohager added the enhancement New feature or request label Jan 7, 2021
@sthewissen
Copy link
Contributor Author

I could look into it, but I wonder how you did the translation for the other values you have? I assume you don't speak every language in the world, is it all through translation APIs or how do you typically do it?

@tinohager
Copy link
Member

There are countless projects on github in other languages that I used as a data source. After that I built a simple parser that wrote the values correctly into my classes. And then of course there was some manual work.

@sthewissen
Copy link
Contributor Author

What would be your preferred way of implementing this? I was thinking something along the lines of:

public class ItalianInfo : ILanguageInfo
{
    public string CommonName => "Italian";
    public string OfficialName => "Italiano";

    public Translation[] Translations => new[]
    {
        new Translation(LanguageCode.DE, "Italienisch"),
        new Translation(LanguageCode.NL, "Italiaans"),
        new Translation(LanguageCode.EN, "Italian")
        ...
    };

    public LanguageCode LanguageCode => LanguageCode.IT;
}

Along with some helper methods to get language names in different languages etc. which would go into a LanguageProvider class. Since language and country can be a many-to-many relationship it seems a bit strange to include this in the existing CountryInfo logic.

@tinohager
Copy link
Member

@sthewissen I am currently working on spinning off the translations into a separate project. I would like to see that the basic module remains as small as possible. With all translations we have almost reached a size of 1MB.

@tinohager
Copy link
Member

@sthewissen The new packages are available on nuget.

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

No branches or pull requests

2 participants