You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A C# port of the [ngx-translate](https://github.com/ngx-translate/core). The port is not one to one and also aims to be more C# friendly where possible.
10
+
A C# port of the [ngx-Translate](https://github.com/ngx-Translate/core). The port is not one to one and also aims to be more C# friendly where possible.
11
11
12
12
The library provides you with a `TranslateService` which combined with a `TranslateLoader` (HttpLoader built in) enables you to load, compile and display your translations using formatting with keys. For much stronger formatting there exists a supporting package that uses the awesome [SmartFormat](https://github.com/axuno/SmartFormat/) package.
- Contains the `abstractions`, `defaults`, `primitives`, `http loader` and the `service`.
26
-
-Noctilocus.SmartFormat
26
+
-Translate.SmartFormat
27
27
- Contains the `SmartFormatParser`.
28
28
29
29
Installation:
30
-
-`Noctilocus` in projects that you want to use the service or any of the primitives.
31
-
-`Noctilocus.SmartFormat` in projects that use the service and you want to replace the default parser.
30
+
-`Translate` in projects that you want to use the service or any of the primitives.
31
+
-`Translate.SmartFormat` in projects that use the service and you want to replace the default parser.
32
32
33
33
# Getting Started
34
34
35
-
The section will describe how to get started with Noctilocus in a `Blazor Wasm` using the `HttpLoader` storing the language files at `wwwroot/i18n`.
35
+
The section will describe how to get started with Translate in a `Blazor Wasm` using the `HttpLoader` storing the language files at `wwwroot/i18n`.
36
36
37
-
1. Add the `Noctilocus` package.
37
+
1. Add the `Translate` package.
38
38
```console
39
-
dotnet add package Noctilocus
39
+
dotnet add package Translate
40
40
```
41
41
2. Add the appropriate services to the service provider.
42
42
```csharp
@@ -50,19 +50,19 @@ services.AddScoped<TranslateService>(); // This will use the default parser
50
50
51
51
For the tanslation `key: hello` and `value: Hello` you can do:
52
52
```csharp
53
-
translate.Instant("hello") // prints "Hello"
54
-
translate|"hello"// prints "Hello"
53
+
Translate.Instant("hello") // prints "Hello"
54
+
Translate|"hello"// prints "Hello"
55
55
```
56
56
57
57
For the translation `key: welcome`, `value: Welcome {user}!` and `param: user`.
58
58
```csharp
59
-
translate.Instant("hello", new { user="panos" }) // prints "Welcome panos"!
60
-
translate|"hello"|new { user="panos" } // prints "Welcome panos"!
59
+
Translate.Instant("hello", new { user="panos" }) // prints "Welcome panos"!
60
+
Translate|"hello"|new { user="panos" } // prints "Welcome panos"!
61
61
```
62
62
63
63
# Contributing
64
64
65
-
For general contribution information you can read the [Raven Tail Contributing document](https://github.com/Raven-Tail/.github/blob/main/CONTRIBUTING.md).
65
+
For general contribution information you can read the [Raven Tail Contributing document](https://github.com/HereticSoftware/.github/blob/main/CONTRIBUTING.md).
0 commit comments