禁用本地化以仅支持英语作为默认语言。

Disable localization in favor of just English language as default.

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

  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 table 中删除条目。

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

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

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