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

Add i18n support #7

Closed
wants to merge 1 commit into from
Closed

Add i18n support #7

wants to merge 1 commit into from

Conversation

finnp
Copy link
Contributor

@finnp finnp commented Dec 16, 2014

This PR adds the possibility to overwrite the English default Strings as requested in #6. The developer can pass an i18n object as an option mapping langage keys to alternative represenations (see /lib/en.json for english defaults). I didn't offer i18n support for strings that definetely seemed to be for developers only.

Also there is a new usage key which can be passed a readable stream providing an alternative usage template.

I used the visualwidth module to assure that it works for chinese character, too. However for chinese to fully work in adventure, terminal-menu has to be fixed (possibly with this https://github.com/substack/terminal-menu/pull/16)

@martinheidegger
Copy link
Contributor

Regarding the i18n support. For the workshopper I used (my) i18n-core module that offers basic but relevant features like symbol replacements, fallback mechanisms, composite options and plurals. Perhaps its worth considering it.

@tdd
Copy link
Member

tdd commented Feb 16, 2015

I intend to work on a branch this week that should use the same i18n behavior as workshopper, and submit that. This would help translators not juggle two distinct behavior sets across workshoppers.

Does that sound like something you'd be interested in?

Also, re: terminal-menu: it also completely breaks on lowercase diacritics (e.g. 'é'), which are super-common in, say, French, Spanish and Italian, to name only these. This does need fixing, haven't gotten around to it yet. Doesn't help that most workshoppers use an old terminal-menu though (new one still has issues on this, btw).

@martinheidegger
Copy link
Contributor

Probably this problem? tokuhirom/visualwidth-js#4

@tdd
Copy link
Member

tdd commented Feb 16, 2015

Sounds likely, indeed. Reminds me that terminal-menu invokes visualwidth.width with a second arg at true, apparently for terminal mode (your code, right?) but the used module (0.0.1) does not feature a second parameter, as it was apparently not published to npm yet…

Not even sure that change fixes the issue, too.

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

Successfully merging this pull request may close these issues.

3 participants