Botframework-sdk: Locale files in Node.js SDK

Created on 25 Aug 2016  路  7Comments  路  Source: microsoft/botframework-sdk

I'd like to use session.ngettext and session.gettext. Where should I put my i18n files and what format should I use to find a text by its msgid?

There are classes such as DefaultLocalizer in the repository. If I'm not wrong, they try to parse json files in a /localefolder, but the SDK is not clear about how to use them in a UniversalBot. Are there any examples available?

Most helpful comment

@palmerabollo yup, we will be releasing a new update in the next week that addresses that and provides further features and bug fixes!

All 7 comments

@palmerabollo you'll want them sibling to your bot's app.js file.

take a look at: https://github.com/Microsoft/BotBuilder/tree/master/Node/examples/basics-localization for an example, I'll add some more docs (and features!) around the localization stuff shortly, so stay tuned.

If you have other questions etc, lmk

@palmerabollo closing this issue, if you still have questions, let us know. Thanks!

Thanks for the answer, @muzahmed.

The latest npm package ([email protected]) was released 2 weeks ago, so the following code does not work:

var bot = new builder.UniversalBot(connector, {localizerSettings: { ... }});

because there is not a localizerSettings property in the IUniversalBotSettings interface definition yet. This interface changed only 11 days ago (see your commit).

Would it be possible to release a new [email protected] version with this feature?

@palmerabollo yup, we will be releasing a new update in the next week that addresses that and provides further features and bug fixes!

@muzahmed Do you still think the new release will be ready this week? (this feature is blocking us somehow). Thank you!

A suggestion/feature request: load all files under locale/_/_.json (not only locale/*/index.json) to be able to work in different libraries/dialogs in parallel (each library having its own locale file(s)).

@muzahmed Any plans to release the new version with i18n support soon?

Was this page helpful?
0 / 5 - 0 ratings