Home › Forums › Basel support forum › Close Button translation
Close Button translation
- This topic has 9 replies, 4 voices, and was last updated 6 years, 10 months ago by
Eric Watson.
-
AuthorPosts
-
April 4, 2018 at 4:24 pm #50856
Majed-ROParticipantHi guys,
When I click on “compare” button in the product page, a popup windows appears with big “close” button below it.
I want to know where I can translate this button. I tried to translate all “close” strings in the basel.po file with no effect.Anyone has a clue?
Thanks
April 4, 2018 at 7:13 pm #50882
Elise NoromitMemberHello,
Do you use WPML or just want to rewrite?
Best Regards
April 4, 2018 at 7:43 pm #50888
Majed-ROParticipantNo, I don’t use WPML. I use loco translator. By the way, I noticed this modal window related to jquery colorbox and thus it may need some customization in js files ( I hope not )
April 5, 2018 at 7:05 am #50928
Artem TemosKeymasterHello,
We investigated this issue and noticed a bug in the compare plugin. This word can’t be translated with the Loco Translate plugin. You can do this manually editing a file
plugins/yith-woocommerce-compare/includes/class.yith-woocompare-frontend.php
http://prntscr.com/j13qipApril 5, 2018 at 12:17 pm #50987
Majed-ROParticipantThank you.
I have solved this issue, and I will write it down for others who would like to do the same.
First, this string is located in : plugins/yith-woocommerce-compare/includes/class.yith-woocompare-frontend.php
line 213
‘close_label’ => _x( ‘Close’, ‘Label for popup close icon’, ‘yith-woocommerce-compare’ )note the function _x() needs 3 parameters, the second is the context. And the generated po file by Loco plugin doesn’t have the context lines, so you will tweak one line to make it work.
Steps:
1- open the Poedit software. open the plugin translation file (yith-woocommerce-compare-<your_language_letters>.po). Go to Catalog, then properties , then click on Sources Keywords tab.
here you should edit values as follows:
__
_e
_n:1,2
_x:1,2c
_ex:1,2cSave and close.
2- Edit the previous file by any editor ( yith-woocommerce-compare-<your_language_letters>.po ). and go to this line:
#: ../includes/class.yith-woocompare-frontend.php:213
msgid “Close”
msgstr “إغلاق”and replace it by:
#: ../includes/class.yith-woocompare-frontend.php:213
msgctxt “Label for popup close icon”
msgid “Close”
msgstr “إغلاق”3- Now you have to compile the file to MO extension by opening the same file by Poedit then save or File -> compile to MO
4- upload the file to wp-content/languages/loco/plugins
That’s it.
April 5, 2018 at 1:17 pm #51004
Artem TemosKeymasterHello,
Thank you for sharing your solution here!
Kind Regards
May 2, 2018 at 10:36 pm #55747
Majed-ROParticipantBy the way, there is a bug in Basel theme realted to the same issue:
File: inc/template-tags.php
line: 1251Instead of esc_attr__ , it should be esc_attr_x
May 3, 2018 at 7:11 am #55770
Eric WatsonParticipantHello,
Could you please explain in more detail about which bug you are talking about and provide a screenshot of the code.
Kind Regards
XTemos StudioMay 3, 2018 at 12:19 pm #55830
Majed-ROParticipantPlease see the attached screenshots, one for the code, and another for the frontend.
I noticed, when translating the .po file which related to “Search for products”, it will not show up in the frontend. After I changed the function from esc_attr__ to esc_attr_x , it works fine.
Thank you.
Attachments:
You must be logged in to view attached files.May 3, 2018 at 1:03 pm #55840
Eric WatsonParticipantHi,
OK, thank you. We will definitely add this fix in our next update.
Best Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register