Support Chinese language

This commit is contained in:
stax76
2023-12-08 21:33:10 +01:00
parent 8d601525b5
commit f937273fe3
16 changed files with 1860 additions and 1966 deletions

View File

@@ -9,7 +9,7 @@ public class WpfTranslator : ITranslator
{
static Language[] Languages { get; } = new Language[] {
new("english", "en", "en"),
new("chinese-china", "zh-Hans", "zh"), // Chinese (Simplified)
new("chinese-china", "zh-CN", "zh"), // Chinese (Simplified)
new("german", "de", "de"),
};
@@ -44,7 +44,7 @@ public class WpfTranslator : ITranslator
if (lang.MpvNetName == name)
return new CultureInfo(lang.CultureInfoName);
throw new Exception($"Unknown language {name}.");
return new CultureInfo("en");
}
class Language

View File

@@ -1,4 +1,4 @@
using System;

using System.Globalization;
using System.Windows.Data;
@@ -10,7 +10,7 @@ namespace NGettext.Wpf.Common
public GettextStringFormatConverter(string msgId)
{
this.MsgId = msgId;
MsgId = msgId;
}
public static ILocalizer Localizer { get; set; }
@@ -25,4 +25,4 @@ namespace NGettext.Wpf.Common
throw new NotImplementedException();
}
}
}
}

View File

@@ -1,4 +1,4 @@
using System;

using System.Globalization;
namespace NGettext.Wpf
@@ -13,4 +13,4 @@ namespace NGettext.Wpf
public CultureInfo CultureInfo { get; }
}
}
}

View File

@@ -1,5 +1,4 @@
using System;
using System.Linq;

using System.Reflection;
namespace NGettext.Wpf.EnumTranslation

View File

@@ -1,5 +1,4 @@
using System;

namespace NGettext.Wpf.EnumTranslation
{
public class EnumMsgIdAttribute : Attribute
@@ -11,4 +10,4 @@ namespace NGettext.Wpf.EnumTranslation
public string MsgId { get; }
}
}
}

View File

@@ -1,4 +1,4 @@
using System;

using System.Globalization;
using System.Windows.Data;

View File

@@ -1,5 +1,5 @@
using System.Reflection;
using System.Runtime.CompilerServices;

using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following