ABP's localization system is seamlessly integrated to the `Microsoft.Extensions.Localization` package and compatible with the [Microsoft's localization documentation](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization). It adds some useful features and enhancements to make it easier to use in real life application scenarios.
Then you can add **AbpLocalizationModule** dependency to your module:
然后,您可以将 **AbpLocalizationModule** 依赖项添加到您的模块:
```c#
using Volo.Abp.Modularity;
@ -28,9 +28,9 @@ namespace MyCompany.MyProject
}
```
#### Creating A Localization Resource
#### 创建本地化资源
A localization resource is used to group related localization strings together and separate them from other localization strings of the application. A module generally defines its own localization resource. Localization resource is just a plain class. Example:
Localization resources are also available in the client (JavaScript) side. So, setting a short name for the localization resource makes it easy to use localization texts. Example:
See the Getting Localized Test / Client Side section below.
请参阅下面的获取本地化资源Test中客户端部分.
##### Inherit From Other Resources
##### 继承其他资源
A resource can inherit from other resources which makes possible to re-use existing localization strings without referring the existing resource. Example:
资源可以从其他资源继承,这使得可以在不引用现有资源的情况下重用现有的本地化字符串. 例如:
````C#
[InheritResource(typeof(AbpValidationResource))]
@ -109,7 +109,7 @@ public class TestResource
}
````
Alternative inheritance by configuring the `AbpLocalizationOptions`:
* If the new resource defines the same localized string, it overrides the string.
* 资源可以从多个资源继承.
* 如果新的本地化资源定义了相同的本地化字符串, 那么它会覆盖该字符串
##### Extending Existing Resource
##### 扩展现有资源
Inheriting from a resource creates a new resource without modifying the existing one. In some cases, you may want to not create a new resource but directly extend an existing resource. Example:
Refer to the [Microsoft's localization documentation](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization) for details about using localization on the server side.