QNapi / qnapi

Qt-based, multi-engine, multi-platform subtitle downloader
http://qnapi.github.io
291 stars 39 forks source link

Unhardcode polish language and add support for multiple GUI languages #103

Closed Fincer closed 7 years ago

Fincer commented 7 years ago

Seriously, considering translating your program into other languages. The functionality of QNapi is just awesome (and thanks for creating this program! It really is good and handy, you've truly seen trouble making it) but understand that many of us do not either understand or want use polish language as the default one.

It's like I write a program in finnish language and well...good luck for me then. Even still, I'm using en_US as my system language. If any program is hardcoded, well, let's take my case: all other programs use english language but this one uses finnish...or polish...it's just not good and breaks the lingual coherence. My system uses english and I expect all programs do the same.

If you were able to write a program like this in Qt, it shouldn't be too difficult task to create a technical codebase for separate string files.

I've done the translation (not 100% perfect) for english (modified QNapi cpp source code), but multilingual support would be still preferred because the language is still hardcoded. My translation patches are here:

https://github.com/Fincer/linux-patches-and-scripts/tree/master/qnapi

The program truly has a great potential for all users around the world, not just for polish people. I just wonder if you can't see it. Of course, it's your program, but you waste so much potential here because it technically already downloads subtitles for multiple languages. The translation task (at least unhardcoding the strings if not doing the exact translation process) can't be too laborious.

For Linux users like me applying custom patches and compiling from source is quite trivial task but for Windows users it's completely another story.

Are you considering to do the unhardcoding?

krzemin commented 7 years ago

Hey! Thank you for care and providing the patches.

Of course it would be nice to to have support for multi-lingual messages in GUI/CLI applications. It is not trivial task to do, but the only reasonable way to do the translation would be to make english as default language and prepare translations for different languages with Qt Linguist.

Would you like to make a PR from your patches?

PS. Let me prioritize this issue for upcoming 0.2.3 release.

Fincer commented 7 years ago

Hey,

thank you for your response. Happy to see this is getting somewhere.

The english translation is not perfect, as I've not tested all possible strings in the program itself (for example, should "Search subtitles" be "Searching subtitles" etc. ?) I've checked some of these only in code level, some in GUI level.

I guess the multi-language support can properly be done with Qt internationalization support

https://doc.qt.io/qt-5/internationalization.html

I can do PR from the patches but that means also that the current polish interface is wiped out. Better solution would be adding support for both polish & english languages (as polish strings exist already) so that no strings would be deleted in the process. This method would be a good start for implementing support for multiple languages since additional translation process is not basically required. Of cource, it requires some work to be done in coding (downside).

Anyway, if you see it worth it, I can still make a PR.

krzemin commented 7 years ago

If we want to get this done in 0.2.3, we have to at least start with something ;) Let's summarize what we need to do:

Having it done enables the possibility for translating to other languages as well.

Your PR would then be the first step. During review I guess we can improve eventual translation.

Fincer commented 7 years ago

Sure! You are right. Better than nothing.

Your plans sound great, just as I thought it should be.

I will do the PR soon later (in 1-2 days) since I need to re-apply the patch files for the git version of QNapi. However, it takes a little while to do that.

Fincer commented 7 years ago

Pull request added.

https://github.com/QNapi/qnapi/pull/104

Fincer commented 7 years ago

You may find the following interesting while implementing the multilingual support:

https://github.com/Fincer/linux-patches-and-scripts/tree/master/qnapi/multilang-implementation-draft

Files behind the link include strings extracted from QNapi source code, put into separate files. I guess it's easier to work with them (and yes, they are not correctly formatted. It's intended for now. The basic idea is just to put all the strings in one place)

In addition, I added "interface language" GUI options into frmoptions.ui (Note: I didn't include that string in en.po & pl.po)

krzemin commented 7 years ago

OK, it seems all the steps for making QNapi multi-lingual that we we initially sketched are done now.

Feel free to test snapshot version and/or help with translating to other languages with Qt linguist.