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

Switching back to no language file on click #83

Open
magglomag opened this issue Jul 21, 2016 · 1 comment
Open

Switching back to no language file on click #83

magglomag opened this issue Jul 21, 2016 · 1 comment

Comments

@magglomag
Copy link

magglomag commented Jul 21, 2016

Hi,

I am using the plugin in a language switcher. My default language is German (the German strings are in my index.html like <h1 data-translate="title">Title in German</h1>) and I have a language file content-en.js for the English translation.

The language can be switched on click:

    $buttonEN.click(function( e ) {
       $( '[data-localize]' ).localize( 'content', { language: 'en' });
    });

What I now like to achieve is that when I click on $buttonDE not the German language file should be loaded but the normal strings in my index.html. So is there a function to just stop the plugin from loading a language file?

    $buttonDE.click(function( e ) {
      /* The regular strings in my `index.html` should be loaded. */
    });

Thanks for your help!

@DanielZlm
Copy link

A dirty workaround is just reload the entire page, e.g.:

$("#buttonDE").click(function(e) { location.reload(); });

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