-
Notifications
You must be signed in to change notification settings - Fork 27
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
Compile time checks #63
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I didn't find any information about compile-time checks. If message in locale file is missing then string passed to macro will be displayed:
rust-i18n/crates/macro/src/lib.rs
Lines 183 to 186 in ba2c7cb
Will it be hard to create a separate macro or add option for
t!()
to make sure the message I use exists in the locale file at compile time (like sqlxquery!
does)? This can be tricky, so maybe an easier way is to create xtask (or test) to check that all the messages I'm using in the code are defined. This way it can be easily integrated with CI.All I want to achieve is if my app has passed CI, the locale files will have the appropriate content and the user won't see "en.wron_mesag".
Probably internationalization-rs can be used to see how they achieve compile time verification (using build.rs).
The text was updated successfully, but these errors were encountered: