4

I installed a language pack of French of mageplaza it is successfully installed using composer and on my website language switcher is working fine but the issue is when i am changing the text that was still remaining to translate into french so i created fr_FR.csv into

app/design/frontend/Theme/demo/i18n

for testing it is working or not i tried to change 'Add to Cart' that is already translated to 'Ajouter au panier' so i changed it to csv to 'Ajouter au panier test' but not changing.

I did cache flush and deploy content too.

2

If you are adding new static text or displaying dynamic text, please print it using ' echo __("static text"/$variable); ' and update CSV file with what text you are going to translate and its translation.

NOTE: please enter string or text as same as what is going to print with all spaces and font case, If any letter or space is missed then Magento does not accept that string.

There is a second way - create separate blocks for each language and allocate them to respective store view, no need of translation CSV file for this way

Hope, It helps,

Thanks.

  • Actually i am trying to translate "About Us" text written in static block of footer links but not able to do this? – Charul Tyagi Sep 21 '18 at 5:13
  • in this case, a second way is reliable, please create separate blocks for each language . for example - footer_block_English -> assign to English language store view and footer_block_French --> assign to French language store view... NOTE:- no need to update CSV file. And each block contains respective language translation & no need to deploy also... – kaustubh borate Sep 21 '18 at 13:49
1

As Kaustubh mentioned you should have all printed text static or dynamic in echo __("...") . You can do so and then enable on Configuration/Developer the Inline translation for the storefront! It will both show you what you can translate and will allow you to translate it!

P.S. everything that Inline translation shows you to translate can be translated with the csv method as well!

  • It is already written in file like echo__("....") it was translated first time to french when i installed the language pack but i am changing the text in fr_FR.csv but not getting any effect on that? – Charul Tyagi Sep 21 '18 at 6:29
  • Disable your cash, deploy static content for fr and then re-enable the cash, see if this works bin/magento setup:static-content:deploy fr_FR --theme="vendor/theme" -s standard – George Geo Sep 21 '18 at 6:37
  • I tried but it did not work. – Charul Tyagi Sep 21 '18 at 6:43
1

If it is Static Block, you should make static block as per store view like make static block for english and same for french (same block id for both), you can add content in english in "english" store view and french in "french" store view.

This is better way to do it.

Best Regards, Krunal Pathak

  • Yes we can do this but here i want to know what is the issue of not getting change even i tried for 'Add to Cart' button to change it was translated by language pack of french but for testing i tried to change little text but not took effect? – Charul Tyagi Sep 21 '18 at 6:31
  • I have tried it, on my side it work after clearing cache. you should clear cache from magento admin (all cache) and hard refresh your browser. – Krunal Pathak Sep 21 '18 at 6:59
  • You tried so it is working fine at your end? – Charul Tyagi Sep 21 '18 at 7:01
  • @CharulTyagi, After installing mageplaza language pack, have you also added your csv file in given path? – Krunal Pathak Sep 21 '18 at 9:24
  • when i installed mageplaza language pack a drectory created of mageplaza under vendor directory and there is also csv file that further i deployed using static content after that i taken effect of French but if i want to change any text again it is not working even copying to app/design/frontend/theme/demo/i18n – Charul Tyagi Sep 21 '18 at 9:28
0

If you can't translate the text, you can check where the text translated by follow steps below :

  1. Navigate to the Admin Panel> Stores> Configuration :

enter image description here

  1. Find the Developer tab under Advanced settings and preset it :

enter image description here

  1. Open the Translate Inline options :

enter image description here

  1. Set the ‘Enable for Frontend’ option to ‘Yes’ and click the ‘Save Config’ button :

enter image description here

  1. check result on frontend
  • Yes i know this option to do this but the way by doing using csv should be working that's why i am researching to find where i did wrong. – Charul Tyagi Sep 21 '18 at 6:57
  • Create the file fr_FR.csv in your i18n folder then put your text need change by echo __('text') – Vu Tran Kien Sep 21 '18 at 7:03
  • I'm thinking your text has been translated in other file – Vu Tran Kien Sep 21 '18 at 7:04
  • i created fr_FR.csv file under app/design/frontend/theme/demo/i18n and changed the text here. – Charul Tyagi Sep 21 '18 at 7:52
  • And you don't see text changed ? seem another location have the text translated – Vu Tran Kien Sep 21 '18 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.