[resolved] Multiple flags for the same language (5 posts)

  1. dontheo70
    Posted 2 years ago #

    First of all, your work is remarkable and extremely useful. Thanks you for all your efforts!!

    I was wondering if there was (or will be) a way allowing to setup several variations of a flag for a given language. For example for the following scenarii, in a wordpress Multisite using four languages:
    - making the active language flag more prominent by its style and appearance
    - using the flag style or shape that is best suited to the specific blog look and feel within that MS environment.

    Is it something that would be feasible?


  2. Chouby
    Plugin Author

    Posted 2 years ago #

  3. dontheo70
    Posted 2 years ago #

    Thanks for your prompt reply.

    I have already read the doc and made full use of the custom flags. I am sorry that I was not any clearer in my request. But I would like to know if it possible to customize even more the custom flags, as far as I understand the naming convention for the flag is restricted.

    The issue is that I want two shapes of flags:
    the active language flag needs to have a shape different from the inactive ones. In other words I am trying to get at the same time
    active_en_US and en_US flags, active_fr_FR and fr_FR flags an so on This was my first bullet.
    And then because I have several themes and designs in MU, I am trying to get as well active_cooking_en_US, cooking_en_US, active_tourism_en_US, tourism_en_US......

    Any thoughts on how to customize flags name?

  4. Chouby
    Plugin Author

    Posted 2 years ago #

    To do such thing, you will have to code your own language switcher. If you are a php programmer, it should not be too difficult. In that case, to help you starting, here is how to get the translations of the current page:

    global $polylang;
    foreach ($polylang->get_languages_list() as $lang) {
    	// use $lang->name to get the language name
    	// use $lang->slug to get the language code
    	$url = $polylang->get_translation_url($lang);
    	// $url === null if there is no translation available
  5. dontheo70
    Posted 2 years ago #

    Thanks for the tip, I will give it a try.
    I am not a programmer by trade but I get the hang of what needs to be done.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Polylang
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic