Add new macro importing translation to the final binary
#12
Merged
kiwii
merged 2 commits from plume/rocket_i18n:master
into master
5 years ago
Loading…
Reference in New Issue
There is no content yet.
Delete Branch 'plume/rocket_i18n:master'
Deleting a branch is permanent. It CANNOT be undone. 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
Reviewers
7a397ffdfe
.Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Forgejo.