ARTICLE DETAIL

资讯详情

深耕郑州网站建设与运营推广的一线实战洞察。

GalaxyBudsClient 乌克兰语本地化:翻译缺失报告(meta/ua.md)全解与多语言架构实现剖析

GalaxyBudsClient 乌克兰语本地化:翻译缺失报告(meta/ua.md)全解与多语言架构实现剖析 桌面应用智能硬件蓝牙【免费下载链接】GalaxyBudsClientUnofficial Galaxy Buds Manager for Windows, macOS, Linux, and Android项目地址https://gitcode.com/gh_mirrors/ga/GalaxyBudsClient点击查看免费下载GalaxyBudsClient 作为一款面向 Windows、macOS、Linux 与 Android 的非官方 Galaxy Buds 管理器其界面本地化依赖一套以英文为基准、按语言文件分发的 ResourceDictionary 体系。本文以仓库中的乌克兰语翻译缺失报告 meta/ua.md 为入口逐层拆解这份自动生成报告的结构与含义并结合 LocalizationKeySourceGenerator.cs、LocalizationUtils.cs 等源码讲清翻译键的生成、运行时解析与缺失回退机制。读完本文你将掌握如何读懂翻译缺失报告、缺失键在实际运行时会产生什么行为、以及如何按报告补全一份语言文件。一、报告概览ua.md 是什么meta/ua.md 与同目录下的 meta/translations.md 一样均由项目作者维护的 XamlTranslationValidator 工具自动生成并定期更新文件头明确标注This file is auto-generated and automatically updated. Do not modify this file manually——该文件是只读产物贡献者不应手工编辑它真正的翻译工作发生在i18n/目录下的 AXAML 语言文件中。报告核心信息有三部分翻译进度乌克兰语ua当前为50%对应294 个缺失字符串缺失清单以表格逐行列出缺失的翻译键Key与其英文原文Original string生成来源文件尾注Powered by ThePBone/XamlTranslationValidator点明数据由外部校验工具扫描生成。在 meta/translations.md 的总览表中可以看到所有语言的最新状态乌克兰语与法语fr、罗马尼亚语ro同为 50%294 个缺失键而葡萄牙语pt与巴西葡萄牙语br已达到 98%仅剩 7 个缺失键。这份总览同时提供了各语言的详情页入口如ua.md是判断项目本地化健康度的第一手数据。二、缺失键清单294 个待翻译字符串全分组以下是 meta/ua.md 报告的完整缺失键清单按功能模块归组。这些键名同时也是 GalaxyBudsClient/i18n/en.axaml 中的x:Key标识补全翻译时可直接对照英文原文工作。2.1 通用与全局23 键bothBoth、nextNext、prevPrevious、offOff、onOn、hintHint、helpHelp、importantImportant、homeHome、read_failedFailed to read file. Access denied.、please_waitPlease wait...、value_left_right_inlineLeft: {0}, Right: {1}、value_left_right_multilineLeft: {0} / Right: {1}、other_xOther ({0})、no_data_storedNo data stored、not_availableNot available、last_updated_at_nLast updated at {0}、file_not_foundFile not found、feature_unsupported_platformThis feature is currently not supported on this platform.、adaptiveAdaptive、darkmode_blur_enabledOn, with blur effect、darkmode_mica_enabledOn, with mica effect、placement_chargingCharging、touchoption_custom_trigger_eventTrigger earbud action...、hotkey_add_shortNew、hotkey_edit_longEdit existing hotkey、event_nc_switch_oneSwitch noise controls with one earbud。注意value_left_right_inline与value_left_right_multiline这类键包含{0}、{1}占位符翻译时占位符位置必须原样保留且行内/多行两种形态各自对应不同的 UI 上下文多行版本英文原文即含换行。2.2 欢迎页与首次引导8 键welcome_registerSet-up your earbuds、welcome_register_descChoose and register your pair of Galaxy Buds、welcome_android_hint_titleImportant information for Android users、welcome_android_hint包含长段说明桌面端专属功能在 Android 版不可用、与官方 Samsung Wearable 应用共存会产生连接冲突、mainpage_headerHome、mainpage_fit_testEarbud fit test、devsel_manual_pair_titleIs your device not listed?、devsel_manual_pair_description、devsel_manual_pairManual connection。welcome_android_hint原文是跨两行的长文本翻译时需要保留换行结构与全部技术要点后台功能限制、官方应用冲突警告。2.3 设备管理页12 键devices_headerPaired devices、devices_newNew、devices_new_longPair new device、devices_select_inactiveSelect、devices_select_activeSelected、devices_deleteDelete、devices_delete_longDelete device、devices_delete_confirmationAre you sure you want to remove this device?、devices_settings_linkManage paired devices、devices_settings_link_descAdd, remove, or select a primary device。2.4 触控板手势与触控锁定19 键touchpad_gesture_headerEnable touchpad gestures、touchpad_gesture_singleSingle tap、touchpad_gesture_single_descPlay or pause track、touchpad_gesture_doubleDouble tap、touchpad_gesture_double_descPlay next track、touchpad_gesture_tripleTriple tap、touchpad_gesture_triple_descPlay previous track、touchpad_gesture_holdTouch and hold、touchpad_gesture_hold_descExecute custom action、touchpad_gesture_double_for_call、touchpad_gesture_double_for_call_descAnswer call or end call、touchpad_gesture_hold_for_call、touchpad_gesture_hold_for_call_descDecline call、touchpad_default_actionBuilt-in touch action、touchpad_gesturesAdvanced touch lock、touchpad_gestures_descriptionDisable default touch gestures、touchpad_noise_control_mode_l、touchpad_noise_control_mode_r、touchpad_noise_control_mode_descChoose modes to cycle through。2.5 自定义触控动作3 键cact_function_paramFunction、cact_hotkey_paramHotkey、cact_path_paramFile path。2.6 系统信息与隐藏模式21 键system_hidden_at_modeHidden system settings、system_hidden_at_mode_descEdit hidden settings such as serial numbers and UART state、system_usage_reportsUsage metering reports、system_usage_reports_desc、system_battery_statisticsBattery statistics、system_battery_statistics_desc、system_no_responseNo response from earbuds、system_cradle_swverCase software version、system_cradle_serialCase serial number、system_btaddr_templateLocal address: {0}, Peer address: {1}、system_skuDevice SKUs、hidden_mode_warningProceed with caution、hidden_mode_warning_desc部分修改无法通过恢复出厂设置还原且并非所有型号都支持、hidden_mode_targetTarget device: {0} earbud、hidden_mode_target_l_desc、hidden_mode_target_r_desc、hidden_mode_input_wrong_lengthThe new value must be exactly {0} characters long.、hidden_mode_uart_on_confirm、hidden_mode_uart_off_confirm、hidden_mode_uartEnable UART port、hidden_mode_uart_desc、hidden_mode_powerPower menu、hidden_mode_power_desc、hidden_mode_serial_change、hidden_mode_serial_change_desc、hidden_mode_did_change、hidden_mode_did_change_desc、hidden_mode_sku_change、hidden_mode_sku_change_desc、hidden_mode_bt_peer_addr_change、hidden_mode_bt_peer_change_desc、hidden_mode_bt_local_addr_change、hidden_mode_bt_local_change_desc、hidden_mode_terminalHidden command terminal、hidden_mode_terminal_desc、power_menu_hint、power_menu_rebootReboot、power_menu_shutdownShutdown、power_menu_sleepFactory sleep mode、at_terminal_cmd_idCommand id、at_terminal_cmd_param、at_terminal_cmd_id_invalid含 16 位十六进制示例 0007 / 004C、at_terminal_outputOutput、at_terminal_sendSend。这批键对应 HiddenModeTerminalDialog.axaml 与系统信息页等高技术密度界面hidden_mode_target中的{0}会被替换为 Left/Right 等值翻译时需保证语义通顺。2.7 使用报告、计量与电池统计30 键usage_reports_header、usage_reports_hint长段说明报告由耳机自行收集、官方 Wearable 应用会周期性重置并上报三星、usage_reports_usage、usage_reports_metering、milliamp_hours_unit{0}mAh、metering_total_batt_capacityTotal battery capacity、metering_a2dp_timeMusic playback usage time (A2DP)、metering_esco_timeCall usage time (eSCO)、batt_hist_hint长段说明后台收集电量与使用数据的前提条件、batt_hist_no_data_title、batt_hist_no_data、batt_hist_y_axisCharge (%)、batt_hist_last_hour、batt_hist_last_6_hours、batt_hist_last_12_hours、batt_hist_last_24_hours、batt_hist_last_3_days、batt_hist_last_7_days、batt_hist_overlay_none、batt_hist_overlay_noise_controls、batt_hist_overlay_wearing、batt_hist_overlay_host_device、batt_hist_overlay_legend{0} (Overlay)、batt_hist_tools_pan_and_zoom、batt_hist_tools_measure_time、batt_hist_tools_measure_battery、batt_hist_show_legend、batt_hist_measure_difference_displayDifference: {0}、batt_hist_measure_timespan_displayTime span: {0}、batt_hist_measure_timespan_unit_long、batt_hist_time_span_tip_title、batt_hist_control_tip_title、batt_hist_control_tip多行鼠标操作说明、batt_hist_overlay_tip_title、batt_hist_overlay_tip多行叠加层说明、batt_hist_tools_tip_title、batt_hist_tools_tip多行工具说明。电池统计页对应 BatteryHistoryPage.axaml 及其后台数据收集实现 BatteryHistoryManager.cs提示类文本*_tip是长多行段落是翻译工作量最大的部分之一。2.8 设置页26 键settings_save_fail_no_access含{0}配置文件路径占位符、settings_appearance、settings_blurstrength、settings_blurstrength_description、settings_accent、settings_accent_description、settings_localization_description、settings_realistic_earbud_icons、settings_realistic_earbud_icons_description、settings_color_override、settings_color_override_description、settings_nav_sidebar、settings_nav_sidebar_description、settings_tray_settings、settings_dyn_tray_mode、settings_dyn_tray_mode_description、settings_dyn_tray_mode_off、settings_dyn_tray_mode_battery_min、settings_dyn_tray_mode_battery_avg、settings_devmode_description、settings_crowdsourcing、settings_cpopup_position_description、settings_crowd_header、settings_crowd_allow、settings_crowd_allow_description众包协议说明、settings_crowd_crashreport、settings_crowd_crashreport_descriptionSentry 崩溃上报说明。2.9 多设备连接 Multipoint6 键settings_multipoint_header、settings_multipoint_autoUnlock multipoint without a Samsung account、settings_multipoint_auto_description长段原理说明写入缺失的版本标记、放回充电盒即清除、settings_multipoint_applyApply now、settings_multipoint_apply_description、settings_multipoint_applied、settings_multipoint_failed。该功能的底层实现见 MultipointPatcher.cs。2.10 恢复出厂设置、SmartThings Find 与佩戴测试21 键factory_confirmation多行确认文本含确保两只耳机均已开机警告、fmg_smart_things_find_manage、fmg_smart_things_find_manage_desc、fmg_smart_things_find_open、fmg_smart_things_find_open_desc、smart_things_findSmartThings、smart_things_find_clear、smart_things_find_clear_desc、smart_things_find_ivInitialization vector (IV)、smart_things_find_secret_key、smart_things_find_region、smart_things_find_fmm_token、smart_things_find_no_link、smart_things_find_write_fail、smart_things_find_write_ok、smart_things_find_write_ok_desc、gft_warningPlease wear both earbuds.、gft_desc、gft_badBad fit、gft_goodGood fit、gft_failTest failed。2.11 均衡器、降噪与环境音14 键eq_enable_description、nc_as_anc_description、nc_one_earbud、nc_one_earbud_description、nc_ambient、nc_ambient_description、nc_voicedetect_timeout_description、nc_as_header、nc_as_custom、nc_as_custom_description、nc_as_custom_volume_l、nc_as_custom_volume_r、nc_as_custom_tone、nc_as_custom_tone_clear、nc_as_custom_tone_soft、nc_as_custom_tone_neutral、nc_as_custom_vol_normal、as_header_description、as_voicefocus_description。2.12 高级设置与 Bixby 重映射7 键adv_pause_playback、adv_pause_playback_descDesktop 专属说明、adv_callpath、adv_callpath_desc、adv_extra_clear_call、adv_extra_clear_call_desc、bixby_remap_lang_desc、bixby_remap_action_desc。2.13 连接丢失、官方应用冲突与配对10 键credits_kofi、credits_github、connlostConnection lost、connlost_troubleshootTroubleshoot、connlost_troubleshoot_title、connlost_troubleshoot_content多行排查指南解绑 Wearable 应用、卸载 Buds 插件、或用 Hail/Ice Box 冻结插件、pairingmode_done、window_openOpen、budsapp_headerBluetooth compatibility info、budsapp_text_p1、budsapp_text_p2、budsapp_text_p3。2.14 固件更新7 键fw_select_install_shortInstall、fw_select_from_disk_shortOpen、fw_select_refreshRefresh、fw_select_no_results_shortNo updates found、fw_select_verify_model_mismatch_fail跨型号刷机可能导致永久变砖的警告含{0}/{1}型号占位符。2.15 手动配对与重命名20 键manualpair_title、manualpair_title_dialog、manualpair_model、manualpair_note、rename、rename_desc、rename_warn长段说明、rename_warn_oneui_title、rename_warn_oneuiOneUI 用户专属警告、rename_too_short、rename_hint、rename_label、rename_reading_name、rename_ok_title、rename_ok多行提示。2.16 360 空间音频26 键page_spatial_audio360 Audio、spatial_audio_desc、spatial_enable、spatial_enable_desc、spatial_recenter、spatial_recenter_desc、spatial_demo_play、spatial_demo_stop、spatial_demo_desc、spatial_broadcast_osc、spatial_broadcast_osc_desclocalhost:9000 OSC 广播、spatial_broadcast_opentrack、spatial_broadcast_opentrack_desclocalhost:4242 FreeTrack/OpenTrack 广播、spatial_tracking_active、spatial_tracking_inactive、spatial_speaker_angle、spatial_speaker_angle_desc、spatial_ambience、spatial_ambience_desc、spatial_system_audio、spatial_system_audio_desc、spatial_blackhole_status_ok、spatial_blackhole_status_restart_needed、spatial_blackhole_status_missing、spatial_blackhole_missing_desc、spatial_blackhole_howto、spatial_blackhole_install、spatial_blackhole_restart、spatial_open_audio_midi、spatial_open_sound_pref、spatial_windows_infoWindows 平台 WASAPI Loopback 说明。360 空间音频是较新加入的功能底层实现见 SpatialSensorManager.cs 与 SpatialAudio 平台模块因此这批键在乌克兰语中完全缺失属于新功能待翻译的典型示例。三、翻译键从何处来源生成器与语言字典要理解缺失的含义需要先明白翻译键是如何进入程序的。LocalizationKeySourceGenerator.cs 是一个 Roslyn 增量源生成器IIncrementalGenerator构建时扫描所有路径含i18n的.axaml文件其工作流程如下解析 AXAML读取每个语言文件的ResourceDictionary遍历所有sys:String x:Key...节点提取键名与英文原文element.Value。生成三类代码LocalizationDictionary_{langCode}.g.cs每个语言生成一个Dictionarystring, string键值对直接来自 AXAMLLocalizationKeys.g.cs仅由英文文件en.axaml生成把蛇形键名转换为 PascalCase 常量类例如x:Keyhotkey_add_short变成Keys.HotkeyAddShort编译期就能发现键名的拼写错误LocalizationStrings.g.cs同样仅由英文文件生成为每个键提供Strings.XXX静态属性内部调用Loc.Resolve(Keys.XXX)使业务代码可以用强类型方式取字符串。生成查找表汇总所有语言文件生成LocalizationDictionaries.GetByLangCode(langCode)通过 switch 表达式把en、ua等语言代码映射到对应字典。这意味着英文文件en.axaml是键的唯一权威来源每新增一个界面字符串必须先在 en.axaml 中定义源生成器才会为它生成Keys与Strings成员其他语言文件如果缺少该键就会在 XamlTranslationValidator 生成的报告中以missing string形式暴露出来——这正是ua.md中 294 条记录的产生机制。四、缺失键的运行时行为三级回退与动态刷新当界面请求一个乌克兰语缺失的键时会发生什么答案在运行时解析器 LocalizationUtils.cs 的Loc静态类中。4.1 三级解析链Loc.Resolve(resName)的实际逻辑如下优先查当前语言字典_strings即ua字典未命中则回退到英文基准字典FallbackStrings静态构造函数中通过LoadInternalLanguage(en, ...)预加载两者都未命中时返回键名本身如some_key。所以一个乌克兰语缺失键在界面上不会崩溃而是直接显示英文原文——这也解释了为什么缺失报告中的Original string就是用户实际会看到的回退文本。ResolveOrDefault还承担了IsRightToLeft特殊键的读取用于判断是否需要切换 RTL 布局方向ResolveFlowDirection。4.2 语言加载与翻译者模式Loc.Load()根据Settings.Data.Locale决定加载哪种语言内部语言直接查生成字典若语言为custom且存在custom_language.xamlTranslatorModeFile位于应用数据目录则走LoadExternalLanguage从外部 XAML 文件热加载字典——这是项目内置的翻译者模式翻译人员无需重新编译整个应用把外部语言文件放到数据目录即可实时预览翻译效果。若custom模式但外部文件不存在则自动回退英文。4.3 语言切换实时生效界面侧通过 TranslateExtension.cs{Translate key}标记扩展绑定文本。它实现了IObservablestring订阅时调用Loc.AddObserverForKey(key, observer)先把当前解析结果推送给观察者并把观察者以WeakReference形式登记到Observers字典。语言切换或字典重载后NotifyObservers()会向所有相关键的观察者推送新值从而让整界面无需重启即可换语言。利用弱引用可避免因未取消订阅导致的内存泄漏。五、乌克兰语现状已翻译内容与缺失分布对照 ua.axaml当前 530 行可见乌克兰语并非空白起步通用按钮okay/cancel/apply等、连接弹窗connpopup_*、触控选项touchoption_*、托盘菜单tray_*、热键hotkey_*、事件分发event_*、欢迎页、主页面、更新页、设备选择、自检、设置、工厂重置、查找耳机、均衡器、降噪、环境音、高级、Bixby、致谢、连接丢失、固件更新全流程、空间传感器调试页、窗口按钮等均已翻译。缺失部分294 键主要集中在报告列出的新功能与深层页面电池统计图表的全部工具提示、360 空间音频整套文案、SmartThings Find、隐藏系统模式终端、Multipoint 解锁、以及若干新设置项与长段帮助文本。这些键在 en.axaml当前 778 行中均已定义乌克兰语文件尚未跟进。六、补全翻译的实操指南按照仓库机制补全乌克兰语翻译的正确流程如下仓库为只读环境以下描述针对本地贡献场景定位基准打开 GalaxyBudsClient/i18n/en.axaml 找到缺失键的英文原文即ua.md报告中的 Original string 列再打开 GalaxyBudsClient/i18n/ua.axaml 在对应分组注释如!--Battery statistics--下追加sys:String x:Key...译文/sys:String。遵守格式键名必须与英文文件完全一致{0}、{1}占位符按乌克兰语语序重排如Last updated at {0}可译为Востаннє оновлено: {0}多行文本在 AXAML 中保留换行特殊字符引号、反斜杠需转义——源生成器在ParseFile中会执行\、\\转义与换行归一化文件格式错误会导致生成失败。验证重新编译项目源生成器会自动把新条目并入LocalizationDictionary_ua.g.cs或在运行时借助翻译者模式custom_language.xaml免编译预览。提交后由 XamlTranslationValidator 重新扫描ua.md与 translations.md 的进度会随之更新注意这两份文件由工具维护不应手工修改。优先级建议从高可见度键入手欢迎页、设备管理、连接丢失提示再处理长文本工具提示batt_hist_*_tip、connlost_troubleshoot_content最后是低频调试界面隐藏模式终端、AT 命令提示。七、注意事项与翻译质量要点占位符一致性hidden_mode_input_wrong_length、system_btaddr_template、fw_select_verify_model_mismatch_fail等键的{0}/{1}是运行时由代码填入的实际值如序列号、地址、型号名翻译时删除或改序会导致运行时文本错乱。换行与分段batt_hist_control_tip、usage_reports_hint、welcome_android_hint、rename_warn等多行键在英文中通过换行分段乌克兰语译文应保持相同的信息层次避免 UI 布局失衡。平台差异提示adv_pause_playback_desc标注 Desktop only、spatial_blackhole_*系列仅 macOS 相关、spatial_windows_info仅 Windows 相关翻译时勿删减这些平台限定说明以免误导用户。术语统一乌克兰语中 ANCактивне шумозаглушення、Ambient soundзвукове оточення、Caseкейс等在 ua.axaml 已有先例新翻译应与既有术语保持一致。完成上述工作后ua.md报告中的 294 条记录会逐条消失meta/translations.md总览中乌克兰语的进度将向 100% 推进——这份自动生成的缺失报告正是驱动 GalaxyBudsClient 多语言生态持续完善的自动化清单。赞分享桌面应用智能硬件蓝牙【免费下载链接】GalaxyBudsClientUnofficial Galaxy Buds Manager for Windows, macOS, Linux, and Android项目地址https://gitcode.com/gh_mirrors/ga/GalaxyBudsClient点击查看免费下载相关推荐如何快速生成黑苹果 OpenCore EFIOpCore Simplify 使用指南如何快速生成黑苹果 OpenCore EFIOpCore Simplify 使用指南 你刚装好一台台式机想把 macOS 装上去却不想花好几天逐个配置驱动桌面应用智能硬件蓝牙Laravel Lang 乌克兰语uk本地化状态解析19 条缺失翻译键的清单、来源与补全指引Laravel Lang 乌克兰语uk本地化状态解析19 条缺失翻译键的清单、来源与补全指引 本文以 docs/statuses/uk.md https:后端Laravel 乌兹别克语ug语言包缺失翻译键解析基于 lang 仓库的本地化补齐指南Laravel 乌兹别克语ug语言包缺失翻译键解析基于 lang 仓库的本地化补齐指南 本篇技术指南聚焦于 lang https://link.gitco后端上一篇GPT-2-medium模型微调技术详解从SST-2数据集到生产环境下一篇JUCE 音频波形可视化3 步把实时波形导出为 SVG 矢量图创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表