Compare commits
1 Commits
e25d4639de
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
d980ce6ede
|
17
Readme.MD
17
Readme.MD
@@ -50,10 +50,21 @@ var value = I18NManager.Get<string>("Hello", CultureInfo.InvariantCulture, Usern
|
|||||||
<Window xmlns="https://github.com/avaloniaui"
|
<Window xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:i18N="clr-namespace:JackCraft.I18N;assembly=JackCraft.I18N">
|
xmlns:i18N="clr-namespace:JackCraft.I18N;assembly=JackCraft.I18N">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
<!-- Resources:
|
||||||
|
资源名称 | 默认值 | 中文
|
||||||
|
Test | Test | 测试
|
||||||
|
Hello | Hello, {0} | 你好, {0}
|
||||||
|
-->
|
||||||
|
<!-- ViewModel:
|
||||||
|
public string UserText { get; set; } = "UserName";
|
||||||
|
public string TestKey { get; set; } = "Test";
|
||||||
|
public string HelloKey { get; set; } = "Hello";
|
||||||
|
-->
|
||||||
<TextBlock Text="{i18N:I18N Test}" /> <!-- 输出: 测试 -->
|
<TextBlock Text="{i18N:I18N Test}" /> <!-- 输出: 测试 -->
|
||||||
<TextBlock Text="{i18N:I18N Hello, User}" /> <!-- 输出: 你好, User -->
|
<TextBlock Text="{i18N:I18N Hello, UserName}" /> <!-- 输出: 你好, UserName -->
|
||||||
<!-- ViewModel: public string User { get; set; } = "User"; -->
|
<TextBlock Text="{i18N:I18N Hello, {Binding UserText}}" /> <!-- 输出: 你好, UserName -->
|
||||||
<TextBlock Text="{i18N:I18N Hello, {Binding User}}" /> <!-- 输出: 你好, User -->
|
<TextBlock Text="{i18N:I18N {Binding Test}}" /> <!-- 输出: 测试 -->
|
||||||
|
<TextBlock Text="{i18N:I18N {Binding HelloKey}, {Binding HelloKey}}" /> <!-- 输出: 你好, Hello -->
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Window>
|
</Window>
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user