From d0a2bb111e6e657e257445c828156c4c1c08291a Mon Sep 17 00:00:00 2001 From: EngincanV Date: Thu, 31 Oct 2024 14:44:03 +0300 Subject: [PATCH] Update localization-system.md --- .../microservice/localization-system.md | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/docs/en/solution-templates/microservice/localization-system.md b/docs/en/solution-templates/microservice/localization-system.md index 7d0ff1ca9c..d7ac867590 100644 --- a/docs/en/solution-templates/microservice/localization-system.md +++ b/docs/en/solution-templates/microservice/localization-system.md @@ -66,7 +66,47 @@ You can define new localization entries in the language files under the **Locali ### Angular UI -//TODO:... +Angular UI gets the localization resources from the [`application-localization`](../../framework/api-development/standard-apis/localization.md) API's response and merges these resources in the `ConfigStateService` for the localization entries/resources coming from the backend side. + +In addition, you may need to define some localization entries and only use them on the UI side. ABP already provides the related configuration for you, so you don't need to make any configurations related to that and instead you can directly define localization entries in the `app.-module.ts` file of your angular application as follows: + +```ts +import { provideAbpCore, withOptions } from '@abp/ng.core'; + +@NgModule({ + providers: [ + // ... + provideAbpCore( + withOptions({ + environment, + registerLocaleFn: registerLocale(), + localizations: [ + { + culture: 'en', + resources: [ + { + resourceName: 'MyProjectName', + texts: { + "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information visit" + } + } + ] + } + ] + }), + ), + ... + ], +}) +export class AppModule {} + +``` + +After defining the localization entries, it can be used as below: + +```html +
{{ 'MyProjectName::LongWelcomePage' | abpLocalization }}
+``` > For more information, please refer to [UI Localization section of the Angular Localization document](../../framework/ui/angular/localization.md).