Repository navigation
Add Chinese (Simplified & Traditional) localization support - #490
Open
fishegg666 wants to merge 1 commit into
Open
fishegg666 wants to merge 1 commit into
fishegg666 wants to merge 1 commit into
Conversation
- Add language selection page in Options dialog (OptionsSubLanguage) - Support switching between English, Simplified Chinese, Traditional Chinese, Japanese, Korean, German, French, Spanish, Russian - Auto-reload localization files when language changes - Create Simplified Chinese localization files: gameui_schinese.txt, valve_schinese.txt, platform_schinese.txt, vgui_schinese.txt - Create Traditional Chinese localization files: gameui_tchinese.txt, valve_tchinese.txt, platform_tchinese.txt, vgui_tchinese.txt - Android: auto-detect system language from system properties - Android: fix JNI string leaks (release GetStringUTFChars) - Android: use __system_property_get instead of popen(getprop) - Android: use sysinfo() for memory detection - Add FCVAR_ARCHIVE to cl_language so language setting persists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
为 Source Engine 添加简体中文和繁体中文本地化支持,主要针对 Android/GDroid 平台。
主要改动
1. 语言选择界面
OptionsSubLanguage选项页,集成到选项对话框中2. 中文本地化文件
创建以下简体中文文件:
gameui_schinese.txt- 游戏界面(主菜单、选项、对话框等)valve_schinese.txt- Valve 通用字符串platform_schinese.txt- 平台通用字符串vgui_schinese.txt- VGUI 通用字符串创建对应繁体中文文件(
*_tchinese.txt)3. Android 语言检测
persist.sys.locale/ro.product.locale)LANG环境变量,引擎自动选择对应本地化4. Android 启动器修复
GetStringUTFChars内存泄漏(添加ReleaseStringUTFChars)__system_property_get替代popen(getprop),避免 fork shell 进程sysinfo()系统调用替代解析/proc/meminfostrncpy添加 null 终止保护5. 语言设置持久化
cl_language添加FCVAR_ARCHIVE标志,语言选择跨会话保存字体支持
引擎已内置中文字体支持(
DroidSansFallback.ttf),当语言设为 schinese/tchinese 时自动使用。注意
resource/目录(如garrysmod/resource/)