pierre
asked 2 years ago

Hello,
 
how can we translate our website to french if there is not .pot file ?
DW Magz is a premium template, isn’t it ?
So there is no way to translate the template with, in example, Loco Translate..?
 
What is the solution ?
 
Regard.

5 Answers
DominicStaff
answered 2 years ago

Of course, you can use the loco translate plugin to translate the theme, DW Magz works fine with this plugin, Also, the loco Translate allows you create a .pot file

pierre
answered 2 years ago

Thank you.
But it is more complicated with DW Magz Child.
Can I use the original template DW Magz..?
Regard.

DominicStaff
answered 2 years ago

It is best to upload your translation files directly to your child theme /languages folder. Follow the steps below.

1. Create a languages folder in your child theme.
2. Use Loco translate to create translation files.
Find the .pot file in the /languages directory, which is located in the root of the parent theme folder. Use that .pot file in the Loco translate to create your .po and .mo translation files.
3. Edit child theme functions.php file.
Depending on your child theme, you may or may not have a functions.php file. If you do not, create it in the root of your child theme.
Add the following code to the functions.php file:

  function child_theme_slug_setup() {
  load_child_theme_textdomain( 'parent-theme-slug', get_stylesheet_directory() . '/languages' );
  }
  add_action( 'after_setup_theme', 'child_theme_slug_setup' );

4. Add your translation files.
Upload your .po and .mo files to the /wp-content/themes/child-theme/languages directory. If you do not have a /languages folder in your child theme, create it. The file names should follow this format: es_ES.po & es_ES.mo (example for Spanish translation). Your file names should not include the theme slug.
Your file names will use the text domain of the parent theme you are translating. So if you are translatingVendd to Spanish, your file paths would be /wp-content/themes/child-theme/languages/es_ES.po and /wp-content/themes/child-theme/languages/es_ES.mo.

pierre
replied 2 years ago

Hello, can we have help please…?

Regard.

Dominic Staff
replied 2 years ago

At the moment, I can not access your site to help you check this issue. Have you tried to select your language in the general setting of WordPress? If it does not help, you can let me know.

pierre
replied 2 years ago

Yes of course…
A majority of elements are in french. But apparently no these from the templates…like this one : “View all posts by”

Regard.

Dominic Staff
replied 2 years ago

Please send me your FTP, I will access and check it. I think you have removed your FTP account in another answer.

pierre
answered 2 years ago

Hello,

thank you very much for answer. It is great.

But..

I do everything you said, several times to be sure.

  • php files in the child template is ok
  • languages folder is ok
  • with fr_FR.po and fr_FR.mo in /wp-content/themes/dw-magz-child/languages

I tranlated this one : “View all posts by” > “Voir tous les articles de”
But no it is not working… I really don’t understand…
If you have a idea…?
Regard.

DominicStaff
answered 2 years ago

I have helped you resolve this issue, you can check your site now.

pierre
answered 2 years ago

Ahhh Fantastic !
Thank you very much for your help.
 
Just for my knowledge, what was the problem…? I done something wrong ?
 
Regard.

Dominic Staff
replied 2 years ago

You can open the functions.php file. Just changed the name of template to override languages files from child theme.

pierre
answered 2 years ago

Hello, we still have a last problem with the translation.
It is impossible to find the original text for
PREVIOUS ARTICLE (@left)
NEXT ARTICLE (@right)

We use Loco Translate, and didn’t find the right path.

If you have a idea it’ll be great.

Regard.

Dominic Staff
replied 2 years ago

I have helped you added the CSS code to the Custom CSS section of the Theme options, you can go to the Styling section to change it.
See the screenshot: http://prntscr.com/iap26o

pierre
answered 2 years ago

Hello,
 
it is better, BUT we have “article précédent” (previous article) on both side, left and right…
 
Do you have a idea to fix this bug ?
And why can we translate it with Loco Translate ?
Regard.

 

DominicStaff
answered 2 years ago

I have helped you resolve this issue, you can check your site now.

pierre
answered 2 years ago

OK, thank you very much.
I think it was the last bug. Template is ok now.
 
Thank you very much (but please take time to test your template) !
 
Have a nice day.
 
Regard.

Powered by DW Question & Answer Pro