Skip to content

Commit dc95f3b

Browse files
committed
Update README.md
1 parent e5c180e commit dc95f3b

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
11
# IdentityServer3.Contrib.Localization.UI
2-
Localize the UI of IdentityServer3
2+
3+
Per default all views of [IdentityServer3](https://github.com/IdentityServer/IdentityServer3 "IdentityServer3") are not localized and in English. This solution provides a `LocalizedViewLoader` that can be used to load all views with translations. This implementation is based on the `FileSystemWithEmbeddedFallbackViewLoader` but with translation capabilities.
4+
5+
## Install
6+
7+
Build the solution and include the resulting assembly. Place the directories `assets` and `resources` into the root directory of your application. Be sure to set `Copy to Output Directory` to `Copy if newer`. All files are loaded into an internal cache after startup, so restart after changing views or language files.
8+
9+
var factory = new IdentityServerServiceFactory();
10+
factory.ViewService = new Registration<IViewService>(
11+
resolver => new DefaultViewService(embeddedViewServiceConfig, new LocalizedViewLoader()));
12+
13+
The `LocalizedViewLoader` takes a paramter `directory` to override the default view directory which is `assets`.
14+
15+
## Language files
16+
17+
We use PO files as language files. The name of the file defines the culture:
18+
19+
de.po -> German
20+
de-AT -> German, Austria
21+
22+
If the requested language could not be found, the culture `en` will be searched, so be sure that this one exists.
23+
24+
For further information how IdentityServer3 works, see [Customizing Views](https://identityserver.github.io/Documentation/docs/advanced/customizingViews.html "Customizing Views").

0 commit comments

Comments
 (0)