Skip to content

Commit

Permalink
add CN I18N
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiraSora committed Oct 14, 2024
1 parent ad0c638 commit 7f2f7ec
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
14 changes: 8 additions & 6 deletions OngekiFumenEditor/Base/Attributes/ObjectPropertyBrowserAlias.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ public ObjectPropertyBrowserAlias(string alias = default)
[AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public class LocalizableObjectPropertyBrowserAlias : ObjectPropertyBrowserAlias
{
public LocalizableObjectPropertyBrowserAlias(string key)
public LocalizableObjectPropertyBrowserAlias(string resourceKey)
{
#if DEBUG
if (key == default) {
if (resourceKey == default)
{
throw new ArgumentException("cannot use empty string as resource key");
}
if (Resources.ResourceManager.GetString(key) is null) {
throw new ArgumentException($"invalid resource key \"{key}\"");
if (Resources.ResourceManager.GetString(resourceKey) is null)
{
throw new ArgumentException($"invalid resource key \"{resourceKey}\"");
}
#endif
Alias = Resources.ResourceManager.GetString(key!) ?? string.Empty;

Alias = Resources.ResourceManager.GetString(resourceKey!) ?? string.Empty;
}
}
}
18 changes: 18 additions & 0 deletions OngekiFumenEditor/Properties/Resources.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1662,9 +1662,24 @@
<data name="Save" xml:space="preserve">
<value>保存</value>
</data>
<data name="BulletPaletteCreateBullet" xml:space="preserve">
<value>Bullet</value>
</data>
<data name="ClickToClonePalette" xml:space="preserve">
<value>点击克隆新模板</value>
</data>
<data name="BulletPaletteCreateBell" xml:space="preserve">
<value>Bell</value>
</data>
<data name="CopiedObjectsBrushAllowed" xml:space="preserve">
<value>已复制 {} 个物件(并可用在刷子模式)</value>
</data>
<data name="DragToCreateHoldEndTipText" xml:space="preserve">
<value>拖动生成HoldEnd物件</value>
</data>
<data name="DragToCreateNextToolTip" xml:space="preserve">
<value>可拖动到编辑器界面生成新的物件</value>
</data>
<data name="ObjectId" xml:space="preserve">
<value>Id</value>
</data>
Expand All @@ -1674,6 +1689,9 @@
<data name="SelectFile" xml:space="preserve">
<value>选择文件</value>
</data>
<data name="VisualEditorLaneColorSettings" xml:space="preserve">
<value>轨道颜色</value>
</data>
<data name="BellBulletCountOverLimit_Sep" xml:space="preserve">
<value>时,</value>
</data>
Expand Down

0 comments on commit 7f2f7ec

Please sign in to comment.