botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Locale files in Node.js SDK

Open palmerabollo opened this issue 10 years ago • 7 comments

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?

palmerabollo avatar Aug 25 '16 21:08 palmerabollo

@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

muzahmed avatar Aug 26 '16 16:08 muzahmed

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

Andrea-Orimoto avatar Aug 26 '16 16:08 Andrea-Orimoto

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 avatar Aug 26 '16 18:08 palmerabollo

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

muzahmed avatar Aug 26 '16 18:08 muzahmed

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

palmerabollo avatar Sep 01 '16 16:09 palmerabollo

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)).

palmerabollo avatar Sep 02 '16 07:09 palmerabollo

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

palmerabollo avatar Sep 20 '16 10:09 palmerabollo