another attempt at i18n support #681
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@Code7R what do you think of this approach?
I searched for i18n options, and this one causes the translations to be compiled into the program, so no additional files would need to be distributed. I don't think it's as full-featured as gettext ,but not sure that's important.
The translations are just auto-complete from code AI, so I don't know if they're reasonable, I was just using them for testing that translation is active.
would be an alternative to #680
Note
Introduces built-in localization for user-facing messages across binaries, with translations embedded at compile time.
rust-i18ndependency and config ([package.metadata.i18n]) inCargo.toml; new locale fileslocales/main.ymlandlocales/TODO.yml(en/fr/de)encfs::init_locale()insrc/lib.rsmapsLANG(e.g., en_US/fr_FR/de_DE) to rust-i18n locales and sets the active localesrc/main.rsandsrc/encfsctl.rs: wraps prompts, errors, and logs witht!(...), and callsinit_locale()at startupWritten by Cursor Bugbot for commit 3fb2f80. This will update automatically on new commits. Configure here.