topgrade
topgrade copied to clipboard
add i18n
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
I'll look into it. I had a quick look into the rust-i18n crate and it seems pretty easy to implement.
yes i want to translate this to zh_TW @DottoDev
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'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
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?
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:)
I've started with an implementation in https://github.com/topgrade-rs/topgrade/pull/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
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!
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 😄
Initial i18n support has been added (kudos to @Mastermindaxe ), welcome to add the translations for your language. And, locale file maintainers are more welcome. 😁
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