8

I'm trying to change the following in a custom translation file but can't get it to work:

"Check "Remember Me" to access your shopping cart on this computer even if you are not signed in."

to

"Check "Remember Me" to access your shopping basket on this computer even if you are not signed in."

I have tried the following:

"Check \"Remember Me\" to access your shopping basket on this computer even if you are not signed in."

"Check ""Remember Me"" to access your shopping basket on this computer even if you are not signed in."

"Check \"\"Remember Me\"\" to access your shopping basket on this computer even if you are not signed in."

It's in a csv file that has other translations in that do work

5
  • Can you please provide what steps you tried follow to do the above mentioned changes ? Aug 3, 2016 at 10:31
  • I have now added what I have tried. This sentence isn't affected by a JS file is it? It's part of the "Whats this" tool tip for "Remember Me"
    – Mark
    Aug 3, 2016 at 10:38
  • Try \"Remember Me\" ... backslash (\) to escape the double quotes Aug 3, 2016 at 10:46
  • Sorry just edited they should have been \
    – Mark
    Aug 3, 2016 at 10:50
  • Try "Check \"Remember Me\" to access your shopping basket on this computer even if you are not signed in." Aug 3, 2016 at 10:53

2 Answers 2

7

Did a little bit of digging for this found it here:

vendor/magento/module-persistent/i18n/en_US.csv

The line states:

"Check "Remember Me" to access your shopping cart on this computer when you are logged out","Check "Remember Me" to access your shopping cart on this computer when you are logged out"

So you need to change this in your custom CSV file:

"Check "Remember Me" to access your shopping cart on this computer when you are logged out","Check "Remember Me" to access your shopping basket on this computer when you are logged out"

Hope this helps !!

19

you have to double the quotes in your language file.

"Check ""Remember Me"" to access","Check ""Remember Me"" to access"
|      \|           \|          |
|       |            |          |
|       |------------|          |
|              |                |     
|           will be             |
|         transformed           |
|         to one "              |
|-------------------------------|
           |
           |
     used by the csv format as delimiter                 
2
  • Interesting approach.. why couldn't they simply have escaped it?
    – Erfan
    Oct 28, 2020 at 6:59
  • The safest way is to check how the string to be translated looks where it is defined. If the string contains ", use " in translation file. If it contains " then use "" in translation file. The double quotes is due to RFC-4180, paragraph "If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote." Feb 9 at 14:57

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.