-
Notifications
You must be signed in to change notification settings - Fork 17
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 support for translations #3
Comments
Of the long format or also for short as well? How are translations in general handled in Rust world? Is there some sample library crate where translations are implemented? |
There is a crate called crowbook-intl. If any body knows another I'd be interested |
I'm not familiar with Rust, but I think translations should be hardcoded, because these are short words that won't likely change, so it don't need a transation system that tracks the changes of the original text. |
Shall it allow to choose the language from enum (populated only with English initially) and allow to opt-in more hard coded translations using Cargo features? |
Is there maybe a crate with authoritative list of languages for localisation as an enum, but which does not enforce any particular scheme? |
I think it don't need to be opt-in. |
Please review the proposed API for translation and additional features: https://github.com/vi/timeago/blob/3656ed710edacd13699d147ef6d3dc9ab694dee8/src/lib.rs Is it going to the right direction? |
@vi have you looked at crowbook-intl? |
I've glanced there once, saw tricky build script and macros and looked away. Is the way there a good way do to translations? Can it be opt-in (preserving simplicity for ones who don't care about translations)? |
Added some support for translations (without build scripts or macros, but with Is it the translation support you expect? I don't think formatting time intervals is to be done by some framework with loadable files. Each language can contain tricks to algotithms. Currently only provided translations for languages that I personally know/learned. |
I think it may be worth it to implement fluent. I'be been meaning to use it for my things, but I've not played with it yet. Some links: |
@vi Oh, easy. This is the rust crate https://crates.io/crates/fluent |
No description provided.
The text was updated successfully, but these errors were encountered: