当前位置:网站首页>[zeloengine] localization process /imgui Chinese culture
[zeloengine] localization process /imgui Chinese culture
2022-06-13 03:51:00 【zoloypzuo】
【ZeloEngine】 Localization process /ImGui Chinese culture
Conclusion
Chinese culture and icon The pit of (2021/12/19 Open pit )
- ImGui Culture in the editor interface
- A fully automated translation process that can translate what you see
- 【 pit 】 Chinese character set range
- 【 pit 】icon font and id Mechanism
- 【 pit 】 Shielded node
Localization process
First, a version of the standard process was made v1, Then do some optimization v2
v1 Localization process
【ZeloEngine】 Localization process /ImGui Chinese culture _ Bili, Bili _bilibili
v1 The standard process is :
- I open the game , notice “Open all” It's English , No translation
- I'll search the code "Open all", Find the string , use gettext Function package , Convert to Chinese
- Go to .pot add to "Open all", Then translate .po
- Chinese is displayed in the game
v2 Localization process
Q: What is localization ?
A: All text that users can see should be in Chinese
So we can monitor ImGui All text parameters that will be displayed in the , stay ImGui Implement the package gettext, And output all the problems encountered in the runtime / See the text , Automatically update the translation template file .pot
Directly modifying imgui.cpp The risk is still too great ,imgui It's still being updated
Good thing we have Lua Script binding layer , It is a layer of encapsulation , And all imgui Logic is all about Lua Written , Just change it here
v2 The process is :
- I open the game , notice "Open all"
- Close the game , Automatically refresh .pot, newly added "Open all"
- translate .po
- Chinese is displayed in the game
The optimization is gone
- Observe which text has not been translated
- Search the code key Change code
- stay .pot Add in key
pit
A vision of complete automation , Will often be a variety of corner case break , Turn automation into a black box for handling all kinds of strange situations
v1 The standard process is not completely bad , Implement a simple , No, BUG, Completely controllable
Chinese character set range
GetGlyphRangesChineseSimplifiedCommon is misleading · Issue #2882 · ocornut/imgui
imgui Two ranges in Common and Full All have problems
- Common Too small , Many words are garbled
- Full Too big , Measured additional consumption 300MB Memory
issue The one in , Actually measured 100MB, There is no garbled code , Use it first
label ID & icon font
Direct use ImGui The interface of gettext The problem is ,imgui It's similar my_name##1
Of ID Mechanism
icon font It's a good thing , General icon The method is small pictures ,icon font It's a icon Painted as a character , similar emoji
But a string has icon It's very troublesome. , Need to do a simple parse, Identify beginning icon And the ending id, Cut out the text , Spell it back after translation
"%icon% my name ##1"
=> "%icon%" gettext("my name") "##1"
边栏推荐
- On interests and hobbies
- An error is reported in the JDBC connection database: connection to 139.9.130.37:15400 referred
- [test development] automated test selenium (III) -- unittest framework analysis
- 【愚公系列】2022年06月 .NET架构班 081-分布式中间件 ScheduleMaster的API自定义任务
- 【面试复习】自用不定时更新
- [test development] blog system - LoadRunner performance test (publish blog function benchmark test)
- Jumpserver installation
- EGO Planner代码解析----CMakeLists.txt和package.xml
- Talking about the wavelength of laser radar
- Lambda终结操作查找与匹配noneMatch
猜你喜欢
Goframe day 5
单片机:Modbus 通信协议介绍
【测试开发】测试管理工具禅道的安装
【测试开发】自动化测试selenium(二)——webdriver常用的API
leetcode.1 --- 两数之和
MySQL 8.0 enables remote root user access and solves the problem of you are not allowed to create a user with Grant
[test development] automated test selenium (II) -- common APIs for webdriver
UnionPay commerce - merchant statistics service platform
[web] cookies and sessions
OKR和KPI的区别
随机推荐
Lambda termination operation find and match anymatch
单片机:D/A 输出
Installing MySQL 8.0.20 under Linux and ubuntu20.04 LTS
[test development] automatic test selenium (I)
单片机:NEC 协议红外遥控器
单片机串口通信原理和控制程序
单片机:EEPROM 多字节读写操作时序
Meaning of different values of margin and padding
Goframe day 5
Detailed explanation of MySQL storage process
Binocular vision -- creating an "optimal solution" for outdoor obstacle avoidance
Student management system
Spark optimization - Troubleshooting
【 développement d'essais 】 sélénium d'essais automatisés (Ⅲ) - - analyse du cadre unitest
try-catch finally执行顺序的例题
无人机避障四种常见技术中,为何大疆首选双目视觉
USB-IF BC1.2充电协议解读
Lambda end operation collect
【愚公系列】2022年06月 .NET架构班 081-分布式中间件 ScheduleMaster的API自定义任务
Oracle built-in functions