WordPress.org

Ready to get started?Download WordPress

Forums

Multisite Language Switcher: change link colour and flag (16 posts)

  1. mcchazza
    Member
    Posted 2 years ago #

    Hi all

    I am running a MU site (www.graphenepartners.com) in two languages, and have successfully installed the Multisite Language Switcher plugin. Would just like to know how/where I can change the link colour and the flag (from US to British). I have changed my link colour in the theme options but this did not affect the MLS widget.

    Thanks in advance for your help :)
    Adam

  2. realloc
    Member
    Posted 2 years ago #

    You can change the output of the widget (https://github.com/lloc/Multisite-Language-Switcher/wiki/Change-the-output) but it seems that the link color of elements in the sidebar aren't handled. Maybe you have to talk with the theme-developer?

    If you want to use another flag you can setup alternative directory where you store them. Here you could rename the British flag for example.

    Cheers,
    Dennis.

  3. fran330
    Member
    Posted 2 years ago #

    Dennis, me to I'd like to change the American flag to a British one. Can you tell us more about "set up an alternative directory" ? Sorry I have no idea what it means nor what I should do...
    Thanks in advance,
    Fran

  4. realloc
    Member
    Posted 2 years ago #

    Yes, this is maybe not so clear. Let me assume that you have an directory in your theme which contains some flags you need (for a good starting point you could copy the flags from the Multisite Language Switcher in your directory), the name of the theme is "example-theme" and the name of the directory with the flags is "alternative-flags" ... now you can insert a value like http://YOURDOMAIN/wp-content/themes/example-theme/alternative-flags/ in this field.

    Cheers,
    Dennis.

  5. fran330
    Member
    Posted 2 years ago #

    Yes, but the British flag (gb) IS in your collection of flags, in your plugin. What happens is that on the frontend, the plugin deplays the American flag (us) for English language. I don't see any possibility in the settings for choosing between US or British flag.

    Since the British flag is already in your plugin, I don't see the point of pointing to new directory...
    Am I missing something here ?

    Or should I copy your directory to a new one and give the British flag the name "us" (???)

  6. fran330
    Member
    Posted 2 years ago #

    Or should I copy your directory to a new one and give the British flag the name "us" (???)

    Actually it works ! Yeah! It's not very academic to call a British flag "us", so if you have a better way to propose...
    But if not, don't worry, at least, it works this way LOL

    Thanks for your attention, Dennis
    Fran

  7. realloc
    Member
    Posted 2 years ago #

    This is one possibility ... if you prefer a more cleaner solution you could create an en_GB language file, install it in your language folder and activate it as language for one of the blogs in your network. But the "us"-solution is quicker of course.

  8. jjamjar
    Member
    Posted 2 years ago #

    yes the en_GB solution works - thanks for the excellent plugin.

  9. carthagod
    Member
    Posted 2 years ago #

    I have the same issue, and I don't really understand the solution. Can you please give some more details ?

    I was thinking that I could chose the flag with the option "Custom URL for flag-images" but this doesn't work. I inserted "http://mydomain/wp-content/plugins/multisite-language-switcher/flags/gb.png" and instead of this I get in the source code : "http://mydomain/wp-content/plugins/multisite-language-switcher/flags/gb.png/us.png". So obviously it doesn't find the flag...

    Is this a bug ?

    Also, when I click on the flag it opens the translated website in a new window (though only when going English=>German, German=>English is ok). Do you know why that happens ? How can I fix it ?

    Thanks !

  10. realloc
    Member
    Posted 2 years ago #

    No this is not a bug.

    I wrote "Custom URL for flag-images" so it should be a directory ... you noticed already that the plugin changes your URL "http://mydomain/wp-content/plugins/multisite-language-switcher/flags/gb.png/us.png".

    You can - of course - create your own directory (in your theme-directory for example) and rename there the gb-flag to us.png. This is a "quick and dirty" solution if you prefer the Union Jack as flag for the English language.

    Regarding the link ... I don't know what you mean. The generated link is always the same:

    <a href="http://lloc.de" title="Deutsch"><img src="http://lloc.de/it/wp-content/plugins/multisite-language-switcher/flags/de.png" alt="de_DE"/> Deutsch</a>

    It depends how you configured the plugin but there is no target defined if you mend something like that. There is a way to change this behavior but you'll have to write your own code for this.

    Cheers,
    Dennis.

  11. carthagod
    Member
    Posted 2 years ago #

    Thanks for the help Dennis. Ok, I get the quick and dirty solution, I wanted to understand the other one you were talking about though, which is cleaner (with the en_GB file). Can you please give some detail on that ?

    As for the link, I indeed have a code like the one you give. However it opens the link in a new tab. I don't understand why it behaves this way. What code to I need to write for this ?

  12. realloc
    Member
    Posted 2 years ago #

    You could create an empty file named en_GB.mo in wp-content/languages/. And then set the language in "General Settings". After this the flag should be the British one.

    Regarding the link: I believe that you have installed a plugin that opens links in a new window. You don't have to write any code ... I mend that you have to add code if you want to open the links in a new window.

  13. carthagod
    Member
    Posted 2 years ago #

    ok for the openning in a new window it's an issue with another pluggin, don't mind about this sorry.

    Only the other problem left :)

  14. realloc
    Member
    Posted 2 years ago #

    You already tried what I suggested? ;)

  15. carthagod
    Member
    Posted 2 years ago #

    Ah, sorry, our answers crossed over...

    That worked, thanks !

  16. realloc
    Member
    Posted 2 years ago #

    Excellent! :)

Topic Closed

This topic has been closed to new replies.

About this Topic