ASP.NET MVC localization best practice?

前端 未结 6 1499
野性不改
野性不改 2020-12-13 10:52

I need help with the best practice to localize asp mvc apps, I saw Oxite having a base method named Localize in the BaseController, but is the Localization a task for the vi

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-13 10:56

    I would better go for creating a custom MetadataProvider and using a convention for the models. Something like 1 resource file by model namespace and a convention like ModelName.PropertyName -> value

    For validators, common buttons and so a resource file.

    For views text i am actually trying to find a good way. Maybe a view pre-process before compilation and a custom Scope for localized texts, so the pre-process can create the resource file for each view with the default language.

提交回复
热议问题