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

Internationalization #40

Closed
Dalan94 opened this Issue Jan 31, 2016 · 22 comments

Comments

Projects
None yet
3 participants
@Dalan94
Contributor

Dalan94 commented Jan 31, 2016

I would like to translate QOwnNote in french but I don't find guideline in your project. I know how to translate a Qt project but I don't know how to include it in the build system. Could you provide the basis of the internationalization ? Thanks.

@pbek

This comment has been minimized.

Owner

pbek commented Jan 31, 2016

Thank you very much for your generous offer, @Dalan94
It will be a major task to make every string translation-able! 😁
I have put it on my todo list, but it will possibly take a while.

@pbek

This comment has been minimized.

Owner

pbek commented Feb 1, 2016

For a start it wasn't that hard to get a translation file for the UI and the texts that already have translation support.
Here is your translation file:
https://github.com/pbek/QOwnNotes/blob/develop/src/languages/QOwnNotes_fr.ts

Are you familiar with Qt linguist?
You could create a pull request for your translation, then you will get the credit for your effort!
Thanks a lot again!

@Dalan94

This comment has been minimized.

Contributor

Dalan94 commented Feb 1, 2016

Yes I know QtLinguist and I can translate the text that already have translation support.
I am also a developer and I'm a little familiar with Qt so I can help you making all the strings translatable.

@pbek

This comment has been minimized.

Owner

pbek commented Feb 1, 2016

That's awesome! Just give me a call if you need anything!
Please make your pull requests to the develop branch.
Thanks a lot!

I will start a German translation then (after I figure out how to test it).

@Dalan94

This comment has been minimized.

Contributor

Dalan94 commented Feb 1, 2016

Ok.
To use the translation you need this code in the main.cpp:

QString locale = QLocale::system().name().section('_', 0, 0);
QTranslator translator;
translator.load(QString("../languages/QOwnNotes_") + locale);
a.installTranslator(&translator);

But the path to the translation must be change because it's not the same after installing QOwnNote.

@pbek

This comment has been minimized.

Owner

pbek commented Feb 1, 2016

In my case the path was even translator.load("../src/languages/QOwnNotes_" + locale);, because the binary has to find the .qm files. And now I realize the .qm files have to be deployed along with the binary... It will be a lot of fun to integrate and test that in in the 10 or so build/package/deploy systems I maintain... 😁

@Dalan94

This comment has been minimized.

Contributor

Dalan94 commented Feb 1, 2016

Yes it's complicated. I think that the best solution is using this translator.load(QString("languages/QOwnNotes_") + locale);.

And for the Linux installation, the binary and the translations will be in /usr/share/QOwnNote and in /usr/bin/QOwnNote a script like this

cd /usr/share/QOwnNote
./QOwnNote

When you use QtCreator you can change the working directory during the execution in the project settings so it's not a problem.

I use this in my own project and it work well :)

@pbek

This comment has been minimized.

Owner

pbek commented Feb 1, 2016

Csuper has a nice logo. 😄
I have several challenges. I need it getting to work in my local Qt Creator (with qmake), in CLion (with cmake) and on 10+ build systems. 😀

@pbek

This comment has been minimized.

Owner

pbek commented Feb 2, 2016

In v0.88 the translation support in the different repositories should work pretty well. I will test after I release it.

@Dalan94

This comment has been minimized.

Contributor

Dalan94 commented Feb 2, 2016

OK, fine.
I'm working on the french translation and making all the strings translatable.
I will create a pull request when it will be finished (this evening or tomorrow).

@pbek

This comment has been minimized.

Owner

pbek commented Feb 2, 2016

Awesome, you are the best! I'm looking forward to your pull request!

@pbek

This comment has been minimized.

Owner

pbek commented Feb 2, 2016

The German translation (the few strings I translated so far) works really well in v0.88!

@calis2002

This comment has been minimized.

Contributor

calis2002 commented Feb 2, 2016

I can help you with German translation if still necessary.

@pbek

This comment has been minimized.

Owner

pbek commented Feb 2, 2016

That's great! I gladly accept your offer, @calis2002 !
Are you yet familiar with Qt linguist?
The translation file we need to translate is this one: https://github.com/pbek/QOwnNotes/blob/develop/src/languages/QOwnNotes_de.ts

A big thank you!

@pbek

This comment has been minimized.

Owner

pbek commented Feb 2, 2016

In v0.89 it will be possible to select the interface language in the settings, currently QOwnNotes uses the system language.

@calis2002

This comment has been minimized.

Contributor

calis2002 commented Feb 2, 2016

No, unfortunately not. I'm very new to programming. Just got a little bit C# and PHP knowledge in the last months.

Edit: Ok, got QT linguist installed. Doesn't seem to complicate. I will try and let you know how things work :D

@pbek

This comment has been minimized.

Owner

pbek commented Feb 2, 2016

Good job! You should be even able to see the dialog if you have checked out the source code. Are you by chance familiar with GitHub and git so you can checkout a fork of the QOwnNotes source code to make your changes and create a pull request?

@pbek

This comment has been minimized.

Owner

pbek commented Feb 3, 2016

Thank you again, @calis2002 for your great contribution, it will be released today!

@Dalan94 in case you need more information. I now tried to write a "mini tutorial" here: http://www.qownnotes.org/Knowledge-base/How-can-I-help-to-translate-QOwnNotes

@calis2002

This comment has been minimized.

Contributor

calis2002 commented Feb 3, 2016

@pbek no problem. I'm happy to contribute something to such a great project ;)

The mini tutorial is a great idea. But maybe you can add the translators somewhere in the Readme.md instead of creating an issue for every language. It would give you/us a better overview who translates what language.

@pbek

This comment has been minimized.

Owner

pbek commented Feb 3, 2016

Thank you for your kind words, @calis2002 ! 😉
Yes, I will definitely make a list somewhere too, but it's more about the "first contact".
The issues will be needed for troubleshooting in the beginning and I also don't want a single issue for all translations because that will end in notification fatigue for the good hearted translators. 😄

@calis2002

This comment has been minimized.

Contributor

calis2002 commented Feb 3, 2016

Ok, good Point.

@pbek

This comment has been minimized.

Owner

pbek commented Feb 5, 2016

Thanks a lot for your contributions! 🎉 Please feel free to maintain and update your translations with further pull requests!

@pbek pbek closed this Feb 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment