Skip to content

feat(color): add Korean font and localization support #6118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 25, 2025

Conversation

siyeongjang
Copy link
Contributor

  • Added Korean font (NanumBarunpen) optimized for EdgeTX
  • Added tts_ko.cpp and corresponding localization entries
  • Defined TR_VOICE_KOREAN for full integration
  • Resubmission of previous PR to re-trigger CI (previous PR skipped due to workflow filter)

…/ NanumBarunpen)

- Update make_fonts.sh for Korean character set
- Add get_char_ko.py for extracting used symbols
- Include NanumBarunpenR/B.ttf and LICENSE
- Add ko.h translation header
※ Known issue: Some UI elements not shown properly in Korean mode
@siyeongjang
Copy link
Contributor Author

Hi maintainers 👋

This PR adds Korean font and localization support for EdgeTX (TX16S).
All commits are complete and ready, but the workflow is currently awaiting approval.

Could you please approve the workflows so that the CI jobs can run?

Thank you!

@3djc
Copy link
Collaborator

3djc commented Apr 21, 2025

Done
Don't close and re-open, we can retrigger runs if required

@siyeongjang
Copy link
Contributor Author

siyeongjang commented Apr 21, 2025

👋 Hello, while testing the Korean-localized firmware, I encountered a potential bug and would like to ask for your advice.


🐞 Bug Description

Menu Path: After uploading the Korean firmware → SYS → 조종기설정(Radio Setup) → 채널 기본 순서(Default Channel Order)
📸Issue: When I open this menu, the dropdown list does not display any items.
ko_bug


🔍 Investigation Attempt

I reviewed the function templateSetupItemModel() in companion/src/firmwares/generalsettings.cpp, which seems to build options based on the characters 'R', 'E', 'T', 'A'.

To confirm if this function is being executed, I tried connecting a USB to UART module to AUX1 (UART1) on the TX16S to capture debug messages, but I couldn’t establish communication.

Here’s what I tried:

  • Serial connection via terminal (PuTTY)
  • Baudrates: 115200, 9600, and other common settings
  • Wiring: GND, TX, RX (cross-wired)

Unfortunately, no debug output was received.

📸 UART Port on TX16S (AUX1): tx16s_uart
📸 PuTTY Serial Settings: putty_setting


🙏 Request for Help

  1. Could you provide any insights into this issue?

  2. Is UART-based debugging the best method to resolve this issue?

    • If not, are there any alternative debugging methods you would recommend?
  3. Also, is there a way to change the GUI language (not just the voice prompts)?

    • The menu SYS → Radio Setup → Voice Language only changes the audio language, but the GUI text remains the same.
    • Is there a way to apply Korean (or other) language packs to the full UI?

Thank you very much for your help and your great work on EdgeTX!

@pfeerick
Copy link
Member

companion/src/firmwares/generalsettings.cpp

No, you are looking at the companion source, not radio, so that won't help you. This is where you want to be starting to look...

{
// RX channel order
STR_DEF_CHAN_ORD,
[](Window* parent, coord_t x, coord_t y) {
uint8_t mains = adcGetMaxInputs(ADC_INPUT_MAIN);
auto max_order = inputMappingGetMaxChannelOrder() - 1;
auto choice = new Choice(parent, {x, y, 0, 0}, 0, max_order,
GET_SET_DEFAULT(g_eeGeneral.templateSetup));
choice->setTextHandler([=](uint8_t value) {
std::string s;
for (uint8_t i = 0; i < mains; i++) {
s += getAnalogShortLabel(inputMappingChannelOrder(value, i));
}
return s;
});
}
},

To confirm if this function is being executed, I tried connecting a USB to UART module to AUX1 (UART1) on the TX16S to capture debug messages, but I couldn’t establish communication.

Did you build the firmware with -DDEBUG=Y and then configure AUX1 to be Debug? Since this is a virtual serial port, I don't think the baud rate actually matters, but it is nominally 400k baud.

Is UART-based debugging the best method to resolve this issue?

For this, you should be able to use the simu target (i.e. make simu instead of make firmware or make companion), and run the mini simu simulator that is in the native subfolder, and get any debugging messages you add in that way.

Also, is there a way to change the GUI language (not just the voice prompts)?

No, not yet. There is simply not enough space to store multiple language packs in a single firmware file, as well as any additional RAM usage that might incur. In the future we plan to investigate being able to load them from file into memory, thus allowing language packs to be seperate assets stored on the SD card. Until (and even now) a compile-time option has is been sufficient, especially since it is not envisaged that you would need to swap languages (periodically, or ever, really).

@philmoz
Copy link
Collaborator

philmoz commented Apr 21, 2025

The problem with the default order strings is that the code assumes that the translated names always start with a single byte (Latin) character.
This is the strings TR_STICK_NAMES0, TR_STICK_NAMES1, TR_STICK_NAMES2 and TR_STICK_NAMES3.
Your translations use unicode characters.

@pfeerick
Copy link
Member

Can you also ensure your additions to

companion/src/generaledit/generalsetup.cpp
radio/src/CMakeLists.txt

are in alphabetical order... the other lists don't matter, but those ones are currently properly in order.

@siyeongjang
Copy link
Contributor Author

companion/src/firmwares/generalsettings.cpp

No, you are looking at the companion source, not radio, so that won't help you. This is where you want to be starting to look...

