默认情况下禁用本地化,仅支持英语。

时间:2017-10-15 18:01:29

标签: asp.net-boilerplate

我不希望ASP.NET Boilerplate中的本地化支持,请告诉我如何禁用它(如果可能的话)。

1 个答案:

答案 0 :(得分:3)

  1. DefaultLanguagesCreator.cs中注释掉这些行:

    private static List<ApplicationLanguage> GetInitialLanguages()
    {
        return new List<ApplicationLanguage>
        {
            new ApplicationLanguage(null, "en", "English", "famfamfam-flags gb"),
            // new ApplicationLanguage(null, "ar", "العربية", "famfamfam-flags sa"),
            // new ApplicationLanguage(null, "de", "German", "famfamfam-flags de"),
            // new ApplicationLanguage(null, "it", "Italiano", "famfamfam-flags it"),
            // new ApplicationLanguage(null, "fr", "Français", "famfamfam-flags fr"),
            // new ApplicationLanguage(null, "pt-BR", "Portuguese", "famfamfam-flags br"),
            // new ApplicationLanguage(null, "tr", "Türkçe", "famfamfam-flags tr"),
            // new ApplicationLanguage(null, "ru", "Русский", "famfamfam-flags ru"),
            // new ApplicationLanguage(null, "zh-CN", "简体中文", "famfamfam-flags cn"),
            // new ApplicationLanguage(null, "es-MX", "Español México", "famfamfam-flags mx"),
            // new ApplicationLanguage(null, "ja", "日本語", "famfamfam-flags jp")
        };
    }
    
  2. 如果您之前播种过,请从数据库中的AbpLanguages表中删除条目。

  3. Account/_Layout.cshtml中注释掉此行以在登录前禁用语言选择:

    @*<vc:account-languages></vc:account-languages>*@
    
  4. Shared/_Layout.cshtml中注释掉此行以在登录后禁用语言选择:

    @*@await Component.InvokeAsync(typeof(TopBarLanguageSwitchViewComponent))*@