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

add i18n #2

Closed
0xMRTT opened this issue Oct 11, 2022 · 11 comments · Fixed by #807
Closed

add i18n #2

0xMRTT opened this issue Oct 11, 2022 · 11 comments · Fixed by #807
Labels
C-feature request New feature request good first issue Good for newcomers

Comments

@0xMRTT
Copy link
Contributor

0xMRTT commented Oct 11, 2022

For many users, English isn't their first language. It'll be cool if topgrade can be translated in other languages using a library called i18n-embed and fluent language

@s34m s34m added the C-feature request New feature request label Oct 11, 2022
@s34m
Copy link
Member

s34m commented Oct 11, 2022

I'll look into it. I had a quick look into the rust-i18n crate and it seems pretty easy to implement.

@s34m s34m added the good first issue Good for newcomers label Oct 11, 2022
s34m added a commit to K-Finlay/topgrade that referenced this issue Oct 14, 2022
* Add step for updating julia packages

* Appease clippy

Authored-by: Jules Bertholet <[email protected]>
Approved-by: Thomas Schönauer <[email protected]>
@olivertzeng
Copy link
Contributor

yes i want to translate this to zh_TW @DottoDev

@olivertzeng
Copy link
Contributor

I'll look into it. I had a quick look into the rust-i18n crate and it seems pretty easy to implement.

Is this still in development? Or is the idea just forgotten?

@SteveLauC
Copy link
Member

I'll look into it. I had a quick look into the rust-i18n crate and it seems pretty easy to implement.

Is this still in development? Or is the idea just forgotten?

I believe that DottoDev did give it a try as there is a branch in the repo, but for now, I think it is forgotten

@Mastermindaxe
Copy link
Contributor

I might take another crack at this next week. Are there any preferences regarding the library to implement this or should I make an (then) educated guess and just go for it?

@SteveLauC
Copy link
Member

Are there any preferences regarding the library to implement this or should I make an (then) educated guess and just go for it?

I haven't taken a look at i18n so I cannot give you a detailed reply for now. But feel free to ask me if you have any specific questions:)

@Mastermindaxe
Copy link
Contributor

Mastermindaxe commented May 19, 2024

I've started with an implementation in #807

But tbh I'm not quite satisfied with the usability of that crate in println macros for example. It's very tedious as println!("Hello") becomes println!("{}", t!("Hello")). This makes it much more unreadable imo. Especially in print statements where there are many arguments in the format string.

I think it works well enough though. If you could take a quick glance and tell me if you want me to move forward with it, that would be amazing. I'm just afraid that there might be a better option that sacrifices developer experience less. I'm open to suggestions and any input you have. If that's a non-issue for you I'd be happy to finish the PR and migrate the still missing strings.

One further note on the implementation: I've use the english string literals as the translation keys for better developer experience. Ie I don't have to look in the translation file to work with the code and can, instead, just look at the key. My attempt at improving dx :D

@SteveLauC
Copy link
Member

Thanks for working on it!

If you could take a quick glance and tell me if you want me to move forward with it, that would be amazing

Yeah, I will take a look at the PR in the near future!

@Mastermindaxe
Copy link
Contributor

Just a quick update: Have made lots of progress over in #807. I think the bulk of it is done. If any of you guys would like to review be my guest.

@olivertzeng Thought I'd give you a quick update on this 😄

@SteveLauC
Copy link
Member

Initial i18n support has been added (kudos to @Mastermindaxe ), welcome to add the translations for your language. And, locale file maintainers are more welcome. 😁

@olivertzeng
Copy link
Contributor

Initial i18n support has been added (kudos to @Mastermindaxe ), welcome to add the translations for your language. And, locale file maintainers are more welcome. 😁

Will do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature request New feature request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants