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

Marius
199k55 gold badges431 silver badges837 bronze badges
asked Aug 3, 2016 at 10:23
5
  • Can you please provide what steps you tried follow to do the above mentioned changes ? Commented 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" Commented Aug 3, 2016 at 10:38
  • Try \"Remember Me\" ... backslash (\) to escape the double quotes Commented Aug 3, 2016 at 10:46
  • Sorry just edited they should have been \ Commented 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." Commented 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 !!

answered Aug 3, 2016 at 14:24
20

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 
answered Aug 3, 2016 at 10:54
2
  • Interesting approach.. why couldn't they simply have escaped it? Commented 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." Commented Feb 9, 2022 at 14:57

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.