compile_i18n as a build function #9
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: plume/gettext-macros#9
Loading…
Reference in a new issue
No description provided.
Delete branch "process"
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?
pub fn compile_i18n
ingettext_utils
The way this works now is:
compile_i18n
is called frombuild.rs
. Itpo/{domain}
and the `.po insidetarget/translations/.domains/{domain}
(previouslytarget/debug/gettext_macros/{domain}
)It doesn't contain the domain on the first line anymore.
GETTEXT_MACROS_DOMAIN
to {domain}, it's then used byi18n!
andinclude_i18n!
i18n!
now.pot
file ifGETTEXT_POT_INIT
is not set, then setGETTEXT_POT_INIT
.pot
like beforeinclude_i18n!
now.pot
with each.po
file for the domain (it fetches the list of locales fromtarget/translations/.domains/{domain}
.po
file and put the output into the tokenstream directly (without writing to a.mo
file, see note)Removed feature
uniform_paths
(since it's in stable now),and added(don't need it anymore since a secondproc_macro_diagnostic
to allowi18n!
to print warnings when new strings are addedcargo build
is not needed).About the include_i18n not writing to a mo file, this is because otherwise
include_bytes!
would add an implicitcargo:rerun-if-changed=file.mo
, andcargo build
would rebuild the whole project every time even if nothing changed.Still testing the "rerun" mechanism that makes the translations recompile when there's new strings
Looks like it works now
... or not? unused msgids are not removed from the pot.
I moved the pot -> po -> mo compilation logic into include_i18n!, and only one cargo build is needed to have everything at once now...
... BUT it reruns the compiler even if nothing in the project has changed!
:) definitely not a bug
Pull request closed