Skip to content
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

Check that identifiers passed to macros exists in Fluent files #35

Closed
mondeja opened this issue Mar 7, 2024 · 0 comments · Fixed by #86
Closed

Check that identifiers passed to macros exists in Fluent files #35

mondeja opened this issue Mar 7, 2024 · 0 comments · Fixed by #86
Labels
new feature Issues or pull requests that introduce new features

Comments

@mondeja
Copy link
Owner

mondeja commented Mar 7, 2024

This would be a really great feature because it would prevent a lot of bugs about unsynchronized translations. The idea is to check the existence of literal identifiers and arguments passed to tr! and move_tr! macros in the Fluent files, so we can ensure at compilation time that a translation is missing.

The implementation required to convert macro_rules! macros to procedural ones and allow them to check if the passed arguments are literal strings or expressions. If they are literal strings, check them in the Fluent files.

The problems are two:

Expensive

Could be computationally extensive, so the solution would be to wrap this in a opt-in feature.

Lack of context

We don't now the location of the files at tr! and move_tr! macro invocations. I'm not sure how to solve this, perhaps the most manageable approach would be to declare in the leptos_fluent! macro what files must be checked with a (or an array of) Bash wildcard(s).

Another possible solution would be to wait for XAMPPRocky/fluent-templates#53, but doesn't seem too much relevant.

@mondeja mondeja added the new feature Issues or pull requests that introduce new features label Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Issues or pull requests that introduce new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant