Home › Forums › WoodMart support forum › Translation issue
Translation issue
- This topic has 11 replies, 3 voices, and was last updated 3 years, 4 months ago by
Elise Noromit.
-
AuthorPosts
-
October 22, 2021 at 2:12 pm #327016
tgParticipantHello!
We’re having a translation issue on our site. I’ve created a translation file based on the provided .pot file via PoEdit and uploaded it to the Woodmart child theme. It is working on most pages but once I open a category page the menu text is back to english. From what I can see the div class name is the same for the main page and any category page:
<span class="menu-open-label"> <?php esc_html_e( 'Browse Categories', 'woodmart' ); ?> </span>
Could you please advise why the translation isn’t loaded on category pages?
Thanks
StefanAttachments:
You must be logged in to view attached files.October 22, 2021 at 2:22 pm #327020
tgParticipantHere are some more labels that aren’t translated:
<div class="wd-filter-buttons wd-action-btn wd-style-text wd-filter-icon<?php echo woodmart_get_old_classes( ' woodmart-filter-buttons' ); ?>"> <a href="#" rel="nofollow" class="open-filters"><?php esc_html_e( 'Filters', 'woodmart' ); ?></a> </div>
<span class="per-page-title"> <?php esc_html_e( 'Show', 'woodmart' ); ?> </span>
October 22, 2021 at 2:36 pm #327025
Elise NoromitMemberHello,
Thank you very much for choosing our theme and for contacting us.
In order to translate the Woocommerce strings, you need to create a separate translation.
We would recommend using the Loco plugin.
You can translate/rewrite all theme and plugin texts via PO file in WordPress. Here is a video tutorial that should help you translate your website texts with a Loco Translate plugin https://www.youtube.com/watch?v=D3NsDdMzsls&list=PLMw6W4rAaOgKKv0oexGHzpWBg1imvrval&index=3
Please check the video tutorial to see how to save the translation file correctly. You can remove the plugin and translations would remain. Also, translations would remain after each theme update.
In order to translate the Woocommerce strings, you need to create a separate translation in Loco > Plugins > Woocommerce in the same way as shown in the video.
Best Regards
October 22, 2021 at 2:47 pm #327026
tgParticipantIn order to translate the Woocommerce strings, you need to create a separate translation.
As I wrote earlier, that’s exactly what I did via PoEdit. And the translations are working as they should on most pages but not on a category page.
October 22, 2021 at 11:19 pm #327075
Elise NoromitMemberHello,
As per your screen, you are trying to translate the contact form, in this case, you should create the translation for this plugin.
Each theme, each plugin are translated separately.
Best Regards
October 23, 2021 at 7:07 pm #327173
tgParticipantHello!
The first screenshot was the wrong attachment (as I wrote in the change note during the edit). Please see the screenshots attached to this post.
The first (startpage.png) shows the strings correctly translated.
The second (categorypage.png) shows a category page where the strings are partially untranslated.As per the code posted above the classes and strings are the same for both pages and are translated in the .mo file.
Attachments:
You must be logged in to view attached files.October 23, 2021 at 7:55 pm #327192
Elise NoromitMemberHello,
This string shows that these two strings are not translated, please synchronize the translation and try again.
Best Regards
October 23, 2021 at 8:04 pm #327195
tgParticipantAgain: We’re not using Loco Translate – there is nothing to synchronize.
And as you can clearly see on the start page the strings are properly translated.Additionally I’ve attached screenshot from the translation.
Attachments:
You must be logged in to view attached files.October 24, 2021 at 1:37 pm #327240
Elise NoromitMemberHello,
Please contact the support of the plugin that you use for the traslation. We recommend using Loco as there is no problem provided the translation has been properly created and saved.
WoodMart theem has all the files ready for the transaltion and for multilanguage site and the theme does not influence the performance of the translation plugins.
Best Regards
October 24, 2021 at 2:24 pm #327247
tgParticipantHello,
I get the feeling you don’t want to support what you sell. You’re not reading the information I provide and suggest “solutions” that don’t even apply to our issue.
PoEdit is not a plugin but a tool for creating .po / .mo files. I’ve used it to translate every other webpage I created / support and never had any issues with the translations.
The files are created correctly by PoEdit and working on the start page, contact page, other created pages. The issue only arises on category pages.But since you don’t see any other solutions but a third party plugin that does exactly the same:
I’ve installed Loco translate and translated the problematic entries. Surprise: The exact same issue is present here as well.If anyone else runs into this issue, I got the solution for you. Add the following code to your
woodmart-child/functions.php
:function woodmart_lang_setup() { $lang = get_stylesheet_directory() . '/languages'; load_child_theme_textdomain( 'woodmart', $lang ); } add_action( 'after_setup_theme', 'woodmart_lang_setup' );
This will load the language files properly from the child theme. I didn’t dig deeper though why the translations are loaded on some pages such as the start page but not on others.
October 24, 2021 at 3:30 pm #327261
LokalfuxParticipantHi,
ich nutze die Software Notepad++, um keine unnötigen Plugins zu installieren…
damit öffne ich die woodmart de_De Datei per ftp und bearbeite diese… abspeichern fertig…Gruß, Klaus
October 25, 2021 at 10:23 am #327404
Elise NoromitMemberHello tg,
We are glad you have solved the issue. Just for your information, you should have translated the parent theme files not the child theme.
If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
Tagged: translation menu
- You must be logged in to create new topics. Login / Register