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
2 Answers 2
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 !!
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
-
Interesting approach.. why couldn't they simply have escaped it?Erfan– Erfan2020年10月28日 06:59:22 +00:00Commented 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."Mihai MATEI– Mihai MATEI2022年02月09日 14:57:51 +00:00Commented Feb 9, 2022 at 14:57
\"Remember Me\"... backslash(\)to escape the double quotes"Check \"Remember Me\" to access your shopping basket on this computer even if you are not signed in."