Skip to content

feat: clear translation cache #39

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ameeetgaikwad
Copy link

This PR exposes the existing cache clearing functionality through the global API, making it easily accessible to widget users. Users can now manually trigger clearing cache.

Copy link

vercel bot commented Jun 14, 2025

@ameeetgaikwad is attempting to deploy a commit to the JigsawStack Team on Vercel.

A member of the Team first needs to authorize it.

@@ -1039,4 +1040,17 @@ if (typeof window !== "undefined") {
};
}
};

window.clearCache = (
onComplete?: () => void,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the clear() function removes all cached translations from localStorage. I’d like to add an optional lang_code parameter—if provided, it should only clear the cache for that specific language. If not provided, it should continue to clear everything as before.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright will add this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this as well.

just one thing, when clearing cache for specific language it doesn't clear jss-pref. Let me know if u want to clear this as well.

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

Successfully merging this pull request may close these issues.

2 participants