FullscreenUI: Fix controller strings not translating

This commit is contained in:
Stenzek 2023-10-12 19:29:09 +10:00
parent f9d8a49324
commit ad04f79e57
No known key found for this signature in database
2 changed files with 22 additions and 17 deletions

View File

@ -1344,6 +1344,9 @@ std::string FullscreenUI::GetEffectiveStringSetting(SettingsInterface* bsi, cons
void FullscreenUI::DrawInputBindingButton(SettingsInterface* bsi, InputBindingInfo::Type type, const char* section,
const char* name, const char* display_name, bool show_type)
{
if (type == InputBindingInfo::Type::Pointer)
return;
TinyString title;
title.fmt("{}/{}", section, name);
@ -3342,7 +3345,7 @@ void FullscreenUI::DrawControllerSettingsPage()
});
}
if (!ci || ci->bindings.empty() == 0)
if (!ci || ci->bindings.empty())
continue;
if (MenuButton(FSUI_ICONSTR(ICON_FA_MAGIC, "Automatic Mapping"),
@ -3352,7 +3355,10 @@ void FullscreenUI::DrawControllerSettingsPage()
}
for (const Controller::ControllerBindingInfo& bi : ci->bindings)
DrawInputBindingButton(bsi, bi.type, section.c_str(), bi.name, bi.display_name, true);
{
DrawInputBindingButton(bsi, bi.type, section.c_str(), bi.name,
Host::TranslateToCString(ci->name, bi.display_name), true);
}
if (mtap_enabled[mtap_port])
{
@ -3386,7 +3392,7 @@ void FullscreenUI::DrawControllerSettingsPage()
{
continue;
}
options.emplace_back(bi.display_name,
options.emplace_back(Host::TranslateToString(ci->name, bi.display_name),
std::any_of(buttons_split.begin(), buttons_split.end(),
[bi](const std::string_view& it) { return (it == bi.name); }));
}
@ -3398,7 +3404,7 @@ void FullscreenUI::DrawControllerSettingsPage()
std::string_view to_modify;
for (const Controller::ControllerBindingInfo& bi : ci->bindings)
{
if (bi.display_name == title)
if (title == Host::TranslateToStringView(ci->name, bi.display_name))
{
to_modify = bi.name;
break;
@ -3498,24 +3504,24 @@ void FullscreenUI::DrawControllerSettingsPage()
for (const SettingInfo& si : ci->settings)
{
TinyString title;
title.fmt(ICON_FA_COG "{}", si.display_name);
title.fmt(ICON_FA_COG "{}", Host::TranslateToStringView(ci->name, si.display_name));
const char* description = Host::TranslateToCString(ci->name, si.description);
switch (si.type)
{
case SettingInfo::Type::Boolean:
DrawToggleSetting(bsi, title, si.description, section.c_str(), si.name, si.BooleanDefaultValue(), true,
false);
DrawToggleSetting(bsi, title, description, section.c_str(), si.name, si.BooleanDefaultValue(), true, false);
break;
case SettingInfo::Type::Integer:
DrawIntRangeSetting(bsi, title, si.description, section.c_str(), si.name, si.IntegerDefaultValue(),
DrawIntRangeSetting(bsi, title, description, section.c_str(), si.name, si.IntegerDefaultValue(),
si.IntegerMinValue(), si.IntegerMaxValue(), si.format, true);
break;
case SettingInfo::Type::IntegerList:
DrawIntListSetting(bsi, title, si.description, section.c_str(), si.name, si.IntegerDefaultValue(),
si.options, 0, false, si.IntegerMinValue(), true, LAYOUT_MENU_BUTTON_HEIGHT,
g_large_font, g_medium_font, ci->name);
DrawIntListSetting(bsi, title, description, section.c_str(), si.name, si.IntegerDefaultValue(), si.options,
0, false, si.IntegerMinValue(), true, LAYOUT_MENU_BUTTON_HEIGHT, g_large_font,
g_medium_font, ci->name);
break;
case SettingInfo::Type::Float:
DrawFloatSpinBoxSetting(bsi, title, si.description, section.c_str(), si.name, si.FloatDefaultValue(),
DrawFloatSpinBoxSetting(bsi, title, description, section.c_str(), si.name, si.FloatDefaultValue(),
si.FloatMinValue(), si.FloatMaxValue(), si.FloatStepValue(), si.multiplier,
si.format, true);
break;
@ -3535,8 +3541,6 @@ void FullscreenUI::DrawHotkeySettingsPage()
BeginMenuButtons();
InputManager::GetHotkeyList();
const HotkeyInfo* last_category = nullptr;
for (const HotkeyInfo* hotkey : s_hotkey_list_cache)
{
@ -3546,7 +3550,8 @@ void FullscreenUI::DrawHotkeySettingsPage()
last_category = hotkey;
}
DrawInputBindingButton(bsi, InputBindingInfo::Type::Button, "Hotkeys", hotkey->name, hotkey->display_name, false);
DrawInputBindingButton(bsi, InputBindingInfo::Type::Button, "Hotkeys", hotkey->name,
Host::TranslateToCString("Hotkeys", hotkey->display_name), false);
}
EndMenuButtons();
@ -6100,7 +6105,7 @@ void FullscreenUI::DrawGameListSettingsPage(const ImVec2& heading_size)
for (const auto& it : s_game_list_directories_cache)
{
if (MenuButton(SmallString::from_fmt(ICON_FA_FOLDER "{}", it.first),
if (MenuButton(SmallString::from_fmt(ICON_FA_FOLDER " {}", it.first),
it.second ? FSUI_CSTR("Scanning Subdirectories") : FSUI_CSTR("Not Scanning Subdirectories")))
{
ImGuiFullscreen::ChoiceDialogOptions options = {

View File

@ -293,7 +293,7 @@ static constexpr const QtHost::GlyphInfo s_glyph_info[] = {
{
"zh-cn", "msyh.ttc", nullptr, "Hiragino Sans GB.ttc",
// auto update by generate_update_glyph_ranges.py with duckstation-qt_zh-cn.ts
u"“”……、。一丁三下不与且且丢丢两两个个中中临临为主么义之之乐乐也也了了予予事二于于互互亚些交交亦产享享人人仅仅今介仍从他他付付代以们们件价任任份份仿仿休休优会会传传伸伸但但位住体体何何余余作作佳佳使使例例供供依依侧侧便便保保信信修修倍倍倒倒候候值值假假偏偏停停储储像像允允充充先光免免入入全全公六共共关关其典兼兼内内册再写写冲决况况冻冻准准减减几几出击函函分切列列则则创创初初删删利利别别到到制刷前前剔剔剩剪力力功务动助勾勾包包化化匹区十十升升半半协协卓卓单单南南占卡即即卸卸压压原原去去参参叉及双反发发取变口口只只可台右右号号各各合合同后向向吗吗否否含听启启呈呈告告周周味味命命和和哈哈响响哪哪商商善善喜喜器器噪噪回回因因困困围围固固国图圆圆圈圈在在地地场场址址坏坐块块垂垂型型域域基基堆堆填填境境增增声声处处备备复复外外多多夜夜够够大大天太失失头头夹夹奏奏好好如如始始媒媒子子孔孔字存它它守安完完宏宏官官定定实实宫宫家家容容宽宽寄寄密密察察寸对寻导封封射射将将小小少少尚尚尝尝尤尤就就尺尺尼尾局局层层屏屏展展属属峰峰崩崩工左差差己已希希带帧帮帮常常幕幕平年并并序序库底度度延延建建开开异弃式式引引张张弦弦弱弱弹强当当录录形形彩彩影影彻彻征征径待很很得得心心必忆志志快快忽忽态态性性总总恢恢息息您您悬悬情情惯惯想想意意慢慢懂懂戏我或或战战截截户户所所扇扇手手才才打打执执扩扩扫扫扭扭扳扳批批找找把把抓抓投抖折折护报抱抱抹抹拉拉拟拟择择括括拷拷拿拿持持指指按按挎挎挑挑振振损损换换据据捷捷排排接接控推描提插插握握搜搜携携摇摇撤撤播播操操支支收收改改放放故故效效敏敏数数整整文文斗斗料料断断新新方方施施无无日旨时时明明易易星映昨昨是是显显景景暂暂暗暗曲曲更更替最有有服服望望期期未本机机权权杆杆束束条条来来板板构构析析果果枪枪某某染染查查标栈栏栏校校样根格格框框案案档档梦梦梳梳检检概概榜榜槽槽模模横横次欢欧欧欲欲歉歉止步死死段段每每比比毫毫水水求求汇汇池池没没法法波波注注洲洲活活派派流流浅浅测测浏浏消消涡涡深深混混添添清清渐渐渡渡渲渲游游溃溃源源滑滑滚滚滞滞滤滤潜潜澳澳激激灰灰灵灵点点炼炼热热焦焦然然照照爆爆片版牌牌牙牙物物特特状状独独率率玩玩环现理理瑕瑕瓶瓶生生用用由由电电画画畅畅界界留留略略疵疵登登百百的的监盒盖盖盘盘目目直直相相看看真眠着着瞬瞬瞰瞰知知矫矫码码破破硬硬确确碎碎碰碰磁磁示示禁禁离离种种秒秒称称移移程程稍稍稳稳空空突突窗窗立立站站端端笔笔第第等等筛筛签签简简算算管管类类精精系系素素索索红红约级纯纯纵纵纹纹线线组组细细终终经经绑绑结结绘给络络统统继继绩绩续续维维绿绿缓缓编编缘缘缩缩网网置置美美翻翻者者而而耐耐耗耗联联背背能能脑脑自自致致般般色色节节若若范范荐荐获获菜菜著著蓝蓝藏藏虚虚行行补补表表衷衷被被裁裂装装要要覆覆见观规规视视览觉角角解解触触言言警警计订认认议议记记许许论论设访证证识识译译试试该详语语误误说说请诸读读调调象象贝贝负负败账质质贴贴费费资资赖赖起起超超越越足足跃跃距距跟跟跨跨路路跳跳踪踪身身轨轨转转轮软轴轴载载较较辑辑输输辨辨边边达达过过运近返返还这进远连迟述述追追退适逆逆选选透透通通速造遇遇道道遥遥遵遵避避那那邻邻部部都都配配醒醒采采释释里量金金针针钟钟钮钮链链锁锁锐锐错错键锯镜镜长长闭问间间阈阈防防阻阻降降限限除除险险随隐隔隔障障难难集集需需震震静静非非靠靠面面音音页顶项须顿顿预预颈颈频频题题颜额风风驱驱验验高高黑黑默默鼠鼠齿齿,,::??"
u"——“”……、。一丁三下不与且且丢丢两两个个中中临临为主么义之之乐乐也也了了予予事二于于互互亚些交交亦产享享人人仅仅今介仍从他他付付代以们们件价任任份份仿仿休休优会会传传伸伸但但位住体体何何余余作作佳佳使使例例供供依依侧侧便便保保信信修修倍倍倒倒候候借借值值假假偏偏停停储储像像允允元元充充先光免免入入全全公六共共关关其典兼兼内内册再写写冲决况况冻冻准准减减几几出击函函分切列列则则创创初初删删利利别别到到制刷前前剔剔剩剪力力功务动助勾勾包包化化匹区十十升升半半协协卓卓单单南南占卡即即卸卸压压原原去去参参叉及双反发发取变叠叠口口只只可台右右号号各各合合同后向向吗吗否否含听启启呈呈告告周周味味命命和和哈哈响响哪哪商商善善喜喜器器噪噪回回因因困困围围固固国图圆圆圈圈在在地地场场址址坏坐块块垂垂型型域域基基堆堆填填境境增增声声处处备备复复外外多多夜夜够够大大天太失失头头夹夹奏奏好好如如始始媒媒子子孔孔字存它它守安完完宏宏官官定定实实宫宫家家容容宽宽寄寄密密察察寸对寻导封封射射将将小小少少尚尚尝尝尤尤就就尺尺尼尾局局层层屏屏展展属属峰峰崩崩工左差差己已希希带帧帮帮常常幕幕平年并并序序库底度度延延建建开开异弃式式引引张张弦弦弱弱弹强当当录录形形彩彩影影彻彻征征径待很很律律得得心心必忆志志快快忽忽态态性性总总恢恢息息您您悬悬情情惯惯想想愉愉意意慢慢懂懂戏我或或战战截截戳戳户户所所扇扇手手才才打打执执扩扩扫扫扭扭扳扳批批找找把把抓抓投抖折折护报抱抱抹抹拉拉拟拟拥拥择择括括拷拷拿拿持持指指按按挎挎挑挑振振损损换换据据捷捷掌掌排排接接控推描提插插握握搜搜携携摇摇撤撤播播操操支支收收改改放放故故效效敏敏数数整整文文斗斗料料断断新新方方施施无无日旨时时明明易易星映昨昨是是显显景景暂暂暗暗曲曲更更替最有有服服望望期期未本机机权权杆杆束束条条来来板板构构析析果果枪枪柄柄某某染染查查标栈栏栏校校样根格格框框案案档档梦梦梳梳检检概概榜榜槽槽模模横横次欢欧欧欲欲歉歉止步死死段段每每比比毫毫水水求求汇汇池池没没法法波波注注洲洲活活派派流流浅浅测测浏浏消消涡涡深深混混添添清清渐渐渡渡渲渲游游溃溃源源滑滑滚滚滞滞滤滤演演潜潜澳澳激激灰灰灵灵点点炼炼热热焦焦然然照照爆爆片版牌牌牙牙物物特特状状独独率率玩玩环现理理瑕瑕瓶瓶生生用用由由电电画画畅畅界界留留略略疵疵登登百百的的监盒盖盖盘盘目目直直相相看看真眠着着瞄瞄瞬瞬知知矫矫码码破破硬硬确确碎碎碰碰磁磁示示禁禁离离种种秒秒称称移移程程稍稍稳稳空空突突窗窗立立站站端端笔笔符符第第等等筛筛签签简简算算管管类类精精系系素素索索红红约级纯纯纵纵纹纹线线组组细细终终经经绑绑结结绘给络络统统继继绩绩续续维维绿绿缓缓编编缘缘缩缩缺缺网网置置美美翻翻者者而而耐耐耗耗联联背背能能脑脑自自致致航航般般色色节节若若范范荐荐获获菜菜著著蓝蓝藏藏虚虚行行补补表表衷衷被被裁裂装装要要覆覆见观规规视视览觉角角解解触触言言警警计订认认议议记记许许论论设访证证识识译译试试话话该详语语误误说说请诸读读调调象象贝贝负负败账质质贴贴费费资资赖赖起起超超越越足足跃跃距距跟跟跨跨路路跳跳踪踪身身车车轨轨转转轮软轴轴载载较较辑辑输输辨辨边边达达过过迎迎运近返返还这进远连迟述述追追退适逆逆选选透透通通速造遇遇道道遥遥遵遵避避那那邻邻部部都都配配醒醒采采释释里量金金针针钟钟钮钮链链锁锁锐锐错错键锯镜镜长长闭问间间阈阈防防阻阻附附降降限限除除险险随隐隔隔障障难难集集需需震震静静非非靠靠面面音音页顶项须顿顿预预颈颈频频题题颜额风风驱驱验验骤骤高高黑黑默默鼠鼠齿齿"
},
};
// clang-format on