{"id":405467,"date":"2023-10-13T05:28:16","date_gmt":"2023-10-13T05:28:16","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=405467"},"modified":"2023-10-25T08:07:22","modified_gmt":"2023-10-25T08:07:22","slug":"new-translation-system-in-prestashop-modules","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/","title":{"rendered":"New Translation system in PrestaShop module"},"content":{"rendered":"\n<p>In this blog, we are going to learn how to&nbsp;use <strong>new translation system in PrestaShop module<\/strong> and translate the sentences and texts available in module.<\/p>\n\n\n\n<p>Firstly while developing module we have to declare that we are going to use new translation system in module. For doing you need to add below code in module main class,<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">    public function isUsingNewTranslationSystem()\n    {\n        return true;\n    }<\/pre>\n\n\n\n<p>This indicates that you are going to use new translation system in module. Now you need to declare every sentences and text according to new translation system in PrestaShop module.<\/p>\n\n\n\n<p>Secondly, for any text or sentences written in module main class, classes and admin controller you can use translation function as below<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\/\/ For php files\n$this-&gt;trans(&#039;Unable to delete customer using id.&#039;, &#091;], &#039;Modules.Modulename.Admin&#039;));\n\n\/\/ For tpls\n{l s=&#039;My alerts&#039; d=&#039;Modules.Modulename.Admin&#039;}\n\n\n\/\/ For twigs\n{{ &#039;Follow up 1&#039;|trans({}, &#039;Modules.Modulename.Admin&#039;, locale) }}<\/pre>\n\n\n\n<p>Here <strong>Admin<\/strong> denotes that this text is for admin domain.<\/p>\n\n\n\n<p>Thirdly, for any text or sentences written in tpl, twig or front controller you can use translation function as below,<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\/\/ For tpls\n{l s=&#039;My alerts&#039; d=&#039;Modules.Modulename.Shop&#039;}\n\n\n\/\/ For twigs\n{{ &#039;Follow up 1&#039;|trans({}, &#039;Modules.Modulename.Shop&#039;, locale) }}\n\n\n\/\/ For php files\n$breadcrumb&#091;&#039;links&#039;]&#091;] = &#091;\n            &#039;title&#039; =&gt; $this-&gt;trans(&#039;My alerts&#039;, &#091;], &#039;Modules.Modulename.Shop&#039;),            \n        ];<\/pre>\n\n\n\n<p>Here <strong>Shop<\/strong> denotes that this text is for shop domain. You can put any domain in the place of Admin and Shop according to your use case to identify the text\/sentence. This text will shown under module translation under there respective domain.<\/p>\n\n\n\n<p>This is how we can use new translation system in PrestaShop module.<\/p>\n\n\n\n<p>If you want to translate phrases in the overriden files follow the <a href=\"https:\/\/webkul.com\/blog\/translate-phrases-in-overridden-files-in-prestashop\/\">Translate phrases in overridden files in PrestaShop<\/a> or if you want <a href=\"https:\/\/webkul.com\/blog\/translate-newly-added-phrases-in-prestashop-1-7\/\">Translate newly added phrases in overridden files in PrestaShop<\/a>.<\/p>\n\n\n\n<p>That\u2019s all.<\/p>\n\n\n\n<p>If you are facing any issues or doubts in the above process, please feel free to contact us through the comment section.<\/p>\n\n\n\n<p>I would be happy to help.<\/p>\n\n\n\n<p>Also, you can explore our&nbsp;<a href=\"https:\/\/webkul.com\/prestashop-development\/\" target=\"_blank\" rel=\"noreferrer noopener\">PrestaShop Development Services<\/a>&nbsp;and a large range of quality&nbsp;<a href=\"https:\/\/store.webkul.com\/PrestaShop-Extensions.html\">PrestaShop Modules<\/a>.<\/p>\n\n\n\n<p>For any doubt contact us at&nbsp;<a href=\"mailto:support@webkul.com\" target=\"_blank\" rel=\"noreferrer noopener\">support@webkul.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we are going to learn how to&nbsp;use new translation system in PrestaShop module and translate the sentences and texts available in module. Firstly while developing module we have to declare that we are going to use new translation system in module. For doing you need to add below code in module main <a href=\"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":386,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,209],"tags":[2065,2779],"class_list":["post-405467","post","type-post","status-publish","format-standard","hentry","category-module","category-prestashop","tag-prestashop","tag-translation"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>New Translation system in PrestaShop module - Webkul Blog<\/title>\n<meta name=\"description\" content=\"How to\u00a0use new translation system in PrestaShop module and translate the sentences and texts available in module.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New Translation system in PrestaShop module - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"How to\u00a0use new translation system in PrestaShop module and translate the sentences and texts available in module.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-13T05:28:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-25T08:07:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vineet Kr. Gupta\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vineet Kr. Gupta\" \/>\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:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/\"},\"author\":{\"name\":\"Vineet Kr. Gupta\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/bb871a3e8dd81b2b0a1690f195da6208\"},\"headline\":\"New Translation system in PrestaShop module\",\"datePublished\":\"2023-10-13T05:28:16+00:00\",\"dateModified\":\"2023-10-25T08:07:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/\"},\"wordCount\":293,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"keywords\":[\"prestashop\",\"translation\"],\"articleSection\":[\"module\",\"prestashop\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/\",\"url\":\"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/\",\"name\":\"New Translation system in PrestaShop module - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2023-10-13T05:28:16+00:00\",\"dateModified\":\"2023-10-25T08:07:22+00:00\",\"description\":\"How to\u00a0use new translation system in PrestaShop module and translate the sentences and texts available in module.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New Translation system in PrestaShop module\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/bb871a3e8dd81b2b0a1690f195da6208\",\"name\":\"Vineet Kr. Gupta\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b8dd0faa3589c82d64586b71a9e84be11a8b9a8f3b74bb952442b904af1c68f2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b8dd0faa3589c82d64586b71a9e84be11a8b9a8f3b74bb952442b904af1c68f2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Vineet Kr. Gupta\"},\"description\":\"Proficient Software Engineer specializing in PrestaShop, with expertise in Mobile App Development, eCommerce Platform Development, and POS services. Delivers innovative, user-focused solutions that enhance functionality and drive efficient business operations.\",\"url\":\"https:\/\/webkul.com\/blog\/author\/vineetkr-gupta008\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New Translation system in PrestaShop module - Webkul Blog","description":"How to\u00a0use new translation system in PrestaShop module and translate the sentences and texts available in module.","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:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/","og_locale":"en_US","og_type":"article","og_title":"New Translation system in PrestaShop module - Webkul Blog","og_description":"How to\u00a0use new translation system in PrestaShop module and translate the sentences and texts available in module.","og_url":"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-10-13T05:28:16+00:00","article_modified_time":"2023-10-25T08:07:22+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Vineet Kr. Gupta","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Vineet Kr. Gupta","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/"},"author":{"name":"Vineet Kr. Gupta","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/bb871a3e8dd81b2b0a1690f195da6208"},"headline":"New Translation system in PrestaShop module","datePublished":"2023-10-13T05:28:16+00:00","dateModified":"2023-10-25T08:07:22+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/"},"wordCount":293,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"keywords":["prestashop","translation"],"articleSection":["module","prestashop"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/","url":"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/","name":"New Translation system in PrestaShop module - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2023-10-13T05:28:16+00:00","dateModified":"2023-10-25T08:07:22+00:00","description":"How to\u00a0use new translation system in PrestaShop module and translate the sentences and texts available in module.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/new-translation-system-in-prestashop-modules\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"New Translation system in PrestaShop module"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/bb871a3e8dd81b2b0a1690f195da6208","name":"Vineet Kr. Gupta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b8dd0faa3589c82d64586b71a9e84be11a8b9a8f3b74bb952442b904af1c68f2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b8dd0faa3589c82d64586b71a9e84be11a8b9a8f3b74bb952442b904af1c68f2?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Vineet Kr. Gupta"},"description":"Proficient Software Engineer specializing in PrestaShop, with expertise in Mobile App Development, eCommerce Platform Development, and POS services. Delivers innovative, user-focused solutions that enhance functionality and drive efficient business operations.","url":"https:\/\/webkul.com\/blog\/author\/vineetkr-gupta008\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/405467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/386"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=405467"}],"version-history":[{"count":9,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/405467\/revisions"}],"predecessor-version":[{"id":407492,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/405467\/revisions\/407492"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=405467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=405467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=405467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}