cancel
Showing results for 
Search instead for 
Did you mean: 

How can i translate custom text into magento 2.2 custom theme ?

SOLVED

How can i translate custom text into magento 2.2 custom theme ?

 

Hello,

 

I have used Ves Fasony theme into Magento 2.2 and also i added language packs (portugease, french & spanish) from mageplaza.

After install all language packs, some text are not translated into respective language so now i need to add that english text with translated text into csv.

so where can i add custom text ?


I already tried to change text into vendor/mageplaza module's language csv file but not showing translated text into frontend.

Please suggest me how can i achieve it.

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How can i translate custom text into magento 2.2 custom theme ?

Hello @yagnik_solanki

 

For example, your language code is de_DE

 

Create the de_DE.csv file at the following path

 

app/design/frontend/vendor/yourtheme/i18n/de_DE.csv

Now add your custom text and translated text as given below in de_DE.csv file

 

"Custom Text.","Translated Text",theme,frontend/vendor/yourtheme

 

Run the following commands

 

php bin/magento setup:static-content:deploy de_DE -f
php bin/magento cache:clean
php bin/magento cache:flush
If you find my answer useful, Please click Kudos & Accept as Solution.

View solution in original post

4 REPLIES 4

Re: How can i translate custom text into magento 2.2 custom theme ?

you can Create language file at below path and add translation text. app/design/frontend/Vendor/theme/i18n/file.csv

 

For example,

  • <module_dir>/i18n/pt_BR.csv
  • <module_dir>/<theme>/i18n/pt_BR.csv

 

Reference : https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/translations/xlate.html#translate_terms

Re: How can i translate custom text into magento 2.2 custom theme ?

Hello @yagnik_solanki

 

For example, your language code is de_DE

 

Create the de_DE.csv file at the following path

 

app/design/frontend/vendor/yourtheme/i18n/de_DE.csv

Now add your custom text and translated text as given below in de_DE.csv file

 

"Custom Text.","Translated Text",theme,frontend/vendor/yourtheme

 

Run the following commands

 

php bin/magento setup:static-content:deploy de_DE -f
php bin/magento cache:clean
php bin/magento cache:flush
If you find my answer useful, Please click Kudos & Accept as Solution.

Re: How can i translate custom text into magento 2.2 custom theme ?

Thanks

I will try your solution and let you know if any issue or not working

Re: How can i translate custom text into magento 2.2 custom theme ?

Hello,

 I have one solution that is Magento Language Translator.

This Extension provides admin to set up language setting with particular page file or mass translator.  Here Admin has Fully Authorized to change a website or other to client's requirements. If one word that does not translate properly with Google Language translator API

our extension provides a facility to clients that they convert that word in their requirement.