Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using keySeparator: false in the config breaks things #81

Closed
coyotte508 opened this issue Mar 22, 2018 · 3 comments
Closed

Using keySeparator: false in the config breaks things #81

coyotte508 opened this issue Mar 22, 2018 · 3 comments
Assignees
Milestone

Comments

@coyotte508
Copy link
Contributor

coyotte508 commented Mar 22, 2018

Version: 1.0.0-beta-6

I'm using "keySeparator": false so I can use strrings rather than key: t('Hello! How are you?') instead of t('welcome.message').

The reason is so that this can be extracted: t('Logging in...'). With keySeparator set to false, the dots should not cause problems.

However doing that causes a bunch of weird files to popup: locales/en/translationfalseKey1.json, locales/en/translationfalseKey2.json, ... One different file per language and per individual key.

Here is my JSON:

{
  "keySeparator": false,
  "namespaceSeparator": false,
  "lexers": {
    "js": ["JavascriptLexer", "JsxLexer"]
  },
  "sort": true,
  "locales": ["fr","en"]
}

Here is how I call with the cli: i18next 'app/**/*.js' -c locales/i18next-parser.config.json -o .

Current workaround: use something like "__NO_KEY_SEPARATOR__" instead of false.

@karellm
Copy link
Member

karellm commented Mar 22, 2018

@coyotte508 Thanks for the ticket. I will add support for keySeparator: false next time I fix bugs and prior releasing 1.0.0. As you mentioned, right now the workaround is to set it to something that is unlikely to be used in keys (like __NO_KEY_SEPARATOR__).

@karellm karellm self-assigned this Mar 22, 2018
@karellm karellm added this to the 1.0.0 milestone Mar 22, 2018
@karellm
Copy link
Member

karellm commented Mar 27, 2018

I've just published 1.0.0-beta7 that address that issue.

@coyotte508
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants