Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Translation in Admin only translates last string

Open waveyuk opened this issue 9 years ago • 2 comments

If you enter a string of translations in the Admin backend under General settings, it appears only the last string is translated. For example:

{"en":{"More_channels":"# Click here for more channels"},"en":{"Name":"Nickname (we don't recommend using your full name)"},"en":{"Name_optional":"Nickname (we don't recommend using your full name)"},"en":{"Email":"Email (in the form of <yourname>@<your-address.com>- not shown to others)"}}

In the the above example, only the Email translation is performed, all the others are ignored.

Rocket.Chat Version: 0.56.0 Running Instances: 1 DB Replicaset OpLog: Enabled Node Version: 4.8.1

waveyuk avatar Jun 20 '17 10:06 waveyuk

that's because the input you got is wrong, it should be:

{"en":
  {
    "More_channels":"# Click here for more channels",
    "Name":"Nickname (we don't recommend using your full name)"},
    "Name_optional":"Nickname (we don't recommend using your full name)"},
    "Email":"Email (in the form of <yourname>@<your-address.com>- not shown to others)"
  }
}

lucasvanhalst avatar Jun 20 '17 10:06 lucasvanhalst

@lucasvanhalst D'oh! <face-plant!> Don't I feel an idiot :) I was reading literally the instructions on the screen and just assumed that you had to specify the language identifier for each translation. Amended the translation as you suggested and it's worked perfectly. Thanks for your help!

waveyuk avatar Jun 20 '17 11:06 waveyuk