{
// RX channel order
STR_DEF_CHAN_ORD,
[](Window* parent, coord_t x, coord_t y) {
uint8_t mains = adcGetMaxInputs(ADC_INPUT_MAIN);
auto max_order = inputMappingGetMaxChannelOrder() - 1;
auto choice = new Choice(parent, {x, y, 0, 0}, 0, max_order,
GET_SET_DEFAULT(g_eeGeneral.templateSetup));
choice->setTextHandler([=](uint8_t value) {
std::string s;
for (uint8_t i = 0; i < mains; i++) {
s += getAnalogShortLabel(inputMappingChannelOrder(value, i));
}
return s;
});
}
},

To confirm if this function is being executed, I tried connecting a USB to UART module to AUX1 (UART1) on the TX16S to capture debug messages, but I couldn’t establish communication.

Did you build the firmware with -DDEBUG=Y and then configure AUX1 to be Debug? Since this is a virtual serial port, I don't think the baud rate actually matters, but it is nominally 400k baud.

Is UART-based debugging the best method to resolve this issue?

For this, you should be able to use the simu target (i.e. make simu instead of make firmware or make companion), and run the mini simu simulator that is in the native subfolder, and get any debugging messages you add in that way.

Also, is there a way to change the GUI language (not just the voice prompts)?

No, not yet. There is simply not enough space to store multiple language packs in a single firmware file, as well as any additional RAM usage that might incur. In the future we plan to investigate being able to load them from file into memory, thus allowing language packs to be seperate assets stored on the SD card. Until (and even now) a compile-time option has is been sufficient, especially since it is not envisaged that you would need to swap languages (periodically, or ever, really).

Ah, I see now — I was definitely looking in the wrong place! 😅
Thank you so much for the clear explanation and detailed guidance — truly appreciated!

I'll definitely try building with the debug options you mentioned and explore the simulator approach as well.

If I may ask one more follow-up question:

So up until now, if someone wanted to use a different UI language,
did they have to build the firmware themselves with a flag like -DTRANSLATIONS='language'?
In other words, has it been up to each individual to include their desired language during compilation?

Thanks again for your continued support!

@siyeongjang
Copy link
Contributor Author

The problem with the default order strings is that the code assumes that the translated names always start with a single byte (Latin) character. This is the strings TR_STICK_NAMES0, TR_STICK_NAMES1, TR_STICK_NAMES2 and TR_STICK_NAMES3. Your translations use unicode characters.

"Haha, thank you — that was incredibly helpful advice!"

@siyeongjang
Copy link
Contributor Author

Can you also ensure your additions to

companion/src/generaledit/generalsetup.cpp
radio/src/CMakeLists.txt

are in alphabetical order... the other lists don't matter, but those ones are currently properly in order.

"I’ll make sure to reflect your suggestions accordingly."

@pfeerick
Copy link
Member

So up until now, if someone wanted to use a different UI language,
did they have to build the firmware themselves with a flag like -DTRANSLATIONS='language'?
In other words, has it been up to each individual to include their desired language during compilation?

Yes. Or download a pre-built firmware in their language (i.e. from here for 2.5 - 2.10 => https://github.com/pfeerick/lang-firmwares), via the CloudBuild tab in https://buddy.edgetx.org/, or by setting the correct radio language in Companion and downloading/updating firmware via Companion (it uses the CloudBuild server as the firmware source then also).

@siyeongjang
Copy link
Contributor Author

So up until now, if someone wanted to use a different UI language,
did they have to build the firmware themselves with a flag like -DTRANSLATIONS='language'?
In other words, has it been up to each individual to include their desired language during compilation?

Yes. Or download a pre-built firmware in their language (i.e. from here for 2.5 - 2.10 => https://github.com/pfeerick/lang-firmwares), via the CloudBuild tab in https://buddy.edgetx.org/, or by setting the correct radio language in Companion and downloading/updating firmware via Companion (it uses the CloudBuild server as the firmware source then also).

"Ah, I see.
Thank you for the detailed explanation."

@siyeongjang
Copy link
Contributor Author

안녕하세요.
리뷰해주신 내용을 반영하여 커밋(af6f20c)을 푸시했습니다.
모든 요청사항이 반영되었으니, 다시 한 번 검토 부탁드립니다.
항상 감사드립니다!


Hello,
I’ve pushed the latest commit (af6f20c) with all requested changes applied.
Kindly review the updates at your convenience.
Thank you again for your guidance and support!

@pfeerick pfeerick changed the title feat: Add Korean font and localization support for TX16S feat(color): add Korean font and localization support Apr 24, 2025
@pfeerick
Copy link
Member

This generally looks fine. Still need to check one or two details when I am back at my other machine, but if this is working properly on the TX16S for you, it should be right to be included in 2.11 onwards.

@siyeongjang
Copy link
Contributor Author

Thanks so much for the feedback! 🙏
I've tested thoroughly on the TX16S and everything works as expected.
If any issue arises after merging, I’ll be happy to respond and fix it promptly.
Let me know if there’s anything else I can improve!

Not moving `en` in `opentxinterface.h` since it would probably affect combo list order.
@pfeerick pfeerick added this to the 2.11 milestone Apr 25, 2025
@pfeerick pfeerick self-requested a review April 25, 2025 23:56
Copy link
Member

@pfeerick pfeerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! :)

@pfeerick pfeerick merged commit 9788d62 into EdgeTX:main Apr 25, 2025
56 checks passed
pfeerick added a commit that referenced this pull request Apr 26, 2025
Co-authored-by: Peter Feerick <pfeerick@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants