Skip Navigation

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 10 replies, has 2 voices.

Last updated by Prosenjit Barman 1 year, 6 months ago.

Assisted by: Prosenjit Barman.

Author Posts
June 23, 2023 at 4:50 am #13881637

jackH-4

Tell us what you are trying to do?
I turned on automatic translation of the whole site but the main menu and drop downs are not translated. Some translated are also incorrect. How to fix the bad translations and do the menu properly?

Is there any documentation that you are following?

I tried to follow this but very difficult to follow
https://wpml.org/documentation/getting-started-guide/translating-menus/

What is the link to your site?
hidden link

June 23, 2023 at 12:45 pm #13884435

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support. I will try my best to assist you in this matter.

I have checked your site and found that the Menu items that you've added as "custom links" are only not showing translated. Those items should be available for Translation in the "WPML > String Translation" section. Would you please go there and complete the Translation of those two menu items?

Please check this documentation for more understanding: https://wpml.org/documentation/getting-started-guide/string-translation/

After adding the translation, the menu items will appear properly.

I have also noticed that two items under the "Collections" menu are not showing translated. Upon closer examination, I found that both of these items are product categories and have not been translated yet. That is why, the category name is not showing translated.

Please check this category: hidden link

You'll notice that the language switcher is showing one language only which is English. hat's because its translation is not available.

As you're using WooCommerce Multilingual plugin, please go to "WooCommerce > WooCommerce Multilingual > Categories" tab and complete the translation of both categories that you've added under the "Collections" menu.

The menu items will appear perfectly translated after following the instructions above. But, please let me know if you need further assistance in this matter. I will be happy to assist you.

Best Regards,
Prosenjit

June 23, 2023 at 7:40 pm #13887313

jackH-4

I have entered the translation for the main menu, but they don't show up. See attached.

The categories are fixed.

2023-06-23_152229.jpg
2023-06-23_152248.jpg
June 23, 2023 at 7:58 pm #13887377

jackH-4

I also see this in the Menu Sync section. Not sure what to do.

There is a text in the middle "Find Your Zodiac Animal" which came from a plug in. Where can this be found for translation?

2023-06-23_155651.jpg
June 24, 2023 at 1:56 am #13887835

jackH-4

The plugin right in the middle of the homepage "Find Your Zodiac Animal" is not translated.

Not sure where do I get them translated since I couldn't find them in the String Translation.

June 27, 2023 at 1:49 am #13898821

jackH-4

I managed to fix it by using the Menu and changed it manually.

Right now only the "Find Your Zodiac Animal" in the middle of the page is not translated. That plugin was made years ago and obviously not WPML compatible. I tried WPML localization and it returns 0 string.

I found the title was part of the php in that plugin. See attached. What can I do in this case?

zodiac finder php.jpg
June 27, 2023 at 3:25 am #13898917

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
I hope you're doing well. Sorry for the delay in responding due to the weekend.

Happy to see that you've managed to find out a way to translate the menu items in the meantime.

Regarding the issue with translating "Find Your Zodiac Animal"- Based on the screenshot of the code you've shared earlier, I can see that the translation support(getText function) is missing from that specific text. The localization feature of WPML can retrieve the translatable strings only if translation support is added to the String.

To learn more about localizing text or adding translation support, you can refer to the documentation provided below.

- https://wpml.org/documentation/support/translating-the-theme-you-created/#using-gettext-functions-in-php

Since the translation support isn't added to the text, it can't be translatable from the String Translation. It is better to reach out to the plugin author and request them to add the proper translation support for the static text within the plugin. As they are currently not compatible with WPML, you can also request them to join the Go-global Program of WPML. Check the link below to know more about this program.

- https://wpml.org/documentation/support/go-global-program/

For now, the only way to translate that text is by taking a manual approach. Switch to the Chinese language, open the Chinese page in the Editor, and add the Translation for that specific content.

However, I can see that the text is now appearing translated in the Chinese version of the Homepage. But, if you need any further assistance, feel free to let me know. I will be happy to assist you.

Best Regards,
Prosenjit

June 27, 2023 at 4:00 am #13898929

jackH-4

Unfortunately, that was a custom plugin. The plugin designer is no longer reachable. There are only a few text that need to be translatable. Is this something that can be easily modified on that php file?

Right now the text is done by css which is not really ideal. Because if you select the dates, and click Find, it still goes to English result.

I am not sure what you mean by "Switch to the Chinese language, open the Chinese page in the Editor, and add the Translation for that specific content. "? There is a php and also javascript as well. Are you saying if I change the language setting on top, it will keep two copies of the same php and javascript but with different languages?

June 28, 2023 at 6:31 am #13906927

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,

If the plugin contains the necessary elements for localization, like Text-domain, then you can make any text within the plugin translatable by wrapping the text within the getText function. The entire procedure is mentioned in the documentation below.

- https://wpml.org/documentation/support/translating-the-theme-you-created/#using-gettext-functions-in-php

However, I have checked but haven't found that plugin online. Based on the version and availability, I'm assuming that the translation support isn't been added to the code.

Please note that the solution I suggested in my previous response is applicable only if you added the text above the date from the Editor. Let me clarify the process for you again.

- Please go to the "Pages > All Pages" section.
- Select "Chinese" language from the language switcher on the top bar of the Admin
- Locate the Homepage and open in the Editor.
- If you have the option to add the text from the Editor, then add the Chinese Text there.

But, if the entire feature is custom coded, then the text will not appear translated until the required translation support is added to the code. You can add the internationalization support for the plugin by following the documentation below by WordPress.

- https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/

As providing support for the custom-coded themes or plugins is beyond the scope of our support, you can also hire a professional to solve the issues from here: https://wpml.org/contractor

Please let me know if there is anything else if you need help with.

Best Regards,
Prosenjit

June 30, 2023 at 3:23 am #13920777

jackH-4

There no option to simply edit the Chinese homepage. That plugin is a simple short code.

Within the plugin, the 2 lines that needs translation are in this

add_shortcode( 'ZodiacFinder', 'showZodiacContainer' );
function showZodiacContainer( ) {
	
	$love_text = '<div id="datepicker-home">
					  <div class="datepicker-content">
					    <div id="zodiac-result"></div>
					    <div id="zodiac-date-group">
					      <p id="zodiacTitle">Find Your Zodiac Animal</p>
					      <p id="zodiacSubTitle">Zodiac years end in January or February</p>
					      <div class="date-main">
					        <form id="zodiacForm" name="birthdayForm" autocomplete="off">
					          <table>
					            <tbody>
					              <tr>
					                <td><select id="monthSelector" name="month">
					                  <option selected="selected" value="">
					                    MM
					                  </option>
					                  <option value="1">
					                    1
					                  </option>
					                  <option value="2">
					                    2
					                  </option>
					                  <option value="3">
					                    3
					                  </option>
					                  <option value="4">
					                    4
					                  </option>
					                  <option value="5">
					                    5
					                  </option>
					                  <option value="6">
					                    6
					                  </option>
					                  <option value="7">
					                    7
					                  </option>
					                  <option value="8">
					                    8
					                  </option>
					                  <option value="9">
					                    9
					                  </option>
					                  <option value="10">
					                    10
					                  </option>
					                  <option value="11">
					                    11
					                  </option>
					                  <option value="12">
					                    12
					                  </option>
					                </select></td>
					                <td><select id="daySelector" name="day">
					                  <option selected="selected" value="">
					                    DD
					                  </option>
					                  <option value="1">
					                    1
					                  </option>
					                  <option value="2">
					                    2
					                  </option>
					                  <option value="3">
					                    3
					                  </option>
					                  <option value="4">
					                    4
					                  </option>
					                  <option value="5">
					                    5
					                  </option>
					                  <option value="6">
					                    6
					                  </option>
					                  <option value="7">
					                    7
					                  </option>
					                  <option value="8">
					                    8
					                  </option>
					                  <option value="9">
					                    9
					                  </option>
					                  <option value="10">
					                    10
					                  </option>
					                  <option value="11">
					                    11
					                  </option>
					                  <option value="12">
					                    12
					                  </option>
					                  <option value="13">
					                    13
					                  </option>
					                  <option value="14">
					                    14
					                  </option>
					                  <option value="15">
					                    15
					                  </option>
					                  <option value="16">
					                    16
					                  </option>
					                  <option value="17">
					                    17
					                  </option>
					                  <option value="18">
					                    18
					                  </option>
					                  <option value="19">
					                    19
					                  </option>
					                  <option value="20">
					                    20
					                  </option>
					                  <option value="21">
					                    21
					                  </option>
					                  <option value="22">
					                    22
					                  </option>
					                  <option value="23">
					                    23
					                  </option>
					                  <option value="24">
					                    24
					                  </option>
					                  <option value="25">
					                    25
					                  </option>
					                  <option value="26">
					                    26
					                  </option>
					                  <option value="27">
					                    27
					                  </option>
					                  <option value="28">
					                    28
					                  </option>
					                  <option value="29">
					                    29
					                  </option>
					                  <option value="30">
					                    30
					                  </option>
					                  <option value="31">
					                    31
					                  </option>
					                </select></td>
					                <td><select id="yearSelector" name="year">
					                  <option selected="selected" value="">
					                    YYYY
					                  </option>
                                                          <option value="2020">
					                    2020
					                  </option>
                                                          <option value="2019">
					                    2019
					                  </option>
					                  <option value="2018">
					                    2018
					                  </option>
					                  <option value="2017">
					                    2017
					                  </option>
					                  <option value="2016">
					                    2016
					                  </option>
					                  <option value="2015">
					                    2015
					                  </option>
					                  <option value="2014">
					                    2014
					                  </option>
					                  <option value="2013">
					                    2013
					                  </option>
					                  <option value="2012">
					                    2012
					                  </option>
					                  <option value="2011">
					                    2011
					                  </option>
					                  <option value="2010">
					                    2010
					                  </option>
					                  <option value="2009">
					                    2009
					                  </option>
					                  <option value="2008">
					                    2008
					                  </option>
					                  <option value="2007">
					                    2007
					                  </option>
					                  <option value="2006">
					                    2006
					                  </option>
					                  <option value="2005">
					                    2005
					                  </option>
					                  <option value="2004">
					                    2004
					                  </option>
					                  <option value="2003">
					                    2003
					                  </option>
					                  <option value="2002">
					                    2002
					                  </option>
					                  <option value="2001">
					                    2001
					                  </option>
					                  <option value="2000">
					                    2000
					                  </option>
					                  <option value="1999">
					                    1999
					                  </option>
					                  <option value="1998">
					                    1998
					                  </option>
					                  <option value="1997">
					                    1997
					                  </option>
					                  <option value="1996">
					                    1996
					                  </option>
					                  <option value="1995">
					                    1995
					                  </option>
					                  <option value="1994">
					                    1994
					                  </option>
					                  <option value="1993">
					                    1993
					                  </option>
					                  <option value="1992">
					                    1992
					                  </option>
					                  <option value="1991">
					                    1991
					                  </option>
					                  <option value="1990">
					                    1990
					                  </option>
					                  <option value="1989">
					                    1989
					                  </option>
					                  <option value="1988">
					                    1988
					                  </option>
					                  <option value="1987">
					                    1987
					                  </option>
					                  <option value="1986">
					                    1986
					                  </option>
					                  <option value="1985">
					                    1985
					                  </option>
					                  <option value="1984">
					                    1984
					                  </option>
					                  <option value="1983">
					                    1983
					                  </option>
					                  <option value="1982">
					                    1982
					                  </option>
					                  <option value="1981">
					                    1981
					                  </option>
					                  <option value="1980">
					                    1980
					                  </option>
					                  <option value="1979">
					                    1979
					                  </option>
					                  <option value="1978">
					                    1978
					                  </option>
					                  <option value="1977">
					                    1977
					                  </option>
					                  <option value="1976">
					                    1976
					                  </option>
					                  <option value="1975">
					                    1975
					                  </option>
					                  <option value="1974">
					                    1974
					                  </option>
					                  <option value="1973">
					                    1973
					                  </option>
					                  <option value="1972">
					                    1972
					                  </option>
					                  <option value="1971">
					                    1971
					                  </option>
					                  <option value="1970">
					                    1970
					                  </option>
					                  <option value="1969">
					                    1969
					                  </option>
					                  <option value="1968">
					                    1968
					                  </option>
					                  <option value="1967">
					                    1967
					                  </option>
					                  <option value="1966">
					                    1966
					                  </option>
					                  <option value="1965">
					                    1965
					                  </option>
					                  <option value="1964">
					                    1964
					                  </option>
					                  <option value="1963">
					                    1963
					                  </option>
					                  <option value="1962">
					                    1962
					                  </option>
					                  <option value="1961">
					                    1961
					                  </option>
					                  <option value="1960">
					                    1960
					                  </option>
					                  <option value="1959">
					                    1959
					                  </option>
					                  <option value="1958">
					                    1958
					                  </option>
					                  <option value="1957">
					                    1957
					                  </option>
					                  <option value="1956">
					                    1956
					                  </option>
					                  <option value="1955">
					                    1955
					                  </option>
					                  <option value="1954">
					                    1954
					                  </option>
					                  <option value="1953">
					                    1953
					                  </option>
					                  <option value="1952">
					                    1952
					                  </option>
					                  <option value="1951">
					                    1951
					                  </option>
					                  <option value="1950">
					                    1950
					                  </option>
					                  <option value="1949">
					                    1949
					                  </option>
					                  <option value="1948">
					                    1948
					                  </option>
					                  <option value="1947">
					                    1947
					                  </option>
					                  <option value="1946">
					                    1946
					                  </option>
					                  <option value="1945">
					                    1945
					                  </option>
					                  <option value="1944">
					                    1944
					                  </option>
					                  <option value="1943">
					                    1943
					                  </option>
					                  <option value="1942">
					                    1942
					                  </option>
					                  <option value="1941">
					                    1941
					                  </option>
					                  <option value="1940">
					                    1940
					                  </option>
					                  <option value="1939">
					                    1939
					                  </option>
					                  <option value="1938">
					                    1938
					                  </option>
					                  <option value="1937">
					                    1937
					                  </option>
					                  <option value="1936">
					                    1936
					                  </option>
					                  <option value="1935">
					                    1935
					                  </option>
					                  <option value="1934">
					                    1934
					                  </option>
					                  <option value="1933">
					                    1933
					                  </option>
					                  <option value="1932">
					                    1932
					                  </option>
					                  <option value="1931">
					                    1931
					                  </option>
					                  <option value="1930">
					                    1930
					                  </option>
					                  <option value="1929">
					                    1929
					                  </option>
					                  <option value="1928">
					                    1928
					                  </option>
					                  <option value="1927">
					                    1927
					                  </option>
					                  <option value="1926">
					                    1926
					                  </option>
					                  <option value="1925">
					                    1925
					                  </option>
					                  <option value="1924">
					                    1924
					                  </option>
					                  <option value="1923">
					                    1923
					                  </option>
					                  <option value="1922">
					                    1922
					                  </option>
					                  <option value="1921">
					                    1921
					                  </option>
					                  <option value="1920">
					                    1920
					                  </option>
					                  <option value="1919">
					                    1919
					                  </option>
					                  <option value="1918">
					                    1918
					                  </option>
					                  <option value="1917">
					                    1917
					                  </option>
					                  <option value="1916">
					                    1916
					                  </option>
					                  <option value="1915">
					                    1915
					                  </option>
					                  <option value="1914">
					                    1914
					                  </option>
					                  <option value="1913">
					                    1913
					                  </option>
					                  <option value="1912">
					                    1912
					                  </option>
					                  <option value="1911">
					                    1911
					                  </option>
					                  <option value="1910">
					                    1910
					                  </option>
					                  <option value="1909">
					                    1909
					                  </option>
					                  <option value="1908">
					                    1908
					                  </option>
					                  <option value="1907">
					                    1907
					                  </option>
					                  <option value="1906">
					                    1906
					                  </option>
					                  <option value="1905">
					                    1905
					                  </option>
					                  <option value="1904">
					                    1904
					                  </option>
					                  <option value="1903">
					                    1903
					                  </option>
					                  <option value="1902">
					                    1902
					                  </option>
					                  <option value="1901">
					                    1901
					                  </option>
					                  <option value="1900">
					                    1900
					                  </option>
					                </select></td>
					              </tr>
					            </tbody>
					          </table>
					        </form>
					        <button id="zodiac-submit" onclick="JavaScript:zodiacFinder()">find</button><br>
					        <script src="/wp-content/plugins/zodiac_finder/zodiacFinder.js" type="text/javascript">
					        </script><br>
					        <script type="text/javascript">
					        zodiacFinder();
					        </script><br>
					        <script language="javascript">
					        function dismiss(){
					        setTimeout(function(){document.getElementById("zodiac-result").style.opacity="0"},100);
					        setTimeout(function(){document.getElementById("zodiac-result").style.display="none"},200);
					        setTimeout(function(){document.getElementById("zodiac-date-group").style.display="block"},300);
					        setTimeout(function(){document.getElementById("zodiac-date-group").style.opacity="1"},400);
					        }
					        </script>
					      </div>
					    </div>
					  </div>
					</div>';
	
	return $love_text;
}

How do I replace the text "Find Your Zodiac Animal" in the code with this?

__( 'Find Your Zodiac Animal', 'zodiac_finder' );

to make it translatable?

July 3, 2023 at 3:30 am #13930147

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
I hope you're doing well. Sorry for the delay in responding due to the Weekend.

To replace the hard-coded text with the code with the text domain, you need to locate which file within the plugin contains the text ‘Find Your Zodiac Animal’. After locating the file, remove the hard-coded text within the paragraph tag (<p>) and replace it with the code.

There is no information about this plugin or its codebase available on the internet. This is why, it is difficult to precisely point to the file that consists of the text. So, kindly check the code of the plugin properly and I hope you'll find the file.

After properly placing the code, you have to scan the plugin for strings by following the documentation below.

- https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/#scanning-the-theme-and-plugins

This operation will fetch all the translatable strings and store them in the "WPML > String Translation" section. You'll be able to add the translation for that string right after that.

Please note that providing support for custom-coded themes or plugins falls outside the scope of our support. However, we will do our best to offer suggestions or feedback on the code if we have any. But, if the custom-coded plugin or theme is blocking your work, then it is recommended to reach out to the author first and ask for their suggestions. Otherwise, you can hire a professional developer to resolve the issue from here: https://wpml.org/contractor

Let me know if there is anything else you need help with. I will be happy to assist you.

Best Regards,
Prosenjit