edb-debugger icon indicating copy to clipboard operation
edb-debugger copied to clipboard

internationalization

Open fairycn opened this issue 2 years ago • 8 comments

At present, the version does not support the function of custom interface language. I hope this function can be added to facilitate the use of non-English users. If you have this idea, I can provide assistance in Simplified Chinese translation.

fairycn avatar Jun 23 '22 09:06 fairycn

So we actually try to do our best to mark all strings for translation, but we've never gotten any offers for translation. If you're interested in helping with Simplified Chines, we'd love your help. let me know and I'll setup instructions on how to create a translation file!

eteran avatar Jun 23 '22 14:06 eteran

You can refer to this project for the interface multi-language support feature. https://github.com/j6t/kdbg

You only need to provide a language package (po file), and the translator will translate into the language you need based on this language package. The naming of language packages can be based on the language ID: en-us、zh-CN

Qt reference:

  • Adding Multi-language Support to Your Project https://doc.qt.io/qtdesignstudio/multilanguage-tutorial.html
  • How to create a multi language application https://wiki.qt.io/How_to_create_a_multi_language_application

fairycn avatar Jun 24 '22 09:06 fairycn

Oh, I'm very familiar with how it's done :-).

For edb it would be slightly different than .po files because we would use Qt's built in internationalization system with Qt linguist, but the concept is similar enough to what you described.

I was just saying that if you're interested in being our first translator, I'm happy to create some instructions for how we'd want to do it for this project.

That, and we'd have to write a little bit of code on our end to embed the language resources in edb, and load them as needed at runtime.

eteran avatar Jun 24 '22 20:06 eteran

Specifically, as the second link you shared says, we'd use .ts files which get compiled into .qm files. We'd then want to just make it so edb can load them. Nothing too complex, I've done it before with other projects.

eteran avatar Jun 24 '22 21:06 eteran

@cn-fairy If you are still interested in helping translate things, this would be a great start:

  1. install Qt linguist
  2. cd into the "src" directory of edb
  3. run lupdate *.cpp *.h *.ui -ts edb-cn.ts. This will produce the XML file for translation
  4. run linguist edb-cn.ts

I believe the result will be a .qm file. From once you have that, please just comment on this issue and we can discuss the strategies for adding it to the codebase via a PR. Since it would be the first translation, we don't yet have a "proper place to put the files".

In the meantime I can plan out where it should go and how we plan to have edb load it.

eteran avatar Jun 29 '22 00:06 eteran

windows run : lupdate error: File '*.cpp' does not exist. lupdate version 6.3.0

linux run :Updating 'edb-cn.ts'...Found 321 source text(s) (321 new and 0 already existing) image

I moved it to Windows. It can be opened using linguist image File: edb-zh-CN.zip image

fairycn avatar Jun 29 '22 02:06 fairycn

Ok! that was fast, I'll look into how to best work this into the system as soon as I can.

eteran avatar Jun 29 '22 16:06 eteran

@cn-fairy Don't worry, I haven't forgotten about you! I just merged in a PR that I had been working on for a visual improvement and will soon look at how I'd like to include your translation files :-)

Thanks again!

eteran avatar Jul 14 '22 19:07 eteran

@fairycn I know it's been forever, but I am currently working on trying to integrate your efforts here. Thanks so much.

eteran avatar Jan 17 '24 23:01 eteran

Your translation has been merged in and is working with: LANG=zh_CN ./edb

eteran avatar Jan 18 '24 00:01 eteran