Skip to content

Commit 6b0f18e

Browse files
committed
调试
1 parent 6222734 commit 6b0f18e

File tree

4 files changed

+14
-50
lines changed

4 files changed

+14
-50
lines changed

samples/LocalizationSample/LocalizationSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Import Project="..\..\src\dotnetCampus.Localizations\Package\build\Package.props" />
44

55
<PropertyGroup>
6-
<OutputType>WinExe</OutputType>
6+
<OutputType>Exe</OutputType>
77
<TargetFramework>net8.0</TargetFramework>
88
</PropertyGroup>
99

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
A.A1 = "Words"
22
A.A2 = "Error code: {errorCode:int}"
33
A.A3 = "Error: {error}"
4+
A.A4.A41 = "Warning: {error}"
5+
A.A4.A42 = "Tip: {0}={1}"
6+
B.C.A1 = "Hello"
7+
B.C.A2.A3 = "Hello"
8+
B.C.A2.A4.Add.A1123.Sddd.Ffffff.Cxzzxc = "Hello"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
A.A1 = "文本"
22
A.A2 = "错误码:{errorCode:int}"
33
A.A3 = "错误:{error}"
4+
A.A4.A41 = "警告:{error}"
5+
A.A4.A42 = "提示:{0}={1}"
6+
B.C.A1 = "Hello"
7+
B.C.A2.A3 = "Hello"
8+
B.C.A2.A4.Add.A1123.Sddd.Ffffff.Cxzzxc = "Hello"
Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,15 @@
1-
using System.Collections.Frozen;
2-
using System.ComponentModel;
3-
using dotnetCampus.Localizations;
1+
using dotnetCampus.Localizations;
42

53
namespace LocalizationSample;
64

75
internal class Program
86
{
97
public static void Main(string[] args)
108
{
9+
var a = Lang.Current.A.A2.ToString(1);
10+
Console.WriteLine(a);
1111
}
1212
}
1313

1414
[LocalizedConfiguration(Default = "zh-hans", Current = "en")]
1515
internal partial class Lang;
16-
17-
// [EditorBrowsable(EditorBrowsableState.Never)]
18-
// public interface ILocalizedValues : ILocalizedStringProvider
19-
// {
20-
// ILocalizedValues_A A => (ILocalizedValues_A)this;
21-
// }
22-
//
23-
// [EditorBrowsable(EditorBrowsableState.Never)]
24-
// public interface ILocalizedValues_A : ILocalizedStringProvider
25-
// {
26-
// LocalizedString A1 => this.Get0("A.A1");
27-
//
28-
// LocalizedString<int> A2 => this.Get1<int>("A.A2");
29-
//
30-
// LocalizedString<object> A3 => this.Get1<object>("A.A3");
31-
// }
32-
//
33-
// public class Lang_ZhHans(ILocalizedValues? fallback) : ILocalizedValues,
34-
// ILocalizedValues_A
35-
// {
36-
// private readonly FrozenDictionary<string, string> _strings = new Dictionary<string, string>
37-
// {
38-
// { "A.A1", "文字" },
39-
// { "A.A2", "错误码:{0}" },
40-
// { "A.A3", "错误:{0}" },
41-
// }.ToFrozenDictionary();
42-
//
43-
// public string this[string key] => _strings[key] ?? fallback![key];
44-
//
45-
// public string IetfLanguageTag => "zh-hans";
46-
// }
47-
//
48-
// public class Lang_En(ILocalizedValues? fallback) : ILocalizedValues,
49-
// ILocalizedValues_A
50-
// {
51-
// private readonly FrozenDictionary<string, string> _strings = new Dictionary<string, string>
52-
// {
53-
// { "A.A1", "Words" },
54-
// { "A.A2", "Error code: {0}" },
55-
// { "A.A3", "Error: {0}" },
56-
// }.ToFrozenDictionary();
57-
//
58-
// public string this[string key] => _strings[key] ?? fallback![key];
59-
//
60-
// public string IetfLanguageTag => "en";
61-
// }

0 commit comments

Comments
 (0)