Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1142476

    Hi,

    Thank you for such a great theme! I’m wondering if you could you please advise on the following?

    – How to remove the flags in the language switcher, in the top right corner of the desktop site?
    – Make the language switcher text only .. I’m using English and Simplified Chinese; on any English page, to only show the text link for Simplified Chinese, and on a Chinese page, to only show “English” link?
    – On a Simplified Chinese page, the sub-directory for the translations appears as “zh-hans/” ; how do I change that subdirectory name, to “ch” for instance?

    I also reviewed the following thread and tried your advice here, but could not get the language switcher to change to text only:

    https://kriesi.at/support/topic/change-flags-to-letters-in-language-switch-wpml/#post-1106424

    Since the language I’m using is Simplified Chinese (as opposed to Italian in the thread), I changed the css and added it to Quick CSS for both languages, and also tried it to the custom.css, but nothing changed. I’m not sure if using “zh-hans” as is correct, could you please advise?

    ____

    .noLightbox.social_bookmarks + .sub_menu {
    float: right;
    }
    html[lang=”zh-hans”] .avia_wpml_language_switch li span.language_native {
    display: none !important;
    }

    ____

    Thank you so much for your help, I appreciate your advice!!

    #1143535

    Hey designyvr,

    Thank you for the inquiry.

    You can use this snippet in the functions.php file to remove the flag switcher and add the default language switcher in the header.

    add_action('after_setup_theme','avia_remove_main_menu_flags');
    function avia_remove_main_menu_flags(){
            remove_filter( 'wp_nav_menu_items', 'avia_append_lang_flags', 20, 2 );
            remove_filter( 'avf_fallback_menu_items', 'avia_append_lang_flags', 20, 2 );
            remove_action( 'avia_meta_header', 'avia_wpml_language_switch', 10);
    }
    
    add_action('ava_main_header', 'ava_icl_language_selector');
    function ava_icl_language_selector(){
    	do_action('icl_language_selector');
    }

    You can then configure the flag options in the WPML panel.

    Related thread: https://kriesi.at/support/topic/wpml-language-switcher-still-not-working/

    Best regards,
    Ismael

    #1143553

    Hi Ismael,

    Thanks for you help! I’m not sure why, but adding the code snippet to functions.php added 2 more switchers to my header. I added the CSS from your related thread and then configured the switcher options in the WPML panel, and that did the trick, thanks for the info.

    To follow up on one more question from my original post:

    On a Simplified Chinese page, the sub-directory for the translations appears as “zh-hans/” ; how do I change that subdirectory name, to “ch” for instance, so the urls for the Chinese pages show domain.com/ch/ instead of domain.com/zh-hans/ ?

    Would you be able to advise on that?

    Thank you!

    #1144377

    Hi,

    Thank you for the update.

    We haven’t really tried that before but it is possible according to this thread.

    // https://wpml.org/forums/topic/can-i-change-zh-hans-to-zh-or-cn-something/

    You will have to create a custom language though. Please contact the plugin developer for additional help.

    Best regards,
    Ismael

    #1144613

    Hi Ismael, Thank you for sending this link.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.