当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Session.preferredLocale方法代码示例

本文整理汇总了TypeScript中botbuilder.Session.preferredLocale方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Session.preferredLocale方法的具体用法?TypeScript Session.preferredLocale怎么用?TypeScript Session.preferredLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在botbuilder.Session的用法示例。


在下文中一共展示了Session.preferredLocale方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: getSuggestedActions

function getSuggestedActions(session: Session): SuggestedActions {
    const yes = session.localizer.gettext(session.preferredLocale(), 'confirmation.yesOption');
    const no = session.localizer.gettext(session.preferredLocale(), 'confirmation.noOption');
    const cancel = session.localizer.gettext(session.preferredLocale(), 'confirmation.cancelOption');
    return SuggestedActions.create(session, [
        CardAction.imBack(session, yes, yes),
        CardAction.imBack(session, no, no),
        CardAction.imBack(session, cancel, cancel)]);
}
开发者ID:magencio,项目名称:UberBotNode_V3,代码行数:9,代码来源:confirmationPrompt.ts

示例2: getSuggestedActions

function getSuggestedActions(session: Session): SuggestedActions {
    const faq = session.localizer.gettext(session.preferredLocale(), 'master.faqOption');
    const feedback = session.localizer.gettext(session.preferredLocale(), 'master.feedbackOption');
    const complaints = session.localizer.gettext(session.preferredLocale(), 'master.complaintsOption');
    const language = session.localizer.gettext(session.preferredLocale(), 'master.languageOption');
    return SuggestedActions.create(session, [
        CardAction.imBack(session, faq, faq),
        CardAction.imBack(session, feedback, feedback),
        CardAction.imBack(session, complaints, complaints),
        CardAction.imBack(session, language, language)]);
}
开发者ID:magencio,项目名称:UberBotNode_V3,代码行数:11,代码来源:masterDialog.ts

示例3: return

 return (session: Session, args?: any) => {
     const locale = session.preferredLocale();
     const dialogId = `faq-${locale}`;
     if (!bot.library.dialog(dialogId)) {
         bot.library.dialog(dialogId, createLocalizedDialog(bot, locale));
     }
     session.replaceDialog(dialogId, args);
 };
开发者ID:magencio,项目名称:UberBotNode_V3,代码行数:8,代码来源:faqDialog.ts

示例4: return

 return (session: Session, args?: any) => {
     const locale = session.preferredLocale();
     const dialogId = `confirmation-${locale}`;
     if (!bot.dialog(dialogId)) {
         bot.dialog(dialogId, createLocalizedDialog(locale, bot.instrumentation));
     }
     session.replaceDialog(dialogId, args);
 };
开发者ID:magencio,项目名称:UberBotNode_V3,代码行数:8,代码来源:confirmationPrompt.ts

示例5: return

 return (session: Session, args?: any) => {
     const locale = session.userData.locale || "en";
     session.preferredLocale(locale, (err: Error) => {
         const dialogId = `masterRoot-${locale}`;
         if (!bot.dialog(dialogId)) {
             bot.dialog(dialogId, createLocalizedDialog(bot, locale));
         }
         session.replaceDialog(dialogId, args);
     });
 };
开发者ID:magencio,项目名称:UberBotNode_V3,代码行数:10,代码来源:masterDialog.ts

示例6: getSuggestedActions

function getSuggestedActions (library: Library, session: Session): SuggestedActions {
    const finish = session.localizer.gettext(session.preferredLocale(), 'faq.finishOption', library.name);
    return SuggestedActions.create(session, [
        CardAction.imBack(session, finish, finish)]);
}
开发者ID:magencio,项目名称:UberBotNode_V3,代码行数:5,代码来源:faqDialog.ts

示例7:

 (session: Session, luisResults: IIntentRecognizerResult) => {
     const finishConfirmation = session.localizer.gettext(session.preferredLocale(), 'faq.finishConfirmation', library.name);
     session.beginDialog('*:confirmation', finishConfirmation);
 },
开发者ID:magencio,项目名称:UberBotNode_V3,代码行数:4,代码来源:faqDialog.ts


注:本文中的botbuilder.Session.preferredLocale方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。