Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8262313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:43:11+00:00 2026-06-08T03:43:11+00:00

I have the following problem. To translate a website, I’m using the jQuery Localize

  • 0

I have the following problem.
To translate a website, I’m using the jQuery Localize plugin.
This works fine. However, I want a CSS styled selectbox with flags and languages, and when a different option is selected the call to $("[data-localize]").localize("example", { language: $(this).attr('value') should be made to translate the page.

This code I’m currenly using, and it works fine for a plain, not-styled selectbox.

<script type="text/javascript">
    $(function() {
        $('#polyglot-language-options').change(function() {
            if ($(this).attr('value') == "en") {
                $("[data-localize]").localize("example", {
                    language: $(this).attr('value')
                });
            }
            else if ($(this).attr('value') == "nl") {
                location.reload();
            }
        });
    });
</script>

But I want to style it, so I tried to integrate the “polyglot” language switcher. However, the current code doesn’t work.

How can I integrate the $(“[data.localize]”).localize(); function in this code:

$('#polyglotLanguageSwitcher').polyglotLanguageSwitcher({
    effect: 'fade'
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:43:12+00:00Added an answer on June 8, 2026 at 3:43 am

    This plugin (source code) does not follow the guidelines for jQuery plugin design. The bugs I found quickly:

    • It does not allow chaining, because it does not return this
    • It works only on one element at a time (does not use each())

    • It has a queer element hierarchy. It seems to require an element with an id, containing a form containing a select (as in the demo). In my opinion, such a plugin should be called on the language select element only.

    • It seems to navigate automatically, wanting to be configured with the page structure. Each of the li items in that fancy box contains a link to the respective page.
    • Therefore, it does neither trigger the form it live in or fire the change event you want to listen to.

    As it stands, you can’t use this particular plugin as you want to. If you want to fix all the bugs, I wish you a happy time 🙂 Nonetheless it might be possible to manipulate the plugin code, to let you register callbacks on select events (where you can invoke the localisation plugin). Otherwise, you will need to choose an other select plugin (or build one yourself from scratch, adapting the existing code)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using GWT/JAVA for development. I have following problem: I want to remove
I have the following problem: I am creating a simple plugin jquery carousel, to
I have the following problem. I have embedded a map using Google Maps' API.
I have following Entity Framework Logic, and I want to translate to Stored Procedure,
I have the following problem: I want to simulate some control engineering system. As
I have the following problem: I have this multi-level array (nested array) which contains
I have the following problem: I have a generic EF repository using DbContext designed
I have following problem: I have to make a ASP.NET Webapplication with a two-row
I have following problem: I have built a tabbar application with 4 tabs. I
I have following problem, Code: String a=Yeahh, I have no a idea what's happening

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.