当前位置:网站首页>[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"
边栏推荐
- footstep
- Fundamentals of robot obstacle avoidance system
- Lambda终结操作count
- 学生管理系统
- 单片机:A/D 和 D/A 的基本概念
- Multi thread implementation of selling tickets and producers and consumers
- UDP connection map collection
- [Yugong series] June 2022 Net architecture class 081 API customization task of distributed middleware schedulemaster
- 单片机/嵌入式的实时性疑问解答
- 双目视觉——打造室外避障的“最优解”
猜你喜欢
随机推荐
【愚公系列】2022年06月 .NET架构班 081-分布式中间件 ScheduleMaster的API自定义任务
Flex layout
An error is reported in the JDBC connection database: connection to 139.9.130.37:15400 referred
Lambda end operation reduce merge
Lambda终结操作查找与匹配allMatch
任总与系统工程领域科学家、专家会谈纪要
手机私有充电协议解读
[200 opencv routines by youcans] 201 Color space conversion of images
【测试开发】测试的相关基本概念
Summary of meeting between president Ren and scientists and experts in system engineering
Spark optimization - Performance (general performance, operator, shuffle, JVM) tuning
Spark optimization - data skew solution
Serialization & deserialization
Detailed explanation of MySQL storage process
Determine whether the file encoding format is UTF-8 or GBK
【测试开发】博客系统——Loadrunner性能测试(发布博客功能 基准测试)
Lambda end operation collect
Advanced API review
Goframe day 5
【ZeloEngine】本地化流程/ImGui中文化









