claudetech / node-static-i18n

HTML static pages i18n tool
https://www.npmjs.com/package/static-i18n
MIT License
104 stars 21 forks source link

Configure i18n options #12

Closed alvarotrigo closed 6 years ago

alvarotrigo commented 6 years ago

Not clear in the docs, it says:

i18n: Object passed directly to i18next.init. This allows you to override pretty much anything. Read i18next doc for more info. When using the CLI, outputOverride and i18n options are parsed as JSON.

I'm trying the following without success:

static-i18n -l en -i en -i es --fileFormat yml --i18n {"nsseparator": ":::", "keyseparator": "::"} www

Getting:

static-i18n [options] directory

alvarotrigo commented 6 years ago

Apparently we have to escape the string:

static-i18n -l en -i en -i es --fileFormat yml --i18n "{\"keyseparator\": \"::\"}" www
danhper commented 6 years ago

The behavior is shell dependent, but as I mentioned in another issue, using single quotes should avoid escaping:

static-i18n -l en -i en -i es --fileFormat yml --i18n '{"keyseparator": "::"}' www
alvarotrigo commented 6 years ago

Thanks for that!