2

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

4

1 回答 1

5
  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))*@
    
于 2017-10-16T03:24:00.953 回答