This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 8 replies, has 2 voices.

Last updated by pharaweeB 4 years, 6 months ago.

Assigned support staff: Bruno.

Author Posts
November 21, 2014 at 11:37 am #515607

pharaweeB

Could Please help me to fix the problem, I am much appreciated, see my question below and image attachment :

1. I would like to change “ENGLISH” name to “LANGUAGE” when click at this menu the dropdown menu appear each switcher language to select : Thai, English, Chinese, Arabic ?

2. Please see the dropdown menu at the present, it sort start from English, Arabic, Thai, Chinese. How I could change sort like this : Thai, English, Chinese, Arabic ?

3. At Chinese switcher character : (see attachment), how I could change this character to this : (see attachment) ?

4. If the question number 1 fix, when user click to select Chinese switcher then all the Chinese page will show. The top menu will be in Chinese but how about this “LANGUAGE” menu, its character change to Chinese ? If it change to Chinese how I could make it change and I want to use this (see attachment), how I
could change it ?

My site: hidden link , could you please provide me your private submit my site access login.

Thank you very much
Pharawee

November 21, 2014 at 11:39 am #515610

pharaweeB

Dear Bruno,

I still used the access information that I have sent it to you if you didn't have it, I will resend it again but please provide me your private submission.

Thank you.

November 21, 2014 at 12:01 pm #515627

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

I'll ask for some information so I can verify the problem. The fields for you to insert the credentials will be below its comment field.

Please let me know exactly what steps should I follow to see the problem.

Note: Please make a full backup of your site.

Thank you.

November 24, 2014 at 6:40 pm #517081

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

I fixed your site. Please could you check if it is working as desired?

I used this feature to add the menu as requested.

add_filter( 'wp_nav_menu_items', 'wpml_custom_language_label', 10, 2 );
function wpml_custom_language_label( $items, $args ) {

    $languages = icl_get_languages( 'skip_missing=0&orderby=code' );

    if( !empty( $languages ) ) {
        
        $sub_menu = $menu = '';
        foreach( $languages as $lang ) {
            $sub_menu .= '<li class="current_lang-'.$lang['language_code'].'"><a href="'.$lang['url'].'">'.$lang['native_name'].'</a></li>';
        }


        $language = "Language";
        if( function_exists( 'icl_translate' ) ) {
            $language = icl_translate( 'wpml_custom', 'wpml_custom_languages', 'Languages' );
        }
        $items .= '<li class="current_lang menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-depth-0 menu-item-simple-parent wpml-lang-switch"><a href="#">'.$language.'</a><span class="arrow"></span> <ul class="sub-menu">'.$sub_menu.'</ul></li>';
    }

    return $items;
}

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Thank you.

November 25, 2014 at 6:13 am #517209

pharaweeB

Dear Bruno

Thank you very much for your great support and I have some question :

1. How I can change "LANGUAGE" word character to their page language character when I switch to those page (currently it show "LANGUAGE" english word on Thai, Chinese, and Arabic page):

- Chinese language page (hidden link),
- Arabic language page (hidden link),
- Thai language page (hidden link)

2. The dropdown LANGUAGE menu, it start from Arabic, English, Thai, Chinese. How I could change to this Thai, English, Chinese, Arabic :

Currently:
LANGUAGE
> Arabic
> English
> Thai
> Chinese

I would like to change to:
LANGUAGE
> Thai
> English
> Chinese
> Arabic

3. How I can change switcher language word in dropdown menu to different word such as Chinese (中文中文) change to 中文

I am so sorry to ask you many question, it almost finish and everything look great. I am very much appreciated for your kindness support.

With Best Regards,
Pharawee Bij

November 25, 2014 at 9:07 pm #517796

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

1) You need to install the plugin String Translation or manually edit the functions.php file, between the lines 61-69:

if( 'en' == ICL_LANGUAGE_CODE ) { //english
    $language = "Language";
} elseif( 'zh-hant' == == ICL_LANGUAGE_CODE ) { //chinese
    $language = "Language";
} elseif( 'ar' == ICL_LANGUAGE_CODE ) { //arabic
    $language = "Language";
} else {
    $language = "Language"; //thai
}

Change the string $languages. For example, in Chinese:

} elseif( 'zh-hant' == == ICL_LANGUAGE_CODE ) { //chinese
    $language = "中文";
}

2) I fixed this problem. Now the flags are arranged according to the "Languages order" option in WPML > Languages.

3) Click on the WPML > Languages > Site Languages> Edit Languages. You can change the name of the desired languages.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Thank you.

November 25, 2014 at 11:47 pm #517863

pharaweeB

Dear Bruno,

Thank you for your best support, Could you please take a look the site is down!!
It's show "Parse error: syntax error, unexpected T_IS_EQUAL in /home/panacee57/domains/panacee.com/public_html/wp-content/themes/soulmedic/functions.php on line 63"

November 26, 2014 at 12:01 am #517870

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Done. Please let me know if your site is working as desired.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Thank you.

November 26, 2014 at 12:54 am #517887

pharaweeB

Thank you very much for your fast respond and supper support.

With Best Regards,

Pharawee Bij