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

Locales Cache (?) not updating #86

Closed
ogcatt opened this issue Dec 24, 2023 · 6 comments
Closed

Locales Cache (?) not updating #86

ogcatt opened this issue Dec 24, 2023 · 6 comments

Comments

@ogcatt
Copy link

ogcatt commented Dec 24, 2023

I am using actix and translations work fine for locales at first glance (in this example I am using EN & FR). However, when I update the values in the json files, the site does not update from the previous translations, even after rebuilding the project (or doing CTRL+Shift+R). The only way the translations update is if I change the key name in the json and within the rust implementation itself.

I have no idea why or how this is happening.

Any help would be appreciated.

I can provide any code that is needed.

@ogcatt
Copy link
Author

ogcatt commented Dec 24, 2023

For reference, I am running cargo leptos watch for running the dev instance of my site

@Baptistemontan
Copy link
Owner

Yes it's an issue I ran into too, I think the compiler make the assumption that all macros are code to code, and are pure, so that it can cache a lot of things and not reexpand every macro at every rebuild. So the load_locales macro is not rerunned when the watcher update if no code has been changed. The trigger is not to change the keys in the json, the trigger is that you changed code, whatever code. I know it's frustrating but forcing a full macros reload at every rebuild would be a huge pain, and there is no way for now to specify specific macros as impure or something like this.

@ogcatt
Copy link
Author

ogcatt commented Dec 24, 2023

How can I do a full macro reload?

@Baptistemontan
Copy link
Owner

No idea, I don't know the internals of leptos watch so I can't give you any tips on that...

@Baptistemontan
Copy link
Owner

Baptistemontan commented Jan 31, 2024

I've stumbled across the path tracking api and implemented it with #93, it needs nightly but would solve the problem. I'll push v0.3.0-rc.1 pretty soon with those changes, so if you could try it and give a feedback I would greatly appreciate it.

@Baptistemontan
Copy link
Owner

I'm pretty sure #93 fixed up the issue as much as possible, there is'nt more I can do from this side, the rest of the problem is from the compiler itself, so I'm closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants