React-i18next: Colon character is not parsed properly

Created on 30 Jan 2018  路  2Comments  路  Source: i18next/react-i18next

Colon(:) character is not parsed using t function but it's been parsed using Trans jsx.

If we use t('Please fill the information below:') output shows nothing.

But if we use <Trans>Please fill the information below:</Trans> output renders properly as it is.

Even if we use any other character inside function t(), it'll be parsed properly except the colon.

If we use t('Please fill the :information below') output shows only 'information below' text. function t() basically removes the string before the colon.

If we use more than one colon t('Please fill the :information :below'), output 'information .below' text. It converts the other colons into dot.

Most helpful comment

If you like to use : inside translations you will need to set: https://www.i18next.com/principles/fallback.html#key-not-found

i18next.init({
  // allow keys to be phrases having `:`, `.`
  nsSeparator: false,
  keySeparator: false,
});

All 2 comments

If you like to use : inside translations you will need to set: https://www.i18next.com/principles/fallback.html#key-not-found

i18next.init({
  // allow keys to be phrases having `:`, `.`
  nsSeparator: false,
  keySeparator: false,
});

Just added a new section to readme: https://www.i18next.com/getting-started.html#important-read

Was this page helpful?
0 / 5 - 0 ratings