Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › .mo and .po files in a child theme
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › .mo and .po files in a child theme
- This topic has 30 replies, 7 voices, and was last updated 10 years by Swift Ideas – Ed.
-
Posted in: Neighborhood
-
September 19, 2014 at 5:54 pm #112753
Hi,
How can I set the .mo and .po files (in french for instance) in the child theme?
Because everytime there is an upgrade of the theme, I have to re-upload my .po and .mo files, and it’s quite annoying :/By the way, can I do the same thing with the language files of the woocommerce plugin (I mean in the child theme)?
Also, I have a problem with a traduction somewhere in the site.
For instance : http://librairie-sel.com/panier/
The site is in french, so you should read “Votre panier est vide” instead of “Your shopping bag is empty”. I did verify this sentence in the .po file and the traduction is correct, but on the site you can see “Your shopping gag is empty” (it’s not bag but gag I precise).The phrase below is in the same case, and when there is an article in the shopping bag, the “update shopping bag” link isn’t traduced either (and I looked in the .po file and it IS traduced).
There’s also other kinds of issues somewhere else, but I won’t tell you all of them because they maybe come from the same problem.Thank you
September 19, 2014 at 6:23 pm #112765Hi,
Please create a βlanguagesβ folder in the child theme, where you need to upload the po and mo files. After that create a functions.php file in the child theme and added this code:<?php function neighborhood_child_setup() { load_child_theme_textdomain( 'swiftframework', get_stylesheet_directory() . '/languages' ); } add_action( 'after_setup_theme', 'neighborhood_child_setup' ); ?>
Hope that should help to you.
Thanks π
With Best Regards
MohammadSeptember 19, 2014 at 8:07 pm #112781Hi,
Thank you, this is great!
Now, I would like to apply this to the woocommerce plugin, is it possible?
And I also have the issues I told you with the translation errors (excuse me, I said “traduction” instead of “translation”, it’s the french word).September 20, 2014 at 2:30 pm #112918Hi,
You dont need woocommerce translation because theme overrides woocommerce template files and translation. I am not getting your translation issue so please explain with marked screenshot.Thanks π
With Best Regards
MohammadSeptember 21, 2014 at 8:57 am #112975What helped me with the same issue
I deleted all the foreign language files that I do not use from ALL the Language folders:
wp-content / languages
wp-content / languages / themesthen also:
wp-content / themes / neighborhood / languagesafter that I created Languages folder to my child theme and uploaded my translated .mo and .po files there
then I added function.php like mentioned here above and my site is translated like I wished!
September 21, 2014 at 9:36 am #112980Thanks @karel to sharing this information.
Thanks π
With Best Regards
MohammadSeptember 21, 2014 at 9:52 am #112984Hi,
Thanks @karel, but it already worked for me with the code of Mohammad π
To @Mohammad :
Here’s the link of the page http://librairie-sel.com/panier/I’ve put three screenshots for you to see the translation errors (I precise again that all of these expressions are translated in the .po file)
Attachments:
You must be logged in to view attached files.September 21, 2014 at 10:15 am #112992what is the still existing problem is, that SOME PART of the Woocommerce translation is somehow overridden by theme language files or something else – please see attached picture
red color marks some random pharses which are not translated by woocommerce like others
i tried to remove all woocommerce related pharses from language file and disabled functions.php, but it did not helped with this
normal situation would be, that woocommerce would translate ALL pharses to choosen language – which is not happening now
Attachments:
You must be logged in to view attached files.September 22, 2014 at 1:26 pm #113304Hi,
Please edit untranslated string again in .po file. Now you will have new .po and .mo files so upload these files at your website again. Because some times .mo file is not updated.
ThanksSeptember 23, 2014 at 1:02 am #113499Thank you, this thread solved my problem about .mo files in child theme.
September 23, 2014 at 3:36 am #113523@westcoastsurf – I am glad that your issue resolved.
Thanks π
With Best Regards
MohammadSeptember 23, 2014 at 8:47 am #113594Hi,
Still not solved for me π
September 23, 2014 at 9:03 am #113602This reply has been marked as private.September 23, 2014 at 5:00 pm #113839I’ve looked at this documentation, but I’ve done everything it says.
Is there a way to give you my translation in french (it’s not complete at all and it doesn’t translate more than the front-office) so that it’s included in the next release ?Because I still can’t understand what is wrong with my site, and it would surely be helpful for other french.
September 24, 2014 at 10:04 am #114012This reply has been marked as private. -
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.