-
Notifications
You must be signed in to change notification settings - Fork 303
i18n #1632
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
base: main
Are you sure you want to change the base?
i18n #1632
Conversation
|
currently CI build may fail because i used |
|
just found one limitation - clap badly support i18n. trying to work around... |
|
@o2sh i think this issue should be marked with "help-wanted" |
spenserblack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool idea. Before I look more into this, quick question: are the translations done at compile-time, or runtime?
| i18n-embed-fl = "0.10.0" | ||
| rust-embed = "8.9.0" | ||
| macro-vis = "0.1.1" | ||
| clap-i18n-richformatter = { git = "https://github.com/Sk7Str1p3/clap-i18n-richformatter-0.1.4" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this dependency is going to need to be a published crate. Otherwise we won't be able to publish onefetch to crates.io
build.rs
Outdated
| .last() | ||
| .unwrap() | ||
| .as_os_str() | ||
| .to_str() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to convert to a str? Path::join should take several path-like types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was very stupid, not only because of conversion into str xdd. I'll fix it soon
build.rs
Outdated
| create_dir_all(out_dir.join(lang)).unwrap(); | ||
|
|
||
| let mut out_file = | ||
| BufWriter::new(File::create(out_dir.join(lang).join("onefetch.ftl"))?); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're calling out_dir.join twice, you probably would want to save the result to a variable instead.
|
|
Perfect 👍 |
|
almost finished cli. there're some issues with hard-coded values in |
TODO: deal with `default` and `possible values`


implement i18n for onefetch
resolves #1631