diff --git a/docs/en/Localization.md b/docs/en/Localization.md index 53f62223cf..954fe8620f 100644 --- a/docs/en/Localization.md +++ b/docs/en/Localization.md @@ -181,6 +181,10 @@ public class MyService } ```` +##### Format Arguments + +Format arguments can be passed after the localization key. If your message is `Hello {0}, welcome!`, then you can pass the `{0}` argument to the localizer like `_localizer["HelloMessage", "John"]` + #### Simplest Usage In A Razor View/Page ````c# @@ -225,6 +229,17 @@ If you don't specify the localization resource name, it uses the default localiz var str = abp.localization.localize('HelloWorld'); //uses the default resource ```` +##### Format Arguments + +If your localized string contains arguments, like `Hello {0}, welcome!`, you can pass arguments to the localization methods. Examples: + +````js +var str1 = abp.localization.getResource('Test')('HelloWelcomeMessage', 'John'); +var str2 = abp.localization.localize('HelloWorld', 'Test', 'John'); +```` + +Both of the samples above produce the output `Hello John, welcome!`. + ## See Also * [Localization in Angular UI](UI/Angular/Localization.md) \ No newline at end of file