-
Notifications
You must be signed in to change notification settings - Fork 1
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
Resolve rework requests #4
Conversation
Sick, thanks for helping out^^ |
I do think renaming the macro makes sense, but I am not sure if Here's my thoughts: The However, I've been pondering about localization vs internationalization; e.g. if the Reading about localization vs internationalization, I found that internationalization is the right name for the framework that enables localization. To me this means that it will not make sense to replace all mentions of The rationale being: "Internationalization" widens the space or scope to all locales, while "localization" then, as a second step, deliberately reduces the space or scope down to one single desired locale. I've been considering to call the macro What do you think? Is |
I'm ok with merging here. Other changes can be done in a separate PR. Continued discussion: About https://github.com/djc/askama/pull/700/files#r934508219 This would also solve https://github.com/djc/askama/pull/700/files#r991425622 |
Regarding the name I personally would not rename the expression Also removing the macro hm i don't know in my opinion its better to a nice friendly error message there but I think upstream should decide on wether to remove it or not. At least that are my thoughts on it. I will merge this once I finished eating/ the current episode :>) |
I would strongly prefer We could also drop the crate-level macro and just rename the (currently misnamed?) askama::i18n::load!(LOCALES); or: use askama::i18n;
i18n::load!(LOCALES); If a user missed enabling the feature then the compiler would inform that the |
Sounds good to me, I more of a "proxy" anyways with this PR. |
Won't work, unfortunately, due to proc-macro restrictions: |
TIL, then lets change it to |
Proc-macro askama_derive::i18n_load!() must remain in root namespace, due to restrictions in proc-macro exports. However, it is re-published as `askama::i18n::load!()`.
Fixed it. Check original post for notes for each added commit. |
Resolve some rework requests at djc#700
fix: Remove commented out i18n tests
Fixes thread https://github.com/djc/askama/pull/700/files#r934558288
fix: Add trailing newline to i18n test templates
Fixes thread https://github.com/djc/askama/pull/700/files#r934508651
fix:
cargo fmt
, remove trailing whitespaceFixes CI lint at https://github.com/djc/askama/pull/700/checks
fix: Rename feature
localization
toi18n
Fixes thread https://github.com/djc/askama/pull/700/files#r934510739
opinionated: Rename initialization macro localization! to i18n_load!
Rationale: Match module name and renamed feature name, while still making sense to human readers.
style: Change wording "have to" to "need to"
Improve message wording.
refactor: Confine i18n code inside i18n modules
You can now call
And i18n features no longer leak out of the
i18n
modules.fix: Hide dependency fluent_templates from library users
Just a fix, reverting dependency management to a better state from before the refactor. Library users should not need to add fluent_templates as their crate's dependency.
fix(deps): Update dependency fluent-templates to 0.8.0
Update
fluent-templates
to the latest version. The lookup function was changed to return anOption<String>
.I chose to
unwrap()
the returnedOption
in the code generator, because the key being looked up (message
) is checked at compile time.Dependency changes: XAMPPRocky/fluent-templates@v0.7.1...v0.8.0
docs: Add initial i18n module documentation
Adds some initial documentation, based on a test case (simplified).