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

Attach an event handler function for on language change? #151

Closed
hesyifei opened this issue Jan 7, 2018 · 2 comments
Closed

Attach an event handler function for on language change? #151

hesyifei opened this issue Jan 7, 2018 · 2 comments

Comments

@hesyifei
Copy link

hesyifei commented Jan 7, 2018

Is it possible to use something like

$( document ).on( "language-change", function() {
    console.log( "Language just changed." );
});

to detect language change so that I can make corresponding changes to the interface's UI? Thanks! :)

@Nikerabbit
Copy link
Member

This library itself doesn't change language. Usually you use something like jquery.uls library to provide language choose for the user. It provides onSelected callback, where you would tell jquery.i18n what language to use, and any other changes you want to do.

@hesyifei
Copy link
Author

hesyifei commented Jan 8, 2018

Understood. Thanks 👍

@hesyifei hesyifei closed this as completed Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants