Skip to content

Converting a language to code doesn't seems to exist #57

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

Closed
s-celles opened this issue Dec 14, 2024 · 2 comments
Closed

Converting a language to code doesn't seems to exist #57

s-celles opened this issue Dec 14, 2024 · 2 comments

Comments

@s-celles
Copy link

Hello,

We have

julia> lang = Languages.from_code("eng")
Languages.English()

julia> name(lang)
"English"

But I don't see opposite: ie getting language code from a Language

Maybe something like

julia> code(lang)

and an optional parameter to get either Set 1, Set 2...

Best regards

@jingu-kim
Copy link

jingu-kim commented Feb 25, 2025

You can get a language code from a language name like this :

lang = get(Languages.englishname_to_lang, "korean", nothing)
if !isnothing(lang)
    code = isocode(lang)
end

@s-celles
Copy link
Author

Thanks @jingu-kim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants