参考:Localization

    现在 Core 项目的 XxxLocalizationConfigurer 内添加简体中文:

    1. public static void Configure(ILocalizationConfiguration localizationConfiguration)
    2. {
    3. localizationConfiguration.Languages.Add(new LanguageInfo("en", "English", "famfamfam-flags england", isDefault: true));
    4. localizationConfiguration.Languages.Add(new LanguageInfo("tr", "Türkçe", "famfamfam-flags tr"));
    5. localizationConfiguration.Languages.Add(new LanguageInfo("zh-CN", "简体中文", "famfamfam-flags cn"));
    6. localizationConfiguration.Sources.Add(
    7. new DictionaryBasedLocalizationSource(SimpleTaskSystemConsts.LocalizationSourceName,
    8. new JsonEmbeddedFileLocalizationDictionaryProvider(
    9. typeof(SimpleTaskSystemLocalizationConfigurer).GetAssembly(),
    10. "SimpleTaskSystem.Localization.SourceFiles"
    11. )
    12. )
    13. );
    14. }

    然后在 SourceFiles 文件夹下创建 Xxx-zh-CN.json:

    1. {
    2. "culture": "zh-CN",
    3. "texts": {
    4. "HelloWorld": "你好",
    5. "ChangeLanguage": "语言设置",
    6. "HomePage": "主页",
    7. "About": "关于",
    8. "Home_Description": "主页",
    9. "About_Description": "关于",
    10. "TaskList": "任务清单",
    11. "TaskState_Open": "进行中",
    12. "TaskState_Completed": "已完成"
    13. }
    14. }

    然后将该 JSON 文件的生成操作修改为“嵌入的资源”:
    ABP Localization 添加中文 - 图1

    最后编译 Core 项目,重启前台项目即可。
    ABP Localization 添加中文 - 图2