I want my website to be in English and French, but I'm not sure how to make this happen. I have an excel spreadsheet with French translations for each English page in the site.
How to translations work? I would prefer to code it myself instead of using a plugin.
Thanks!
I want my website to be in English and French, but I'm not sure how to make this happen. I have an excel spreadsheet with French translations for each English page in the site.
How to translations work? I would prefer to code it myself instead of using a plugin.
Thanks!
Share Improve this question asked Aug 18, 2019 at 4:03 ellenellen 3451 gold badge5 silver badges16 bronze badges 3- 1 possible duplicate wordpress.stackexchange/a/222380/109616 – Makiomar Commented Aug 18, 2019 at 4:18
- 1 also here wordpress.stackexchange/a/117612/109616 – Makiomar Commented Aug 18, 2019 at 4:20
- Are you trying to translate a theme or the content of your website? – WSU Commented Aug 19, 2019 at 12:51
1 Answer
Reset to default 0I'd recommend you using Loco Translate plugin to create a translation.
If you are creating a theme, you should specify the Text Domain
and Domain Path
in your style.css
file.
/*
Theme Name: My Theme Name
Author: My Name
Author URI: http://sample.url
Description: Your theme description
Version: 1.0.0
Text Domain: mydomain
Domain Path: /lang
*/
Next, add some text in your theme.
<?php echo __( 'Hello there', 'mydomain' ); ?>
Then go to your wp-admin and you should find Hello there text
and translate it to any languages you wish.