Add new macro importing translation to the final binary #12
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: plume/rocket_i18n#12
Loading…
Reference in a new issue
No description provided.
Delete branch "plume/rocket_i18n:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a new macro
include_i18n!
, taking similar arguments toi18n()
, and expanding to the same type. It allow to include translations in the final binary, so that once compiled, it can be run from anywhere,without depending on
.mo
s to be present@ -127,0 +135,4 @@
/// ```
#[macro_export]
macro_rules! include_i18n {
( $domain:tt, [$($lang:tt),*] ) => {
Is a string literal a single
tt
?@ -127,0 +135,4 @@
/// ```
#[macro_export]
macro_rules! include_i18n {
( $domain:tt, [$($lang:tt),*] ) => {
I just tested it, and it works. 👌
Thanks!
@ -127,0 +135,4 @@
/// ```
#[macro_export]
macro_rules! include_i18n {
( $domain:tt, [$($lang:tt),*] ) => {
to be honest, I didn't know the type I needed to use, so I put the first one I thought of, and I tested if the macro worked as intended in Plume (which confirm Plume only needs that to become a standalone binary). It's totally possible provided with some bad arguments this macro fail in some strange way