skip to Main Content

this is raw message in Js

$.mage.__("Please enter a valid Street Address not including " , / , \ , &.")

expected message:
Please enter a valid Street Address not including " , / , , &.

csv files:

I try to translate this text in csv file like example bellow but it’s not work! are there any way to fix it ??

"Please enter a valid Street Address not including " , / , \ , &.", "abc abc valid Street Address not including " , / , \ , &."
"Please enter a valid Street Address not including " , / , \ , &.","abc abc valid Street Address not including " , / , \ , &."
"Please enter a valid Street Address not including " , / , \ , &.","abc abc valid Street Address not including " , / , \ , &."

3

Answers


  1. You need to add special characters with javascript code :-

     $.mage.__("Please enter a valid Street Address not including ' , \ , " , & ")
    

    Check this.

    In case you need some more special characters then use these code / short codes into your string.

    There are some reserved single character escape sequences for use in strings:

    b: backspace (U+0008 BACKSPACE)
    f: form feed (U+000C FORM FEED)
    n: line feed (U+000A LINE FEED)
    r: carriage return (U+000D CARRIAGE RETURN)
    t: horizontal tab (U+0009 CHARACTER TABULATION)
    v: vertical tab (U+000B LINE TABULATION)
    : null character (U+0000 NULL) (only if the next character is not a decimal digit; else its an octal escape sequence)
    ': single quote (U+0027 APOSTROPHE)
    ": double quote (U+0022 QUOTATION MARK)
    \: backslash (U+005C REVERSE SOLIDUS)
    &: ampersand
    r: carriage return
    t: tab
    b: backspace
    
    Login or Signup to reply.
  2. In csv you have to care about 2 characters: the separator char and the quote char (most common , and ").

    If fields contain a separator they have to be enclosed in double quotes, and if fields contain a double quote this has to be escaped with another double quote (or a Linux style).

    So your example file:

    "Please enter a valid Street Address not including " , / , \ , &.", "abc abc valid Street Address not including " , / , \ , &."
    "Please enter a valid Street Address not including " , / , \ , &.","abc abc valid Street Address not including " , / , \ , &."
    "Please enter a valid Street Address not including " , / , \ , &.","abc abc valid Street Address not including " , / , \ , &."
    

    becomes:

    "Please enter a valid Street Address not including "" , / , \ , &.","abc abc valid Street Address not including "" , / , \ , &."
    "Please enter a valid Street Address not including "" , / , \ , &.","abc abc valid Street Address not including "" , / , \ , &."
    "Please enter a valid Street Address not including " , / , \ , &.","abc abc valid Street Address not including "" , / , \ , &."
    

    Also don’t put spaces between the separator and the field, as in the first line. This could cause some problems with certain parsers.

    Login or Signup to reply.
  3. "Please enter a valid Street Address not including " , / , , &.","Please enter a valid Street Address not including " , / , , &."

    add translation in your csv file, after run the below commands:

    php bin/magento s:up

    php bin/magento s:s:d -f {‘your store language code if you use..’}

    php bin/magento c:f

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search