{"id":4977,"date":"2021-04-12T14:20:34","date_gmt":"2021-04-12T14:20:34","guid":{"rendered":"https:\/\/essentials.pixfort.com\/knowledge-base\/?p=4977"},"modified":"2022-04-07T19:11:40","modified_gmt":"2022-04-07T19:11:40","slug":"how-to-translate-the-theme-from-the-child-theme","status":"publish","type":"post","link":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/","title":{"rendered":"How to translate the theme from the child theme"},"content":{"rendered":"\n

Essentials theme is translation-ready. The theme includes a \/languages<\/code> directory in the root and a .pot<\/em> that includes all strings that are ready for translation.<\/p>\n\n\n\n

The typical way to translate a WordPress theme requires that you use .po<\/em> and .mo<\/em> files in the \/languages<\/code> directory of the theme. However, if you make any edits to a parent theme, including adding translation files to the theme, your edits will be overwritten (and completely lost) once the theme is updated. So this is not a good method.<\/p>\n\n\n\n

Instead, it is best to upload your translation files directly to your child theme \/languages<\/code> folder. Follow the steps below.<\/p>\n\n\n\n

1. Use Poedit (or similar tool) to create translation files.<\/strong><\/p>\n\n\n\n

Find the needed .pot<\/em> file in the \/languages<\/code> directory, which is located in the root of essentials theme folder. Use that .pot<\/em> file in a translation tool like Poedit<\/a> to create your .po<\/em> and .mo<\/em> translation files.<\/p>\n\n\n\n

2. Edit child theme functions.php file.<\/strong><\/p>\n\n\n\n

Add the following code to the functions.php<\/em> file:<\/p>\n\n\n\n

function child_theme_slug_setup() {\n   load_child_theme_textdomain( 'essentials', get_stylesheet_directory() . '\/languages' );\n}\nadd_action( 'after_setup_theme', 'child_theme_slug_setup' );<\/code><\/pre>\n\n\n\n

3. Add your translation files.<\/strong><\/p>\n\n\n\n

Upload your .po<\/em> and .mo<\/em> files to the \/wp-content\/themes\/essentials-child\/languages<\/code> directory. If you do not have a \/languages<\/code> folder in your child theme, create it. The file names should follow this format: fr_FR.po<\/code> & fr_FR.mo<\/code> (example for French translation). Your file names should not<\/em><\/strong> include the theme slug.<\/p>\n\n\n\n

<\/p>\n\n\n\n

Translating pixfort core plugin<\/strong> (Optional):<\/strong><\/p>\n\n\n\n

Add the following code to the functions.php<\/em> file:<\/p>\n\n\n\n

function child_theme_plugin_slug_setup() {\n   load_child_theme_textdomain( 'pixfort-core', get_stylesheet_directory() . '\/languages' );\n}\nadd_action( 'after_setup_theme', 'child_theme_plugin_slug_setup' );<\/code><\/pre>\n\n\n\n

To translate pixfort core<\/strong> plugin you should translate the .pot file of the plugin which you can find in the plugin directory inside the \/languages<\/code> directory, after that add the .mo<\/code> & .po<\/code> translation files into the same \/languages<\/code> directory in the child theme, the translation files of the plugins should have the plugin name as a prefix, for example pixfort core<\/strong> translation files names (for French language) should be pixfort-core-fr_FR.mo<\/code> & pixfort-core-fr_FR.mo<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"Essentials theme is translation-ready. The theme includes a \/languages directory in the root and a .pot that includes all strings that are ready for translation. The typical way to translate a WordPress theme requires that you use .po and .mo files in the \/languages directory of the theme. However, if…","protected":false},"author":1,"featured_media":4998,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42],"tags":[225,224,222,186,223,228,226,168,227],"yoast_head":"\nHow to translate the theme from the child theme - Essentials Knowledge base<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to translate the theme from the child theme - Essentials Knowledge base\" \/>\n<meta property=\"og:description\" content=\"Essentials theme is translation-ready. The theme includes a \/languages directory in the root and a .pot that includes all strings that are ready for translation. The typical way to translate a WordPress theme requires that you use .po and .mo files in the \/languages directory of the theme. However, if...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/\" \/>\n<meta property=\"og:site_name\" content=\"Essentials Knowledge base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pixfort\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-12T14:20:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-07T19:11:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2021\/04\/translate-theme-from-child-theme.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"800\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"pixfort\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pixfort\" \/>\n<meta name=\"twitter:site\" content=\"@pixfort\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pixfort\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/\"},\"author\":{\"name\":\"pixfort\",\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/#\/schema\/person\/ce28d19c64aa87116b0fc2685df067b6\"},\"headline\":\"How to translate the theme from the child theme\",\"datePublished\":\"2021-04-12T14:20:34+00:00\",\"dateModified\":\"2022-04-07T19:11:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/\"},\"wordCount\":343,\"publisher\":{\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/#organization\"},\"image\":{\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2021\/04\/translate-theme-from-child-theme.png\",\"keywords\":[\".mo\",\".po\",\"child theme\",\"code\",\"languages\",\"manual\",\"textdomain\",\"translate\",\"translation\"],\"articleSection\":[\"Advanced\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/\",\"url\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/\",\"name\":\"How to translate the theme from the child theme - Essentials Knowledge base\",\"isPartOf\":{\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2021\/04\/translate-theme-from-child-theme.png\",\"datePublished\":\"2021-04-12T14:20:34+00:00\",\"dateModified\":\"2022-04-07T19:11:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#primaryimage\",\"url\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2021\/04\/translate-theme-from-child-theme.png\",\"contentUrl\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2021\/04\/translate-theme-from-child-theme.png\",\"width\":1200,\"height\":800},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to translate the theme from the child theme\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/#website\",\"url\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/\",\"name\":\"Essentials Knowledge base\",\"description\":\"made by pixfort\",\"publisher\":{\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/#organization\",\"name\":\"pixfort\",\"url\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2020\/07\/support-logo-dark-clean.png\",\"contentUrl\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2020\/07\/support-logo-dark-clean.png\",\"width\":322,\"height\":110,\"caption\":\"pixfort\"},\"image\":{\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/pixfort\",\"https:\/\/twitter.com\/pixfort\",\"https:\/\/www.instagram.com\/pixfort\/\",\"https:\/\/www.linkedin.com\/company\/pixfort\",\"https:\/\/www.youtube.com\/c\/Pixfort\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/#\/schema\/person\/ce28d19c64aa87116b0fc2685df067b6\",\"name\":\"pixfort\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f5c4155e987c6ab4b3e8278828fe024c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f5c4155e987c6ab4b3e8278828fe024c?s=96&d=mm&r=g\",\"caption\":\"pixfort\"},\"description\":\"Hey, this is pixfort support team, if you still need help you can always reach us via the chat messenger in your account on pixfort hub\",\"sameAs\":[\"http:\/\/hub.pixfort.com\"],\"url\":\"https:\/\/essentials.pixfort.com\/knowledge-base\/author\/pixfort\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to translate the theme from the child theme - Essentials Knowledge base","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/","og_locale":"en_US","og_type":"article","og_title":"How to translate the theme from the child theme - Essentials Knowledge base","og_description":"Essentials theme is translation-ready. The theme includes a \/languages directory in the root and a .pot that includes all strings that are ready for translation. The typical way to translate a WordPress theme requires that you use .po and .mo files in the \/languages directory of the theme. However, if...","og_url":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/","og_site_name":"Essentials Knowledge base","article_publisher":"https:\/\/www.facebook.com\/pixfort","article_published_time":"2021-04-12T14:20:34+00:00","article_modified_time":"2022-04-07T19:11:40+00:00","og_image":[{"width":1200,"height":800,"url":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2021\/04\/translate-theme-from-child-theme.png","type":"image\/png"}],"author":"pixfort","twitter_card":"summary_large_image","twitter_creator":"@pixfort","twitter_site":"@pixfort","twitter_misc":{"Written by":"pixfort","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#article","isPartOf":{"@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/"},"author":{"name":"pixfort","@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/#\/schema\/person\/ce28d19c64aa87116b0fc2685df067b6"},"headline":"How to translate the theme from the child theme","datePublished":"2021-04-12T14:20:34+00:00","dateModified":"2022-04-07T19:11:40+00:00","mainEntityOfPage":{"@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/"},"wordCount":343,"publisher":{"@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/#organization"},"image":{"@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#primaryimage"},"thumbnailUrl":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2021\/04\/translate-theme-from-child-theme.png","keywords":[".mo",".po","child theme","code","languages","manual","textdomain","translate","translation"],"articleSection":["Advanced"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/","url":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/","name":"How to translate the theme from the child theme - Essentials Knowledge base","isPartOf":{"@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/#website"},"primaryImageOfPage":{"@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#primaryimage"},"image":{"@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#primaryimage"},"thumbnailUrl":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2021\/04\/translate-theme-from-child-theme.png","datePublished":"2021-04-12T14:20:34+00:00","dateModified":"2022-04-07T19:11:40+00:00","breadcrumb":{"@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#primaryimage","url":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2021\/04\/translate-theme-from-child-theme.png","contentUrl":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2021\/04\/translate-theme-from-child-theme.png","width":1200,"height":800},{"@type":"BreadcrumbList","@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/how-to-translate-the-theme-from-the-child-theme\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/essentials.pixfort.com\/knowledge-base\/"},{"@type":"ListItem","position":2,"name":"How to translate the theme from the child theme"}]},{"@type":"WebSite","@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/#website","url":"https:\/\/essentials.pixfort.com\/knowledge-base\/","name":"Essentials Knowledge base","description":"made by pixfort","publisher":{"@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/essentials.pixfort.com\/knowledge-base\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/#organization","name":"pixfort","url":"https:\/\/essentials.pixfort.com\/knowledge-base\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/#\/schema\/logo\/image\/","url":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2020\/07\/support-logo-dark-clean.png","contentUrl":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-content\/uploads\/sites\/33\/2020\/07\/support-logo-dark-clean.png","width":322,"height":110,"caption":"pixfort"},"image":{"@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pixfort","https:\/\/twitter.com\/pixfort","https:\/\/www.instagram.com\/pixfort\/","https:\/\/www.linkedin.com\/company\/pixfort","https:\/\/www.youtube.com\/c\/Pixfort"]},{"@type":"Person","@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/#\/schema\/person\/ce28d19c64aa87116b0fc2685df067b6","name":"pixfort","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/essentials.pixfort.com\/knowledge-base\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f5c4155e987c6ab4b3e8278828fe024c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f5c4155e987c6ab4b3e8278828fe024c?s=96&d=mm&r=g","caption":"pixfort"},"description":"Hey, this is pixfort support team, if you still need help you can always reach us via the chat messenger in your account on pixfort hub","sameAs":["http:\/\/hub.pixfort.com"],"url":"https:\/\/essentials.pixfort.com\/knowledge-base\/author\/pixfort\/"}]}},"_links":{"self":[{"href":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/4977"}],"collection":[{"href":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-json\/wp\/v2\/comments?post=4977"}],"version-history":[{"count":6,"href":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/4977\/revisions"}],"predecessor-version":[{"id":5845,"href":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/4977\/revisions\/5845"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-json\/wp\/v2\/media\/4998"}],"wp:attachment":[{"href":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=4977"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-json\/wp\/v2\/categories?post=4977"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/essentials.pixfort.com\/knowledge-base\/wp-json\/wp\/v2\/tags?post=4977"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}