Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.
Swift apple-siliconcustom-formathomebrewiosipaipadipadosiphonemetalnative-portnintendo-switchnxnativeromfsswitch-games
The iOS shell shows a game's settings rows in the player's language (#429)
v0lumehi31c963032d3e
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlindex ca033fc9..cf295a53 100644--- a/.github/workflows/tests.yml+++ b/.github/workflows/tests.yml@@ -176,7 +176,7 @@ jobs:- name: Install the signing tool's package (tools/release_manifest.py)run: python -m pip install -r tools/requirements-release.txt- name: Patch, engine and release tool tests- run: python -m unittest -v tools/tests/test_patches.py tools/tests/test_engine.py tools/tests/test_release_manifest.py tools/tests/test_release_notes.py tools/tests/test_app_version.py tools/tests/test_l10n_shell_catalogs.py+ run: python -m unittest -v tools/tests/test_patches.py tools/tests/test_engine.py tools/tests/test_release_manifest.py tools/tests/test_release_notes.py tools/tests/test_app_version.py tools/tests/test_l10n_shell_catalogs.py tools/tests/test_launcher_texts.py- name: Dry bump to seedds main (report only)run: python tools/engine.py bump --dry --to main || truediff --git a/frontend-ios/README.md b/frontend-ios/README.mdindex 85066b72..ac224696 100644--- a/frontend-ios/README.md+++ b/frontend-ios/README.md@@ -100,7 +100,7 @@ Choice rows with 2 to 4 short labels that fit their equal segment (`ChoicePresenController first: the D-pad and stick move a cream focus ring, A activates, B backs out, X opens settings, Y opens controllers. In Cover Flow, left and right move the carousel by one card and the focused card is always the middle one. A hardware keyboard works the same way: arrows, Return, Escape, O for settings and Y for controllers. Touch hides the focus ring and the controller hints until the next press. In Cover Flow the centred card is the button: a tap does what the game needs, a tap on a side card brings it to the middle, a long press opens its settings.-Manrope and its SIL OFL licence are bundled and registered at runtime, with the system font as fallback. Reduce Motion turns the Cover Flow tilt and the slides into plain crossfades. Shell strings are lines of `frontend/l10n/<code>.json` (`ios.ui.*` for ShellUI, `ios.host.*` for ShellHost), and `Resources/Localizable.xcstrings` of ShellUI and ShellHost is generated from them by `python3 tools/l10n_shell_catalogs.py`. Do not edit the catalogs by hand, see `frontend/README.md`, section "Language".+Manrope and its SIL OFL licence are bundled and registered at runtime, with the system font as fallback. Reduce Motion turns the Cover Flow tilt and the slides into plain crossfades. Shell strings are lines of `frontend/l10n/<code>.json` (`ios.ui.*` for ShellUI, `ios.host.*` for ShellHost), and `Resources/Localizable.xcstrings` of ShellUI and ShellHost is generated from them by `python3 tools/l10n_shell_catalogs.py`. Do not edit the catalogs by hand, see `frontend/README.md`, section "Language". The rows of a game's settings screen come from its English `launcher.json`: `SettingRow`, `SettingOption` and `SettingSection` look their texts up in the ShellUI catalog by the English words (`ShellStrings.setting`), and a text with no entry stays English. The catalog has the `launch.*` texts of the Mac launcher for this, and `tools/tests/test_launcher_texts.py` fails with the missing text when a pin bump brings a new one.## Demodiff --git a/frontend-ios/Sources/ShellUI/Resources/Localizable.xcstrings b/frontend-ios/Sources/ShellUI/Resources/Localizable.xcstringsindex 54790553..9712d9e4 100644--- a/frontend-ios/Sources/ShellUI/Resources/Localizable.xcstrings+++ b/frontend-ios/Sources/ShellUI/Resources/Localizable.xcstrings@@ -17,962 +17,2628 @@}}},- "A little room for adventure": {+ "30 fps": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "30 fps"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "A little room for adventure"+ "value": "30 fps"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "给冒险留一点空间"+ "value": "30 i/s"}- }- }- },- "App update needed": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "App update needed"+ "value": "30 fps"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "需要更新 App"+ "value": "30 fps"}}}},- "Back": {+ "60 fps": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "60 fps"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Back"+ "value": "60 fps"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "返回"+ "value": "60 i/s"}- }- }- },- "Brings back the settings this game was tested with.": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Brings back the settings this game was tested with."+ "value": "60 fps"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "恢复此游戏测试时使用的设置。"+ "value": "60 fps"}}}},- "Build this game again on your Mac and install it on this device. The Mac app checks every file while it builds, so the new copy is complete.": {+ "A little room for adventure": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Build this game again on your Mac and install it on this device. The Mac app checks every file while it builds, so the new copy is complete."+ "value": "A little room for adventure"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "在 Mac 上重新构建此游戏并安装到本设备。Mac 应用构建时会检查每个文件,新副本是完整的。"+ "value": "给冒险留一点空间"}}}},- "Charging": {+ "Adjusts resolution between 70% and 100% under load. Turn off to keep full resolution for the selected console mode.": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Passt die Auflösung unter Last zwischen 70 % und 100 % an. Ausschalten, um die volle Auflösung des gewählten Konsolenmodus zu behalten."+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Charging"+ "value": "Adjusts resolution between 70% and 100% under load. Turn off to keep full resolution for the selected console mode."}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "充电中"+ "value": "Ajuste la résolution entre 70 % et 100 % selon la charge. Désactivez pour garder la pleine résolution du mode choisi."}- }- }- },- "Choose": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Choose"+ "value": "Anpassar upplösningen mellan 70 % och 100 % under belastning. Stäng av för att behålla full upplösning för det valda konsolläget."}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "选择"+ "value": "负载较高时在 70% 到 100% 之间调整分辨率。关闭后保持所选主机模式的完整分辨率。"}}}},- "Choose folder…": {+ "American English": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Amerikanisches Englisch"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Choose folder…"+ "value": "American English"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "选择文件夹…"+ "value": "Anglais (États-Unis)"}- }- }- },- "Choose game data…": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Choose game data…"+ "value": "Amerikansk engelska"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "选择游戏数据…"+ "value": "美式英语"}}}},- "Choose the same iCloud Drive folder you use on your Mac.": {+ "App update needed": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Choose the same iCloud Drive folder you use on your Mac."+ "value": "App update needed"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "选择与 Mac 上相同的 iCloud Drive 文件夹。"+ "value": "需要更新 App"}}}},- "Choose this game's data to get ready to play.": {+ "Back": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Choose this game's data to get ready to play."+ "value": "Back"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "选择此游戏的数据以开始游戏。"+ "value": "返回"}}}},- "Choose…": {+ "Brazilian Portuguese": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Brasilianisches Portugiesisch"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Choose…"+ "value": "Brazilian Portuguese"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "选择…"+ "value": "Portugais (Brésil)"}- }- }- },- "Close controllers": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Close controllers"+ "value": "Brasiliansk portugisiska"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "关闭手柄列表"+ "value": "巴西葡萄牙语"}}}},- "Cloud saves": {+ "Brings back the settings this game was tested with.": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Cloud saves"+ "value": "Brings back the settings this game was tested with."}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "云存档"+ "value": "恢复此游戏测试时使用的设置。"}}}},- "Connect a controller in Bluetooth settings. Touch controls are always available in the library.": {+ "British English": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Britisches Englisch"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Connect a controller in Bluetooth settings. Touch controls are always available in the library."+ "value": "British English"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "在蓝牙设置中连接手柄。触屏控制始终可用。"+ "value": "Anglais (Royaume-Uni)"}- }- }- },- "Controllers": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Controllers"+ "value": "Brittisk engelska"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "手柄"+ "value": "英式英语"}}}},- "Decrease": {+ "Build this game again on your Mac and install it on this device. The Mac app checks every file while it builds, so the new copy is complete.": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Decrease"+ "value": "Build this game again on your Mac and install it on this device. The Mac app checks every file while it builds, so the new copy is complete."}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "减小"+ "value": "在 Mac 上重新构建此游戏并安装到本设备。Mac 应用构建时会检查每个文件,新副本是完整的。"}}}},- "Details": {+ "Canadian French": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Kanadisches Französisch"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Details"+ "value": "Canadian French"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "详情"+ "value": "Français (Canada)"}- }- }- },- "Done": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Done"+ "value": "Kanadensisk franska"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "完成"+ "value": "加拿大法语"}}}},- "Double-tap to select": {+ "Charging": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Double-tap to select"+ "value": "Charging"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "轻点两下以选择"+ "value": "充电中"}}}},- "For a bug report": {+ "Choose": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "For a bug report"+ "value": "Choose"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "用于问题报告"+ "value": "选择"}}}},- "From Settings": {+ "Choose folder…": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "From Settings"+ "value": "Choose folder…"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "来自设置"+ "value": "选择文件夹…"}}}},- "Game data": {+ "Choose game data…": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Game data"+ "value": "Choose game data…"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "游戏数据"+ "value": "选择游戏数据…"}}}},- "Game settings": {+ "Choose the same iCloud Drive folder you use on your Mac.": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Game settings"+ "value": "Choose the same iCloud Drive folder you use on your Mac."}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "游戏设置"+ "value": "选择与 Mac 上相同的 iCloud Drive 文件夹。"}}}},- "Games look for their data here. Keep one romfs.img per game in any folder inside. Each game is found by the image itself, so the folder names do not matter. Each game can also have a folder of its own.": {+ "Choose this game's data to get ready to play.": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Games look for their data here. Keep one romfs.img per game in any folder inside. Each game is found by the image itself, so the folder names do not matter. Each game can also have a folder of its own."+ "value": "Choose this game's data to get ready to play."}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "游戏会在这里查找游戏数据。请在其中的任意文件夹里为每个游戏放一个 romfs.img。应用会按镜像本身识别游戏,所以文件夹名称不限。每个游戏也可以单独指定文件夹。"+ "value": "选择此游戏的数据以开始游戏。"}}}},- "Games without a folder of their own save here. Choose the same iCloud Drive folder you use on your Mac.": {+ "Choose…": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Games without a folder of their own save here. Choose the same iCloud Drive folder you use on your Mac."+ "value": "Choose…"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "没有单独指定文件夹的游戏会把存档保存在这里。请选择与 Mac 相同的 iCloud Drive 文件夹。"+ "value": "选择…"}}}},- "How to fix": {+ "Close controllers": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "How to fix"+ "value": "Close controllers"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "如何修复"+ "value": "关闭手柄列表"}}}},- "How to update": {+ "Cloud saves": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "How to update"+ "value": "Cloud saves"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "如何更新"+ "value": "云存档"}}}},- "Increase": {+ "Connect a controller in Bluetooth settings. Touch controls are always available in the library.": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Increase"+ "value": "Connect a controller in Bluetooth settings. Touch controls are always available in the library."}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "增大"+ "value": "在蓝牙设置中连接手柄。触屏控制始终可用。"}}}},- "Install a newer version of this app to play this game.": {+ "Console mode": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Konsolenmodus"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Install a newer version of this app to play this game."+ "value": "Console mode"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "安装本 App 的更新版本以游玩此游戏。"+ "value": "Mode de la console"}- }- }- },- "Interface": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Interface"+ "value": "Konsolläge"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "界面"+ "value": "主机模式"}}}},- "Library": {+ "Controllers": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Library"+ "value": "Controllers"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "游戏库"+ "value": "手柄"}}}},- "Move between controls": {+ "Controls": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Steuerung"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Move between controls"+ "value": "Controls"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "在控件之间移动"+ "value": "Commandes"}- }- }- },- "Needs game data": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Needs game data"+ "value": "Kontroller"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "需要游戏数据"+ "value": "控制"}}}},- "No additional content": {+ "Decrease": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "No additional content"+ "value": "Decrease"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "无附加内容"+ "value": "减小"}}}},- "No battery level": {+ "Details": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Details"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "详情"+ }+ }+ }+ },+ "Display mode": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Anzeigemodus"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Display mode"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Mode d’affichage"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Visningsläge"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "显示模式"+ }+ }+ }+ },+ "Docked": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Angedockt"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Docked"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "TV"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Dockad"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "底座模式"+ }+ }+ }+ },+ "Done": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Done"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "完成"+ }+ }+ }+ },+ "Double-tap to select": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Double-tap to select"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "轻点两下以选择"+ }+ }+ }+ },+ "Dutch": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Niederländisch"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Dutch"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Néerlandais"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Nederländska"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "荷兰语"+ }+ }+ }+ },+ "Dynamic resolution": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Dynamische Auflösung"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Dynamic resolution"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Résolution dynamique"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Dynamisk upplösning"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "动态分辨率"+ }+ }+ }+ },+ "Encode thread": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Encode-Thread"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Encode thread"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Thread d’encodage"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Kodningstråd"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "编码线程"+ }+ }+ }+ },+ "For a bug report": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "For a bug report"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "用于问题报告"+ }+ }+ }+ },+ "Frame buffering": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Bildpufferung"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Frame buffering"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Mise en mémoire tampon"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Bildbuffring"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "帧缓冲"+ }+ }+ }+ },+ "Frame rate": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Bildrate"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Frame rate"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Fréquence d’images"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Bildfrekvens"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "帧率"+ }+ }+ }+ },+ "Frame-rate counter": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Bildraten-Anzeige"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Frame-rate counter"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Compteur d’images par seconde"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Bildfrekvensräknare"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "帧率显示"+ }+ }+ }+ },+ "French": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Französisch"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "French"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Français"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Franska"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "法语"+ }+ }+ }+ },+ "From Settings": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "From Settings"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "来自设置"+ }+ }+ }+ },+ "Fullscreen": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Vollbild"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Fullscreen"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Plein écran"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Helskärm"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "全屏"+ }+ }+ }+ },+ "Game": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Spiel"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Game"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Jeu"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Spel"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "游戏"+ }+ }+ }+ },+ "Game data": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Game data"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "游戏数据"+ }+ }+ }+ },+ "Game language": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Spielsprache"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Game language"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Langue du jeu"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Spelspråk"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "游戏语言"+ }+ }+ }+ },+ "Game rumble": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Spiel-Vibration"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Game rumble"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Vibrations du jeu"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Spelvibration"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "游戏震动"+ }+ }+ }+ },+ "Game settings": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Game settings"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "游戏设置"+ }+ }+ }+ },+ "Games look for their data here. Keep one romfs.img per game in any folder inside. Each game is found by the image itself, so the folder names do not matter. Each game can also have a folder of its own.": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Games look for their data here. Keep one romfs.img per game in any folder inside. Each game is found by the image itself, so the folder names do not matter. Each game can also have a folder of its own."+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "游戏会在这里查找游戏数据。请在其中的任意文件夹里为每个游戏放一个 romfs.img。应用会按镜像本身识别游戏,所以文件夹名称不限。每个游戏也可以单独指定文件夹。"+ }+ }+ }+ },+ "Games without a folder of their own save here. Choose the same iCloud Drive folder you use on your Mac.": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Games without a folder of their own save here. Choose the same iCloud Drive folder you use on your Mac."+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "没有单独指定文件夹的游戏会把存档保存在这里。请选择与 Mac 相同的 iCloud Drive 文件夹。"+ }+ }+ }+ },+ "German": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Deutsch"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "German"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Allemand"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Tyska"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "德语"+ }+ }+ }+ },+ "Handheld": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Handheld"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Handheld"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Portable"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Handhållen"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "掌机模式"+ }+ }+ }+ },+ "Hold frames when late": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Bilder halten, wenn sie zu spät sind"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Hold frames when late"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Maintenir l’image en cas de retard"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Håll bilder när de är sena"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "帧延迟时保持"+ }+ }+ }+ },+ "How to fix": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "How to fix"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "如何修复"+ }+ }+ }+ },+ "How to update": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "How to update"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "如何更新"+ }+ }+ }+ },+ "Increase": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Increase"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "增大"+ }+ }+ }+ },+ "Install a newer version of this app to play this game.": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Install a newer version of this app to play this game."+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "安装本 App 的更新版本以游玩此游戏。"+ }+ }+ }+ },+ "Interface": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Interface"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "界面"+ }+ }+ }+ },+ "Italian": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Italienisch"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Italian"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Italien"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Italienska"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "意大利语"+ }+ }+ }+ },+ "Japanese": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Japanisch"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Japanese"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Japonais"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Japanska"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "日语"+ }+ }+ }+ },+ "Keeps a pipeline archive and uses more memory.": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Behält ein Pipeline-Archiv und braucht mehr Speicher."+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Keeps a pipeline archive and uses more memory."+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Conserve une archive de pipelines et utilise plus de mémoire."+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Behåller ett pipelinearkiv och använder mer minne."+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "保留管线存档,占用更多内存。"+ }+ }+ }+ },+ "Keeps a pipeline archive; uses more memory.": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Behält ein Pipeline-Archiv und braucht mehr Speicher."+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Keeps a pipeline archive; uses more memory."+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Conserve une archive de pipelines et utilise plus de mémoire."+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Behåller ett pipelinearkiv och använder mer minne."+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "保留管线存档,占用更多内存。"+ }+ }+ }+ },+ "Korean": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Koreanisch"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Korean"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Coréen"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Koreanska"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "韩语"+ }+ }+ }+ },+ "Latin American Spanish": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Lateinamerikanisches Spanisch"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Latin American Spanish"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Espagnol (Amérique latine)"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Latinamerikansk spanska"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "拉丁美洲西班牙语"+ }+ }+ }+ },+ "Library": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Library"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "游戏库"+ }+ }+ }+ },+ "Metal 4 pipelines": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Metal-4-Pipelines"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Metal 4 pipelines"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Pipelines Metal 4"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Metal 4-pipelines"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "Metal 4 管线"+ }+ }+ }+ },+ "MetalFX": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "MetalFX"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "MetalFX"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "MetalFX"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "MetalFX"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "MetalFX"+ }+ }+ }+ },+ "Move between controls": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Move between controls"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "在控件之间移动"+ }+ }+ }+ },+ "Needs game data": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Needs game data"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "需要游戏数据"+ }+ }+ }+ },+ "No additional content": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "No additional content"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "无附加内容"+ }+ }+ }+ },+ "No battery level": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "No battery level"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "无电量信息"+ }+ }+ }+ },+ "No controllers connected": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "No controllers connected"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "未连接手柄"+ }+ }+ }+ },+ "No data selected": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "No data selected"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "未选择数据"+ }+ }+ }+ },+ "No folder chosen": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "No folder chosen"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "未选择文件夹"+ }+ }+ }+ },+ "Off": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Off"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "关"+ }+ }+ }+ },+ "On": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "On"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "开"+ }+ }+ }+ },+ "On a controller": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "On a controller"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "在手柄上"+ }+ }+ }+ },+ "Performance": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Leistung"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Performance"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Performances"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Prestanda"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "性能"+ }+ }+ }+ },+ "Performance HUD": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Leistungsanzeige"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Performance HUD"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "HUD de performances"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Prestandaöversikt"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "性能 HUD"+ }+ }+ }+ },+ "Performance overlay": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Performance overlay"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "性能浮层"+ }+ }+ }+ },+ "Pipeline prebuild": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Pipelines vorab erstellen"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Pipeline prebuild"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Précompilation des pipelines"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Förbygg pipelines"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "预先构建管线"+ }+ }+ }+ },+ "Play": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Play"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "开始"+ }+ }+ }+ },+ "Played %@": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Played %@"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "%@ 玩过"+ }+ }+ }+ },+ "Played today": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Played today"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "今天玩过"+ }+ }+ }+ },+ "Played yesterday": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Played yesterday"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "昨天玩过"+ }+ }+ }+ },+ "Portuguese": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Portugiesisch"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Portuguese"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Portugais"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Portugisiska"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "葡萄牙语"+ }+ }+ }+ },+ "Ready to play": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Ready to play"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "随时可玩"+ }+ }+ }+ },+ "Recently played": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Recently played"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "最近游玩"+ }+ }+ }+ },+ "Remove": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Remove"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "移除"+ }+ }+ }+ },+ "Render scale": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Render-Skalierung"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Render scale"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Échelle de rendu"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Renderskala"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "渲染比例"+ }+ }+ }+ },+ "Reset to tested defaults": {+ "localizations": {+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Reset to tested defaults"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "恢复测试默认值"+ }+ }+ }+ },+ "Rumble cutoff": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Vibrationsschwelle"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Rumble cutoff"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Seuil des vibrations"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Vibrationsgräns"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "震动下限"+ }+ }+ }+ },+ "Rumble strength": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Vibrationsstärke"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "No battery level"+ "value": "Rumble strength"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Intensité des vibrations"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Vibrationsstyrka"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "无电量信息"+ "value": "震动强度"}}}},- "No controllers connected": {+ "Russian": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Russisch"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "No controllers connected"+ "value": "Russian"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "未连接手柄"+ "value": "Russe"}- }- }- },- "No data selected": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "No data selected"+ "value": "Ryska"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "未选择数据"+ "value": "俄语"}}}},- "No folder chosen": {+ "Select": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "No folder chosen"+ "value": "Select"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "未选择文件夹"+ "value": "选择"}}}},- "Off": {+ "Settings": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Off"+ "value": "Settings"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "关"+ "value": "设置"}}}},- "On": {+ "Show log": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "On"+ "value": "Show log"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "开"+ "value": "显示日志"}}}},- "On a controller": {+ "Simplified Chinese": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Vereinfachtes Chinesisch"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "On a controller"+ "value": "Simplified Chinese"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "在手柄上"+ "value": "Chinois simplifié"}- }- }- },- "Performance overlay": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Performance overlay"+ "value": "Förenklad kinesiska"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "性能浮层"+ "value": "简体中文"}}}},- "Play": {+ "Spanish": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Spanisch"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Play"+ "value": "Spanish"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "开始"+ "value": "Espagnol"}- }- }- },- "Played %@": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Played %@"+ "value": "Spanska"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "%@ 玩过"+ "value": "西班牙语"}}}},- "Played today": {+ "Standard": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Standard"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Played today"+ "value": "Standard"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "今天玩过"+ "value": "Standard"}- }- }- },- "Played yesterday": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Played yesterday"+ "value": "Standard"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "昨天玩过"+ "value": "标准"}}}},- "Ready to play": {+ "The first start waits a few minutes for it, once.": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Der erste Start wartet dafür einmalig einige Minuten."+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Ready to play"+ "value": "The first start waits a few minutes for it, once."}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "随时可玩"+ "value": "Le premier démarrage l’attend quelques minutes, une seule fois."}- }- }- },- "Recently played": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Recently played"+ "value": "Första starten väntar några minuter på det, en gång."}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "最近游玩"+ "value": "首次启动需要等待几分钟,仅此一次。"}}}},- "Remove": {+ "This game needs a newer version of this app. Update it with the Mac app on your Mac, then install it on this device again.": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Remove"+ "value": "This game needs a newer version of this app. Update it with the Mac app on your Mac, then install it on this device again."}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "移除"+ "value": "此游戏需要本 App 的更新版本。请在 Mac 应用中更新。"}}}},- "Reset to tested defaults": {+ "Title ID %@": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Reset to tested defaults"+ "value": "Title ID %@"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "恢复测试默认值"+ "value": "Title ID %@"}}}},- "Select": {+ "Touch feedback": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Touch-Feedback"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Select"+ "value": "Touch feedback"}},- "zh-Hans": {+ "fr": {"stringUnit": {"state": "translated",- "value": "选择"+ "value": "Retour tactile"}- }- }- },- "Settings": {- "localizations": {- "en": {+ },+ "sv": {"stringUnit": {"state": "translated",- "value": "Settings"+ "value": "Beröringsåterkoppling"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "设置"+ "value": "触控反馈"}}}},- "Show log": {+ "Traditional Chinese": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Traditionelles Chinesisch"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Show log"+ "value": "Traditional Chinese"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Chinois traditionnel"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Traditionell kinesiska"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "显示日志"+ "value": "繁体中文"}}}},- "This game needs a newer version of this app. Update it with the Mac app on your Mac, then install it on this device again.": {+ "Turn off": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "This game needs a newer version of this app. Update it with the Mac app on your Mac, then install it on this device again."+ "value": "Turn off"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "此游戏需要本 App 的更新版本。请在 Mac 应用中更新。"+ "value": "关闭"}}}},- "Title ID %@": {+ "Turn off cloud saves": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Title ID %@"+ "value": "Turn off cloud saves"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "Title ID %@"+ "value": "关闭云存档"}}}},- "Turn off": {+ "Unavailable": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Turn off"+ "value": "Unavailable"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "关闭"+ "value": "不可用"}}}},- "Turn off cloud saves": {+ "Up to one frame more display latency.": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Bis zu ein Bild mehr Anzeigeverzögerung."+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Turn off cloud saves"+ "value": "Up to one frame more display latency."+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Jusqu’à une image de latence d’affichage en plus."+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Upp till en bildruta mer fördröjning på skärmen."}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "关闭云存档"+ "value": "显示延迟最多增加一帧。"}}}},- "Unavailable": {+ "Update app": {"localizations": {"en": {"stringUnit": {"state": "translated",- "value": "Unavailable"+ "value": "Update app"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "不可用"+ "value": "更新 App"}}}},- "Update app": {+ "Upscaling": {"localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Hochskalierung"+ }+ },"en": {"stringUnit": {"state": "translated",- "value": "Update app"+ "value": "Upscaling"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Mise à l’échelle"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Uppskalning"}},"zh-Hans": {"stringUnit": {"state": "translated",- "value": "更新 App"+ "value": "超分"}}}@@ -1025,6 +2691,40 @@}}},+ "Uses more GPU time and can increase heat.": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Braucht mehr GPU-Zeit und kann die Wärme erhöhen."+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Uses more GPU time and can increase heat."+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Utilise plus de temps GPU et peut faire chauffer davantage."+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Använder mer GPU-tid och kan öka värmen."+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "占用更多 GPU 时间,可能增加发热。"+ }+ }+ }+ },"Version %@": {"localizations": {"en": {@@ -1041,6 +2741,40 @@}}},+ "Window": {+ "localizations": {+ "de": {+ "stringUnit": {+ "state": "translated",+ "value": "Fenster"+ }+ },+ "en": {+ "stringUnit": {+ "state": "translated",+ "value": "Window"+ }+ },+ "fr": {+ "stringUnit": {+ "state": "translated",+ "value": "Fenêtre"+ }+ },+ "sv": {+ "stringUnit": {+ "state": "translated",+ "value": "Fönster"+ }+ },+ "zh-Hans": {+ "stringUnit": {+ "state": "translated",+ "value": "窗口"+ }+ }+ }+ },"Your games": {"localizations": {"en": {diff --git a/frontend-ios/Sources/ShellUI/ShellInputs.swift b/frontend-ios/Sources/ShellUI/ShellInputs.swiftindex eb5c6d24..e2dfc7e0 100644--- a/frontend-ios/Sources/ShellUI/ShellInputs.swift+++ b/frontend-ios/Sources/ShellUI/ShellInputs.swift@@ -38,7 +38,9 @@ public struct GameTile: Identifiable, Equatable, Sendable {public struct SettingOption: Identifiable, Equatable, Sendable {public var id: Stringpublic var label: String- public init(_ value: String, _ label: String) { id = value; self.label = label }+ /// The label is a text of the game's launcher.json: it is shown in the player's language when the catalog has it.+ public init(_ value: String, _ label: String) { self.init(value, label, in: ShellStrings.bundle) }+ init(_ value: String, _ label: String, in bundle: Bundle) { id = value; self.label = ShellStrings.setting(label, bundle: bundle) }}public enum SettingKind: Equatable, Sendable {@@ -57,10 +59,14 @@ public struct SettingRow: Identifiable, Equatable, Sendable {public var enabled: Bool/// The value is the shell settings' choice, because the game has none of its own.public var fromShell: Bool+ /// Label and note are texts of the game's launcher.json: shown in the player's language when the catalog has them.public init(id: String, label: String, note: String = "", kind: SettingKind, value: String, enabled: Bool = true, fromShell: Bool = false) {+ self.init(id: id, label: label, note: note, kind: kind, value: value, enabled: enabled, fromShell: fromShell, in: ShellStrings.bundle)+ }+ init(id: String, label: String, note: String = "", kind: SettingKind, value: String, enabled: Bool = true, fromShell: Bool = false, in bundle: Bundle) {self.id = id- self.label = label- self.note = note+ self.label = ShellStrings.setting(label, bundle: bundle)+ self.note = ShellStrings.setting(note, bundle: bundle)self.kind = kindself.value = valueself.enabled = enabled@@ -72,7 +78,13 @@ public struct SettingSection: Identifiable, Equatable, Sendable {public var id: Stringpublic var title: Stringpublic var rows: [SettingRow]- public init(id: String, title: String, rows: [SettingRow]) { self.id = id; self.title = title; self.rows = rows }+ /// The id stays the section's name in launcher.json, the title is that name in the player's language when the catalog has it.+ public init(id: String, title: String, rows: [SettingRow]) { self.init(id: id, title: title, rows: rows, in: ShellStrings.bundle) }+ init(id: String, title: String, rows: [SettingRow], in bundle: Bundle) {+ self.id = id+ self.title = ShellStrings.setting(title, bundle: bundle)+ self.rows = rows+ }}public struct GameDetail: Identifiable, Equatable, Sendable {diff --git a/frontend-ios/Sources/ShellUI/ShellStyle.swift b/frontend-ios/Sources/ShellUI/ShellStyle.swiftindex fb4bd1e6..08df2601 100644--- a/frontend-ios/Sources/ShellUI/ShellStyle.swift+++ b/frontend-ios/Sources/ShellUI/ShellStyle.swift@@ -15,6 +15,14 @@ public enum ShellPalette {enum ShellStrings {static var bundle: Bundle { .module }static func text(_ key: String.LocalizationValue) -> String { String(localized: key, bundle: bundle) }++ /// A text of a game's `launcher.json` (section, label, note, option label) in the player's language. The file is English and+ /// not ours to change, so the catalog is keyed by that English text. The key is used as it is (a `%` in a note is not a format).+ /// A text with no entry, and an empty one, stays as it is: the player reads English, never a key. `bundle` is a language's+ /// `.lproj` in tests.+ static func setting(_ text: String, bundle: Bundle = ShellStrings.bundle) -> String {+ text.isEmpty ? text : bundle.localizedString(forKey: text, value: text, table: nil)+ }}@MainActor public enum ShellFonts {diff --git a/frontend-ios/Tests/ShellUITests/ShellStringsTests.swift b/frontend-ios/Tests/ShellUITests/ShellStringsTests.swiftindex 6cbc6159..225b563c 100644--- a/frontend-ios/Tests/ShellUITests/ShellStringsTests.swift+++ b/frontend-ios/Tests/ShellUITests/ShellStringsTests.swift@@ -34,6 +34,53 @@ import Testing}}+ // MARK: A game's settings rows (launcher.json is English, the catalog is keyed by that text)++ private func languageBundle(_ language: String) throws -> Bundle {+ let path = try #require(ShellStrings.bundle.path(forResource: language, ofType: "lproj"), "\(language).lproj")+ return try #require(Bundle(path: path))+ }++ @Test func aChineseDeviceReadsTheRowsOfAGameInChinese() throws {+ let zh = try languageBundle("zh-Hans")+ let kind = SettingKind.choice([SettingOption("0", "Handheld", in: zh), SettingOption("1", "Docked", in: zh)])+ let row = SettingRow(id: "DM_OPMODE", label: "Console mode", note: "Uses more GPU time and can increase heat.", kind: kind, value: "0", in: zh)+ #expect(row.label == "主机模式")+ #expect(row.note != "Uses more GPU time and can increase heat." && !row.note.isEmpty)+ guard case .choice(let options) = row.kind else { Issue.record("not a choice"); return }+ #expect(options.map(\.label) == ["掌机模式", "底座模式"])+ #expect(options.map(\.id) == ["0", "1"], "the value written to the game is not translated")+ let section = SettingSection(id: "Game", title: "Game", rows: [row], in: zh)+ #expect(section.id == "Game" && section.title == "游戏")+ }++ @Test func aNoteWithAPercentSignIsLookedUpAsItIs() throws {+ let zh = try languageBundle("zh-Hans")+ let note = "Adjusts resolution between 70% and 100% under load. Turn off to keep full resolution for the selected console mode."+ #expect(ShellStrings.setting(note, bundle: zh) != note)+ }++ @Test func aTextWithoutATranslationStaysEnglishAndIsNeverAKey() throws {+ let zh = try languageBundle("zh-Hans")+ for text in ["Thermal throttle ceiling", "ios.ui.done", "launch.set.DM_OPMODE", "DM_FPS_TARGET"] {+ #expect(ShellStrings.setting(text, bundle: zh) == text)+ }+ #expect(ShellStrings.setting("", bundle: zh) == "")+ let row = SettingRow(id: "DM_NEW", label: "Thermal throttle ceiling", note: "A new note.", kind: .toggle(on: "1", off: "0"), value: "0", in: zh)+ #expect(row.label == "Thermal throttle ceiling" && row.note == "A new note.")+ }++ @Test func englishStaysEnglishAndAnAlreadyTranslatedTextIsNotTouched() throws {+ let en = try languageBundle("en")+ #expect(ShellStrings.setting("Console mode", bundle: en) == "Console mode")+ #expect(ShellStrings.setting("主机模式", bundle: try languageBundle("zh-Hans")) == "主机模式")+ }++ @Test func theUpstreamNoteWithASemicolonIsTranslatedToo() throws {+ let note = "Keeps a pipeline archive; uses more memory."+ #expect(ShellStrings.setting(note, bundle: try languageBundle("zh-Hans")) != note)+ }+/// The app follows the system language: iOS picks the lproj of the bundle by the device's list, and the app's/// Info.plist declares en and zh-Hans (CFBundleLocalizations). So both lprojs must be in the package bundle.@Test func bothLanguagesAreCompiledIntoTheBundle() throws {diff --git a/frontend/README.md b/frontend/README.mdindex 08bbf632..962e3f2d 100644--- a/frontend/README.md+++ b/frontend/README.md@@ -335,6 +335,16 @@ committed catalog differs from what the files give, and when the app's `CFBundleand the shell app of the engine, patch 0056) do not list every file, because iOS offers a language to the shell only when theapp declares it. The key checks treat the `ios.*` keys as used (`catalogKeys` in `frontend/Tests/l10n-key-rules.json`).+A game's settings rows (section, label, note, option labels) are not shell texts. They come from the game's `launcher.json`,+which is English and owned by seedds/nxnative, so its format stays. The shell looks each text up in the ShellUI catalog by its+English words, and a text with no entry shows English. The catalog gets these texts from the lines the Mac launcher already+translates (`launch.section.*`, `launch.set.*`, `launch.opt.*`), so there is one translation of each. `ios.setting.*` has the+few texts upstream's `settings.tsv` words differently from the Mac's table (a semicolon in a note, for example): the English+is upstream's, the translation is the same as the Mac's. When a pin bump adds or changes a text in `dm/games/settings.tsv` or the+game language names in `dm/tools/nacp.py`, `tools/tests/test_launcher_texts.py` fails and names the text that has no Chinese+entry. Add the line to `en.json` and `zh.json` (and to the other languages that have the `launch.*` lines), run+`python3 tools/l10n_shell_catalogs.py` and `python3 tools/tests/test_launcher_texts.py --write`.+The app finds the files in `Contents/Resources/l10n` (`build-mac-app.yml` and `tools/try-local` copy thefolder there, the same way as the engine and the bundled tools, not as SwiftPM resources). `swift run` finds`frontend/l10n` by walking up from the executable, and `swift test` takes it from the source path.diff --git a/frontend/Tests/l10n-key-rules.json b/frontend/Tests/l10n-key-rules.jsonindex 1b718481..823a9a09 100644--- a/frontend/Tests/l10n-key-rules.json+++ b/frontend/Tests/l10n-key-rules.json@@ -36,7 +36,8 @@],"catalogKeys": [{"prefix": "ios.ui.", "why": "ShellUI, frontend-ios/Sources/ShellUI/Resources/Localizable.xcstrings"},- {"prefix": "ios.host.", "why": "ShellHost, frontend-ios/Sources/ShellHost/Resources/Localizable.xcstrings"}+ {"prefix": "ios.host.", "why": "ShellHost, frontend-ios/Sources/ShellHost/Resources/Localizable.xcstrings"},+ {"prefix": "ios.setting.", "why": "a game's settings text that upstream's launcher.json writes differently from launch.*, ShellUI catalog"}],"unusedAllowed": []}diff --git a/frontend/l10n/de.json b/frontend/l10n/de.jsonindex 224da171..ae0efe56 100644--- a/frontend/l10n/de.json+++ b/frontend/l10n/de.json@@ -544,6 +544,7 @@"free.selected": "%@ ausgewählt","free.title": "Speicherplatz freigeben","install.reveal": "Im Finder zeigen",+ "ios.setting.DM_PSO_MTL4.note": "Behält ein Pipeline-Archiv und braucht mehr Speicher.","key.clear": "Löschen","key.code": "Taste %ld","key.delete": "Rückschritt",diff --git a/frontend/l10n/en.json b/frontend/l10n/en.jsonindex e7e49bb9..a8d5a9e5 100644--- a/frontend/l10n/en.json+++ b/frontend/l10n/en.json@@ -601,6 +601,7 @@"ios.host.unknownKind": "%@ has the unknown kind \"%@\".","ios.host.valueFromSettings": "%@ (from Settings)","ios.host.wrongValueAt": "%@ has a wrong or missing value at \"%@\".",+ "ios.setting.DM_PSO_MTL4.note": "Keeps a pipeline archive; uses more memory.","ios.ui.appUpdateNeeded": "App update needed","ios.ui.back": "Back","ios.ui.charging": "Charging",diff --git a/frontend/l10n/fr.json b/frontend/l10n/fr.jsonindex 1d1d6b69..b82d51cb 100644--- a/frontend/l10n/fr.json+++ b/frontend/l10n/fr.json@@ -543,6 +543,7 @@"free.selected": "%@ sélectionnés","free.title": "Libérer de l’espace","install.reveal": "Afficher dans le Finder",+ "ios.setting.DM_PSO_MTL4.note": "Conserve une archive de pipelines et utilise plus de mémoire.","key.clear": "Effacer","key.code": "Touche %ld","key.delete": "Supprimer",diff --git a/frontend/l10n/sv.json b/frontend/l10n/sv.jsonindex 8643d10f..29ad31a1 100644--- a/frontend/l10n/sv.json+++ b/frontend/l10n/sv.json@@ -385,6 +385,7 @@"free.selected": "%@ valt","free.title": "Frigör utrymme","install.reveal": "Visa i Finder",+ "ios.setting.DM_PSO_MTL4.note": "Behåller ett pipelinearkiv och använder mer minne.","key.clear": "Rensa","key.code": "Tangent %ld","key.delete": "Radera",diff --git a/frontend/l10n/zh.json b/frontend/l10n/zh.jsonindex 687258f1..0d5d4efa 100644--- a/frontend/l10n/zh.json+++ b/frontend/l10n/zh.json@@ -602,6 +602,7 @@"ios.host.unknownKind": "%@ 的类型 \"%@\" 未知。","ios.host.valueFromSettings": "%@(来自设置)","ios.host.wrongValueAt": "%@ 的 \"%@\" 值错误或缺失。",+ "ios.setting.DM_PSO_MTL4.note": "保留管线存档,占用更多内存。","ios.ui.appUpdateNeeded": "需要更新 App","ios.ui.back": "返回","ios.ui.charging": "充电中",diff --git a/tools/l10n_shell_catalogs.py b/tools/l10n_shell_catalogs.pyindex 6528ccd5..0bbdf822 100644--- a/tools/l10n_shell_catalogs.py+++ b/tools/l10n_shell_catalogs.py@@ -6,6 +6,12 @@ The shell's texts are lines of `frontend/l10n/<code>.json`, next to the launcherios.ui.* ShellUI, frontend-ios/Sources/ShellUI/Resources/Localizable.xcstringsios.host.* ShellHost, frontend-ios/Sources/ShellHost/Resources/Localizable.xcstrings+The rows of a game's settings screen are not the shell's texts. They come from the game's `launcher.json` (seedds/nxnative, English, its+format is not ours to change), and the shell shows them in the player's language by their English text, through the ShellUI catalog:+the section, label, note and option labels the Mac launcher already translates (`launch.section.*`, `launch.set.*`, `launch.opt.*`)+go into the ShellUI catalog too, with no second copy of the translation, plus the few `ios.setting.*` lines for a text upstream writes+differently from the Mac's table. A text with no catalog entry shows as it is, in English. See "Game settings" in frontend-ios/README.md.+The Swift code asks for a text by its English words (`ShellStrings.text("Done")`, `Text("Settings")`), which is what an Xcodestring catalog keys on. So the catalog's key is the English text of the JSON key (`%@` and `%lld` stay as they are), and everylanguage file that has the JSON key adds one localization. The languages are the files of the folder: a new `<code>.json` shows@@ -31,6 +37,16 @@ CATALOGS = {'ShellHost': 'ios.host.',}+# More prefixes whose texts go into a catalog. Two keys with the same English text share an entry when every language reads the same.+EXTRA_PREFIXES = {+ 'ShellUI': ('ios.setting.', 'launch.section.', 'launch.set.', 'launch.opt.'),+}+++def prefixes(target: str) -> tuple[str, ...]:+ return (CATALOGS[target], *EXTRA_PREFIXES.get(target, ()))++# The language code of a file and the code Xcode and iOS know it by. Every other code is the same in both.APPLE_CODES = {'zh': 'zh-Hans'}SOURCE_LANGUAGE = 'en'@@ -63,21 +79,25 @@ def apple_codes(languages: dict[str, dict[str, str]]) -> list[str]:return [SOURCE_LANGUAGE, *codes]-def build(languages: dict[str, dict[str, str]], prefix: str) -> dict:- """One catalog: the English text of each `prefix*` key is the key, each language that has the JSON key is a localization."""+def build(languages: dict[str, dict[str, str]], prefix: str | tuple[str, ...]) -> dict:+ """One catalog: the English text of each `prefix*` key is the key, each language that has the JSON key is a localization.+ Two keys with the same English text and the same translations are one entry, with different ones they cannot both be."""english = languages[SOURCE_LANGUAGE]strings: dict[str, dict] = {}owner: dict[str, str] = {}for json_key in sorted(k for k in english if k.startswith(prefix)):text = english[json_key]- if text in owner:- raise SystemExit(f'{json_key} and {owner[text]} have the same English text {text!r}: one catalog key cannot carry both')- owner[text] = json_keylocalizations = {}for code, texts in languages.items():if json_key in texts:localizations[apple_code(code)] = {'stringUnit': {'state': 'translated', 'value': texts[json_key]}}- strings[text] = {'localizations': dict(sorted(localizations.items(), key=lambda item: (item[0] != SOURCE_LANGUAGE, item[0])))}+ entry = {'localizations': dict(sorted(localizations.items(), key=lambda item: (item[0] != SOURCE_LANGUAGE, item[0])))}+ if text in owner:+ if strings[text] != entry:+ raise SystemExit(f'{json_key} and {owner[text]} have the same English text {text!r} and different translations: one catalog key cannot carry both')+ continue+ owner[text] = json_key+ strings[text] = entryreturn {'sourceLanguage': SOURCE_LANGUAGE, 'strings': strings, 'version': '1.0'}@@ -88,7 +108,7 @@ def render(catalog: dict) -> str:def expected(l10n: Path = L10N) -> dict[str, str]:languages = load_languages(l10n)- return {target: render(build(languages, prefix)) for target, prefix in CATALOGS.items()}+ return {target: render(build(languages, prefixes(target))) for target in CATALOGS}def main(argv: list[str] | None = None) -> int:diff --git a/tools/tests/launcher_texts.txt b/tools/tests/launcher_texts.txtnew file mode 100644index 00000000..eb821919--- /dev/null+++ b/tools/tests/launcher_texts.txt@@ -0,0 +1,50 @@+30 fps+60 fps+Adjusts resolution between 70% and 100% under load. Turn off to keep full resolution for the selected console mode.+American English+Brazilian Portuguese+British English+Canadian French+Console mode+Controls+Display mode+Docked+Dutch+Dynamic resolution+Encode thread+Frame buffering+Frame rate+Frame-rate counter+French+Fullscreen+Game+Game language+Game rumble+German+Handheld+Hold frames when late+Italian+Japanese+Keeps a pipeline archive; uses more memory.+Korean+Latin American Spanish+Metal 4 pipelines+MetalFX+Performance+Performance HUD+Pipeline prebuild+Portuguese+Render scale+Rumble cutoff+Rumble strength+Russian+Simplified Chinese+Spanish+Standard+The first start waits a few minutes for it, once.+Touch feedback+Traditional Chinese+Up to one frame more display latency.+Upscaling+Uses more GPU time and can increase heat.+Windowdiff --git a/tools/tests/test_l10n_shell_catalogs.py b/tools/tests/test_l10n_shell_catalogs.pyindex a8c9472f..ee2a7aaa 100644--- a/tools/tests/test_l10n_shell_catalogs.py+++ b/tools/tests/test_l10n_shell_catalogs.py@@ -64,7 +64,7 @@ class CommittedCatalogs(unittest.TestCase):self.assertIn('zh-Hans', entry['localizations'], f'{target}: {key} has no Chinese text')def test_every_ios_key_belongs_to_a_catalog(self):- prefixes = tuple(C.CATALOGS.values())+ prefixes = tuple(p for target in C.CATALOGS for p in C.prefixes(target))for code, texts in self.languages.items():stray = sorted(k for k in texts if k.startswith('ios.') and not k.startswith(prefixes))self.assertEqual(stray, [], f'{code}.json has ios.* keys that no catalog takes')@@ -123,11 +123,16 @@ class Generator(unittest.TestCase):self.assertEqual(list(strings), ['"%@" is %lld of %.1f'])self.assertEqual(strings['"%@" is %lld of %.1f']['localizations']['zh-Hans']['stringUnit']['value'], '"%@" 是 %lld / %.1f')- def test_two_keys_with_the_same_english_text_in_one_catalog_fail(self):+ def test_two_keys_with_the_same_english_text_and_different_translations_in_one_catalog_fail(self):folder = self.folder(en={'ios.ui.a': 'Same', 'ios.ui.b': 'Same'}, zh={'ios.ui.a': 'x', 'ios.ui.b': 'y'})with self.assertRaises(SystemExit):C.build(C.load_languages(folder), 'ios.ui.')+ def test_two_keys_with_the_same_english_text_and_the_same_translations_are_one_entry(self):+ folder = self.folder(en={'ios.ui.a': 'Same', 'launch.set.b': 'Same'}, zh={'ios.ui.a': 'x', 'launch.set.b': 'x'})+ strings = C.build(C.load_languages(folder), ('ios.ui.', 'launch.set.'))['strings']+ self.assertEqual(list(strings), ['Same'])+def test_the_output_is_stable(self):folder = self.folder(en={'ios.ui.b': 'B', 'ios.ui.a': 'A'}, zh={'ios.ui.b': 'b', 'ios.ui.a': 'a'})first = C.render(C.build(C.load_languages(folder), 'ios.ui.'))diff --git a/tools/tests/test_launcher_texts.py b/tools/tests/test_launcher_texts.pynew file mode 100644index 00000000..22065ab1--- /dev/null+++ b/tools/tests/test_launcher_texts.py@@ -0,0 +1,87 @@+"""The texts of a game's settings screen are translated in the iOS shell (LNPANDY/NX2Apple#429).++A game's `launcher.json` is English and owned by seedds/nxnative. The shell looks each section, label, note and option label up in+its ShellUI catalog by that English text. Upstream writes the texts in `dm/games/settings.tsv` (and the game language names in+`dm/tools/nacp.py`), so these tests read what the engine at the pin has and fail with the text that has no Chinese entry. When the+pin bump adds or changes a text, add it to `frontend/l10n` (a `launch.*` line, or an `ios.setting.*` line when the Mac's table words+it differently), run `python3 tools/l10n_shell_catalogs.py`, and regenerate `launcher_texts.txt` with+`python3 tools/tests/test_launcher_texts.py --write`. `launcher_texts.txt` is the same list for a checkout without `engine/`.+"""+import importlib+import json+import sys+import unittest+from pathlib import Path++TESTS = Path(__file__).resolve().parent+ROOT = TESTS.parents[1]+sys.path.insert(0, str(ROOT / 'tools'))+C = importlib.import_module('l10n_shell_catalogs')++ENGINE = ROOT / 'engine'+FIXTURE = TESTS / 'launcher_texts.txt'+++def engine_texts() -> set[str]:+ """Every English text launcher.json can carry: section, label, note and the fixed choice labels of settings.tsv, and the+ game language names (the options of a `languages` choice)."""+ texts: set[str] = set()+ tsv = ENGINE / 'dm' / 'games' / 'settings.tsv'+ for line in tsv.read_text(encoding='utf-8').splitlines():+ if not line.strip() or line.startswith('#'):+ continue+ cols = line.split('\t')+ texts.update(c for c in cols[5:8] if c)+ if cols[1] == 'choice' and cols[2] != 'languages':+ texts.update(pair.split('=', 1)[1] for pair in cols[2].split(','))+ sys.path.insert(0, str(ENGINE / 'dm' / 'tools'))+ try:+ nacp = importlib.import_module('nacp')+ finally:+ sys.path.pop(0)+ texts.update(name for _, name in nacp.LANGUAGES)+ return texts+++def catalog() -> dict:+ return json.loads(C.catalog_path('ShellUI').read_text(encoding='utf-8'))['strings']+++def missing_in_chinese(texts) -> list[str]:+ strings = catalog()+ return sorted(t for t in texts if 'zh-Hans' not in strings.get(t, {}).get('localizations', {}))+++class LauncherTexts(unittest.TestCase):+ def test_every_checked_in_text_has_a_chinese_entry(self):+ texts = [t for t in FIXTURE.read_text(encoding='utf-8').splitlines() if t]+ self.assertTrue(texts)+ self.assertEqual(missing_in_chinese(texts), [], 'ShellUI catalog has no zh-Hans text for these launcher.json texts')++ def test_every_text_of_the_engine_has_a_chinese_entry(self):+ if not (ENGINE / 'dm' / 'games' / 'settings.tsv').is_file():+ self.skipTest('engine/ is not built (python3 tools/engine.py sync): only the checked-in list is checked')+ self.assertEqual(missing_in_chinese(engine_texts()), [],+ 'the engine at the pin has launcher.json texts with no zh-Hans entry in the ShellUI catalog: see this file\'s docstring')++ def test_the_checked_in_list_is_the_engines(self):+ if not (ENGINE / 'dm' / 'games' / 'settings.tsv').is_file():+ self.skipTest('engine/ is not built (python3 tools/engine.py sync)')+ checked_in = {t for t in FIXTURE.read_text(encoding='utf-8').splitlines() if t}+ found = engine_texts()+ self.assertEqual(sorted(found - checked_in), [], 'new launcher.json texts upstream: run python3 tools/tests/test_launcher_texts.py --write')+ self.assertEqual(sorted(checked_in - found), [], 'texts upstream no longer has: run python3 tools/tests/test_launcher_texts.py --write')++ def test_a_text_the_mac_words_differently_has_its_own_line(self):+ english = C.load_languages()['en']+ for key in (k for k in english if k.startswith('ios.setting.')):+ twin = key.replace('ios.setting.', 'launch.set.')+ self.assertNotEqual(english[key], english.get(twin), f'{key} says what {twin} says: delete it')+++if __name__ == '__main__':+ if sys.argv[1:] == ['--write']:+ FIXTURE.write_text(''.join(t + '\n' for t in sorted(engine_texts())), encoding='utf-8')+ print(f'wrote {FIXTURE}')+ else:+ unittest.main()