Difference between revisions of "User:Kebap/translation infrastructure"

From Mudlet
Jump to navigation Jump to search
m (+Instructions from other project's translations)
(How to exclude text from translation)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
History:
+
{{TOC right}}
 +
 
 +
== History ==
 
* https://github.com/Mudlet/Mudlet/issues/856 - Setup a web-based translation service for Mudlet  
 
* https://github.com/Mudlet/Mudlet/issues/856 - Setup a web-based translation service for Mudlet  
 
* https://github.com/Mudlet/Mudlet/issues/1664 - Translation infrastructure of Mudlet web-presences  
 
* https://github.com/Mudlet/Mudlet/issues/1664 - Translation infrastructure of Mudlet web-presences  
  
  
Main sources of text:
+
== Main sources of text ==
  
 
* Mudlet client itself
 
* Mudlet client itself
Line 12: Line 14:
  
  
Processes for each:
+
== Processes for each ==
  
 
# Find out a way to tell outdated texts from relevant current texts which need translation.
 
# Find out a way to tell outdated texts from relevant current texts which need translation.
Line 26: Line 28:
  
  
References:
+
== References ==
  
 
* Another great in-depth look at several alternatives and the process in general in this master study thesis about “Translations in libre software”: https://larjona.wordpress.com/translations-in-libre-software/
 
* Another great in-depth look at several alternatives and the process in general in this master study thesis about “Translations in libre software”: https://larjona.wordpress.com/translations-in-libre-software/
Line 44: Line 46:
  
  
Decisions:
+
== Decisions ==
  
 
* We want to use US English in the source. Sometimes it is still en/GB - e.g. "licence/license", "color/colour", etc. SlySven will provide a dedicated en/GB translation, but origin will be en/US
 
* We want to use US English in the source. Sometimes it is still en/GB - e.g. "licence/license", "color/colour", etc. SlySven will provide a dedicated en/GB translation, but origin will be en/US
Line 50: Line 52:
 
* Some texts can't be translated easily in Crowdin, as they are surrounded by < and > for example. This needs to be adjusted in source. See [https://github.com/Mudlet/Mudlet/pull/1804 PR #1804] for example and possible solution.
 
* Some texts can't be translated easily in Crowdin, as they are surrounded by < and > for example. This needs to be adjusted in source. See [https://github.com/Mudlet/Mudlet/pull/1804 PR #1804] for example and possible solution.
 
** Some IRC texts start with ! or alike symbols which must not be translated. Compare above solution.
 
** Some IRC texts start with ! or alike symbols which must not be translated. Compare above solution.
 +
 +
 +
== Updating input strings for translation ==
 +
 +
* Using Qt Linguist: http://doc.qt.io/qt-5/qtlinguist-index.html
 +
* command will pull strings from Mudlet client's sources and put into mudlet.ts
 +
* command is: lupdate.exe -recursive .\src\ -ts .\translations\mudlet.ts
 +
* lupdate is available during [[Compiling_Mudlet#Compiling_on_Windows_7.2B|Windows compilation]] in this folder: C:\Qt\5.11.0\mingw53_32\bin\
 +
 +
 +
== Review progress on each language ==
 +
* Crowdin offers statistics in settings, counting translation percentage of ''words''
 +
* Whereas Mudlet counts percentage of ''strings'' and languages >95% receive a gold star
 +
* How to review the progress of current Crowdin translations:
 +
** Open PR "new Crowdin translation" created automagically by integration robots ([https://github.com/Mudlet/Mudlet/pull/2429 Example])
 +
** Open information from automatic Travis CI build, for example Linux gcc qmake ([https://travis-ci.org/Mudlet/Mudlet/jobs/515693306 Example])
 +
** Find lines starting like "Project MESSAGE: Building translations" and see statistics following ([https://travis-ci.org/Mudlet/Mudlet/jobs/515693306#L1380 Example])
 +
 +
Example progress snapshot from 2019-04:
 +
<syntaxhighlight lang="lua">
 +
Project MESSAGE: Building translations
 +
lang trnsl utrnsl finish unfin total percentage
 +
de_DE 1863 28 1863 0 1891 98
 +
el_GR 0 1891 0 0 1891 0
 +
en_GB 403 1488 403 0 1891 21
 +
es_ES 735 1156 735 0 1891 38
 +
fr_FR 150 1741 150 0 1891 7
 +
it_IT 809 1082 809 0 1891 42
 +
nl_NL 45 1846 45 0 1891 2
 +
pl_PL 514 1377 514 0 1891 27
 +
pt_PT 260 1631 260 0 1891 13
 +
ru_RU 1686 205 1684 2 1891 89
 +
zh_CN 961 930 961 0 1891 50
 +
zh_TW 0 1891 0 0 1891 0
 +
en_US 11 0 11 0 11 100
 +
</syntaxhighlight>
 +
 +
== How to exclude text from translation ==
 +
 +
* In .cpp files, do not use tr() function. Easy.
 +
* In .ui files, change the opening <code><string></code> tags of the elements to <code><string notr="true"></code>
 +
** Or click in QtDesigner like this: https://github.com/Mudlet/Mudlet/pull/2481#pullrequestreview-221930644

Latest revision as of 08:32, 5 April 2019

History


Main sources of text

  • Mudlet client itself
  • Mudlet website
  • Mudlet wiki
  • "other" spontaneus texts need to be included manually


Processes for each

  1. Find out a way to tell outdated texts from relevant current texts which need translation.
  2. Get texts out of sources (see above). Can this be automated with any tool? Who should be responsible?
  3. Get texts in to translation tool.
  4. Translating inside tool (ok this is to be expected, but also needs good interface and workflows)
  5. Translators report confusing strings back to Mudlet team with information how they need to be adjusted.
  6. Mudlet team updates text in source. Either because of reports, or because of natural evolution.
  7. Updated texts from source need updates in translation tool. Export and import again, plus diff.
  8. Translated texts will be finished. Export them from translation tool. Automation again?
  9. Import translated text to source.
  10. Display of translations in source. Here we will need some sort of language toggle switch in each source.


References


Decisions

  • We want to use US English in the source. Sometimes it is still en/GB - e.g. "licence/license", "color/colour", etc. SlySven will provide a dedicated en/GB translation, but origin will be en/US
  • When a language offers multiple choices on how to address the reader, we will choose the less formal, more friendly way
  • Some texts can't be translated easily in Crowdin, as they are surrounded by < and > for example. This needs to be adjusted in source. See PR #1804 for example and possible solution.
    • Some IRC texts start with ! or alike symbols which must not be translated. Compare above solution.


Updating input strings for translation


Review progress on each language

  • Crowdin offers statistics in settings, counting translation percentage of words
  • Whereas Mudlet counts percentage of strings and languages >95% receive a gold star
  • How to review the progress of current Crowdin translations:
    • Open PR "new Crowdin translation" created automagically by integration robots (Example)
    • Open information from automatic Travis CI build, for example Linux gcc qmake (Example)
    • Find lines starting like "Project MESSAGE: Building translations" and see statistics following (Example)

Example progress snapshot from 2019-04:

Project MESSAGE: Building translations
lang	trnsl	utrnsl	finish	unfin	total	percentage
de_DE	1863	28		1863	0		1891	98
el_GR	0		1891	0		0		1891	0
en_GB	403		1488	403		0		1891	21
es_ES	735		1156	735		0		1891	38
fr_FR	150		1741	150		0		1891	7
it_IT	809		1082	809		0		1891	42
nl_NL	45		1846	45		0		1891	2
pl_PL	514		1377	514		0		1891	27
pt_PT	260		1631	260		0		1891	13
ru_RU	1686	205		1684	2		1891	89
zh_CN	961		930		961		0		1891	50
zh_TW	0		1891	0		0		1891	0
en_US	11		0		11		0		11		100

How to exclude text from translation