多语言逻辑

This commit is contained in:
bob
2025-06-13 17:35:29 +08:00
parent f862c7514c
commit e060f9eb02
18 changed files with 561 additions and 221 deletions

View File

@@ -47,7 +47,15 @@ namespace NBF
{
var tabData = tabList[i];
var tabItem = List.AddItemFromPool().asButton;
tabItem.title = Lan.Get(tabData.Name);
if (!string.IsNullOrEmpty(tabData.Key))
{
tabItem.SetLanguage(tabData.Key);
}
else
{
tabItem.SetLanguage(tabData.Name);
}
listWidth += tabItem.width;
if (i > 0)
{

View File

@@ -47,7 +47,7 @@ namespace NBF
{
var tabData = subItems[i];
var tabItem = List.AddItemFromPool().asButton;
tabItem.title = Lan.Get(tabData.Name);
tabItem.SetLanguage(tabData.Name);
width += tabItem.width;
if (i > 0)
{

View File

@@ -25,17 +25,17 @@ namespace NBF
{
if (string.IsNullOrEmpty(title))
{
title = Lan.Get("TEXT_NOTE");
title = "TEXT_NOTE";
}
if (string.IsNullOrEmpty(confirm))
{
confirm = Lan.Get("TEXT_CONFIRM");
confirm = "TEXT_CONFIRM";
}
if (string.IsNullOrEmpty(cancel))
{
cancel = Lan.Get("TEXT_CANCEL");
cancel = "TEXT_CANCEL";
}
_confirmText = confirm;
@@ -59,10 +59,10 @@ namespace NBF
protected override void OnShow()
{
TextTitle.text = _title;
BtnConfirm.title = _confirmText;
BtnCancel.title = _cancelText;
TextContent.text = _content;
TextTitle.SetLanguage(_title);
BtnConfirm.SetLanguage(_confirmText);
BtnCancel.SetLanguage(_cancelText);
TextContent.SetLanguage(_content);
MessageStyle.selectedIndex = _style;
}