-
Notifications
You must be signed in to change notification settings - Fork 243
Translate Manuskript
This will help you to translate Manuskript:
- in a new language
- or updating existing translation
As of today (December 2017), it's possible to translate manuskript using weblate. You can check that here: https://hosted.weblate.org/projects/manuskript/translations/
It's new, so I'm not sure how it will work yet. But you'll have to create an account, and then you can either update existing translation, or start a new one.
Create a new issue if you have questions about that.
The methodology below does not use web translation and is still valid, refer to that if you don't want web translation.
You can see the list of available languages:
- in manuscript's settings dialog
- or at the end of the file: https://github.com/olivierkes/manuskript/blob/develop/i18n/manuskript.pro
Right now, manuskript is written in English, and translated in French, Spanish and German.
-
Clone manuskript repo, making sure you're in the
develop
branch. (See Install Source Code in the wiki) -
Edit
i18n/manuskript.pro
and addTRANSLATIONS += manuskript_XX.ts
at the very end, replacingXX
with your language. (xx_XX
in case of language specification, likept_BR
) -
Run
pylupdate5 -noobsolete i18n/manuskript.pro
This will generate a
.ts
file ini18n
folder, that you can translate using Qt Linguist, see below.pylupdate5
is part of PyQt5's tools.
Simply request it by creating a new issue. We will then generate the empty language file and send it to you. You can translate it following instructions below.
If you want to update an existing translation (for example because new features have been added that need translation, or because you want to correct mistakes), then:
-
Run
pylupdate5 -noobsolete i18n/manuskript.pro
It will update the
.ts
file ini18n
folder. -
Translate it (see below)
Once you have a .ts
file, you can start the translation work with Qt Linguist.
-
Open your
.ts
file with Qt Linguist -
If it's an empty translation, a Dialog will ask you to set the source and destination language
Set the Source language to English, and set the Target language to your language.
-
Start translating strings. For that, be extra careful to:
-
Respect punctuation: if a string ends with no punctuation, yours should have none. If it has, it should be the same. Now of course for some languages this will be open to your interpretation.
-
Respect markup: if a string contains HTML markup (for example
<p>
or<br>
) then include it exactly the same way, translating only what is non-markup. -
Keep
{}
: if you see this{}
within a string, it means some text or value will be inserted there. It must be present, or manuskript could crash. Also, if there is some text inside, for example{HelpText}
, then do not translate text within — it's an identifier. But translate the text around.
-
-
Once you're done, save your work in Qt Linguist and test it (see below), or send it back to manuskript's main repo (see below)
If you want to test your translation, you can:
- run
make i18n
from manuskript's root directory. - or run
lrelease i18n/manuskript_XX.ts
(replacingXX
with your language)
This will generate a i18n/manuskript_XX.qm
binary that manuskript can read.
-
Open
manuskript/settingsWindow.py
and after line 64 (or around there, search fortr["Deutsch"] = "manuskript_de.qm"
) add:tr["NAME-OF-YOUR-LANGUAGE"] = "manuskript_XX.qm"
. Be careful to respect code indentation (the number of spaces beforetr[...
), or manuskript will crash.This will tell manuskript to look for your translation file. (In the future, this could/should be automatic)
-
Run manuskript, and in the settings window (
F8
), chose your language. -
Restart manuskript
-
Go through every place you can think of to check whether your translation makes sense or not
Once you've translated the .ts
file and you're satisfied with it, you need to make it available to all.
Create a new issue and post your .ts
file. Be sure to tell us the name of your language in your language (for example "French" is "Français").
We will check it, compile it, add it to the settings window in manuskript and if everything looks good it will be included in the next release of manuskript.
Your pull request must include at least the .ts
file (of course), but you can also include the .qm
file, and/or the modification in manuskript/settingsWindow.py
(if you don't to the last one, please tell us the name of your language in your language — for example "French" is "Français").