Difference between revisions of "TDE Weblate Translation Workspace"

From Trinity Desktop Project Wiki
Jump to navigation Jump to search
imported>SlavekB
(→‎Work on translations: Added pictures)
(Formatting improvements, categories)
 
(14 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  +
'''Translating Trinity''' is a relatively easy process which nevertheless requires attention to details. If you want to contribute by translating TDE in your language then you will need to create an account in the translation workspace (called TWIW). The Trinity Project uses ''Weblate'' to manage translations. Below you will find a handy guide which walks you through from creating an account to contributing.
   
='''About Weblate'''=
+
=About Weblate=
   
[https://weblate.org/ Weblate] is an open source web-based translation management system with tight version control integration. It provides simple and clean user interface, quality checks and automatic linking to source files.
+
[https://weblate.org/ Weblate] is an open source web-based translation management system that simplifies translation of strings in a project into multiple languages. It has a tight integration with version control tools used to manage the project source code and provides a simple and clean user interface, quality checks and automatic linking to source files.
   
='''TDE Weblate'''=
+
=TDE Weblate Translation Workspace (TWTW)=
   
The [https://mirror.git.trinitydesktop.org/weblate TDE Weblate] is our own instance of Weblate designed to manage TDE translations. It is tightly integrated with [[TDE Gitea Workspace]] (TGW). It provides:
+
The [https://mirror.git.trinitydesktop.org/weblate TDE Weblate Translation Workspace (TWTW)] is a self-hosted instance of Weblate designed to manage TDE translations. It is tightly integrated with [[TDE Gitea Workspace]] (TGW) and provides:
   
* simple and clean user interface for work on translations
+
* a simple and clean user interface for working on translations
 
* integrated quality checks of translations
 
* integrated quality checks of translations
* displaying referenced source files in TGW
+
* displaying of referenced source files in TGW
 
* retrieving translations and templates from TGW
 
* retrieving translations and templates from TGW
* automatic update of translations according to the templates
+
* automatic updating of translations according to the templates
* automated pushing of translations into TGW
+
* automated committing of translations back into TGW
* proper crediting of translators in commits
+
* proper crediting of translators in commit messages
  +
* consistent updating of strings from both stable and development branches
   
Thanks to TDE Weblate you do not have to learn how to work with the GIT, you do not have to deal how to get translation files from GIT, how to merge it back to GIT, how to update translation files by templates,… You can focus to work on translations.
+
Thanks to TWTW users can simply focus on the translation work without having to worry about how to get the translation template files, how to update them and how to send their changes back to developers. Even users without any coding knowledge will be able to successfully contribute to improve translation strings and make TDE an even better environment.
   
[[File:TDE_Weblate_intro.png|321px]]
+
[[File:TDE_Weblate_intro.png|500px]]
 
<br/><br/>
 
<br/><br/>
   
=='''Integration with TGW'''==
+
==Integration with TGW==
   
TDE Weblate manages its own clone of repositories, but is very tightly integrated with TGW.
+
TWTW manages its own copy of the source code repositories, but is very tightly integrated with TGW.
   
Commits to TGW automatically invokes the update repository in TDE Weblate. If the translation template is updated, TDE Weblate will automatically update the translation files and immediately push them back to TGW. The translation files are therefore primarily maintained by the TDE Weblate.
+
Commits into TGW automatically trigger the update of TWTW correspondent repositories. If some strings have changed and any translation template file has been updated, TWTW will automatically update the translation files for each language and immediately push them back to TGW. The translation files are therefore primarily maintained up to date by this mechanism.
   
During work on translations, individual translated strings are not immediately pushed into TGW. In order for translators to have enough time to work and also to check their translations, while avoiding too many small commits to TGW, pushing translations into TGW takes place after one day delay.
+
User translation work consist in updating the changed strings into each of the modified translation files. When users work on translations, individual translated strings are not immediately pushed into TGW. In order for translators to have enough time to work and check their translations and to avoid having too many micro commits, changes are pushed into TGW after a delay of one day.
   
  +
Strings from the development branch will be presented to the users for translation. Nevertheless TWTW also attempts to automatically update the same strings in the stable branch whenever possible. Strings already in the stable branch that are no longer in the development branch will be retained, therefore by continuously working on translating strings from the development branch should also result in the stable branch translations being up to date after an initial startup period. Please note that updates on the stable branch are pushed twice a week rather than daily.
Work on translations is done on the master branch – on the latest development branch. In order to update the translations into a stable branch, a regular merge of the translation files between the master and the stable branch is performed.
 
   
 
==Structure of translations==
Therefore translators do not need to work directly with GIT repositories.
 
   
 
Each individual translation template file in TGW is represented in TWTW as a ''component''. Components are grouped into ''projects'' (such as '''tdelibs''', '''tdebase''', '''applications''' ...) in order to ease navigation and workflow. Component names have been chosen so that translators can easily determine to which program and part they belong to.
=='''Structure of translations'''==
 
   
 
=Using TDE Weblate=
Each individual translation template in GIT is as an individual ''component'' in TDE Weblate. For better orientation, the components are grouped into ''projects'' such as '''tdelibs''', '''tdebase''',… All applications are as components of project '''applications'''. Component names were chosen so that translators could reliably determine to which program and part the translation belong.
 
   
 
==Start with registration==
='''Using TDE Weblate'''=
 
   
 
To work on translations, you first need to register and log in into TWTW. All your work will be credited into TGW with your name as author.
=='''Start with registration'''==
 
   
 
To register, use the [https://mirror.git.trinitydesktop.org/weblate/accounts/register/ Register] button in the upper right corner of the TWTW page. After registration you will receive a confirmation email to activate your account. Confirm your activation, set your password and choose the language of the TWTW interface and the languages you want to contribute to in your profile settings.
To work properly with TDE Weblate you need to register and log in. This will allow you to work on translations, and your work will be pushed to the TGW with your name as author.
 
   
 
Although TWTW allows you to work as an unregistered user, it's not a good idea. In such case, you are only allowed to make suggestions for translations but someone else would have to actually make the changes. Chances are this would never be done since there are not enough translators for each language to review and approve the proposals. Making suggestions is not forbidden, but it is highly recommended to register and create your own translations.
To register, use the [https://mirror.git.trinitydesktop.org/weblate/accounts/register/ Register] button in the upper right corner of the TDE Weblate. After registration will be sent a confirmation email to activate your account. After confirming your account activation, you will set your password. In your profile settings, you can then choose the language of the TDE Weblate interface and the languages you want to contribute to their translations.
 
   
 
==Work on translations==
Although TDE Weblate allows to work as an unregistered user, it's not a good idea. In such a case, it is not possible to work on translations, but only to make suggestions. But we do not have enough translators for each language to review and approve the proposals. Suggestions are not forbidden, but we recommend not using it. Instead, it is good to consider registering.
 
   
 
In order to work on translations, you must first of all be logged in. Then select the component you want to translate and based on the results of the checks and the status of the translations, you can choose which strings you want to deal with and start working on translations.
=='''Work on translations'''==
 
 
In order to work on translations, you must first of all be logged in. Then you select the component you want to translate. Based on the results of the checks and the status of the translation, you can choose the strings you want to deal with and start working on translations.
 
   
 
===Component selection===
 
===Component selection===
Line 57: Line 57:
 
# If you just want to translate, but it's not important to you what component, you can use Suggested translations on the Dashboard.
 
# If you just want to translate, but it's not important to you what component, you can use Suggested translations on the Dashboard.
 
#* You get a list of ten components in your language so you can choose one.<br/><br/>[[File:TDE_Weblate_suggested.png|642px]]<br/>&nbsp;
 
#* You get a list of ten components in your language so you can choose one.<br/><br/>[[File:TDE_Weblate_suggested.png|642px]]<br/>&nbsp;
# If you want to translate a specific part – such as application TDEPowersave – you choose the project and the component in this project. In this example, the applications project and the tdepowersave component.
+
# If you want to translate a specific part – such as for example the TDEPowersave application – you have to choose the corresponding project and component. In this example, the project is ''applications'' and the compoment ''tdepowersave''.
#* If you use the ''Projects'' in the top bar, you get a component with a list of all the languages for which the component has already been translated.
+
#* If you use the ''Projects'' button in the top bar, you get a component with a list of all the languages for which the component has already been translated.
#* If you use the links below in Dashboard – like ''applications'', you get the component directly in your language.<br/><br/>[[File:TDE_Weblate_component_languages.png|642px]]<br/>&nbsp;
+
#* If you use the links below the ''Dashboard'' – like ''applications'' you get the component directly in your language.<br/><br/>[[File:TDE_Weblate_component_languages.png|642px]]<br/>&nbsp;
# If you want to translate the string that appeared on the screen but you do not know which components this string belongs to, you can use the search.
+
# If you want to translate a string that appeared on the screen but you do not know which components this string belongs to, you can use the search functionality.
#* In the Dashboard use Tools / Search, type the string you want to search for for example Closing applications, select your language if it is not already selected and click on Search.<br/><br/>[[File:TDE_Weblate_search_string.png|642px]]<br/>&nbsp;
+
#* In the Dashboard use ''Tools / Search'', type the string you want to search for (for example Closing applications), select your language if it is not already selected and click on the ''Search'' button.<br/><br/>[[File:TDE_Weblate_search_string.png|642px]]<br/>&nbsp;
#* In search results, you can then click either the component name or the specific occurrence of the string. If you use a component name, then you will be able to select the strings you want to translate. If you use a specific occurrence of a string, the editor will be opened directly for the specific occurrence of the string.<br/><br/>[[File:TDE_Weblate_search_results.png|642px]]<br/>&nbsp;
+
#* In the search result page, you can then click either the component name or the specific occurrence of the string. If you use a component name, then you will be able to select the strings you want to translate. If you use a specific occurrence of a string, the editor will be opened directly on that specific occurrence of the string.<br/><br/>[[File:TDE_Weblate_search_results.png|642px]]<br/>&nbsp;
  +
#* Please use search rarely – it is currently slow and very memory intensive.
 
  +
{{WarningBox
  +
|caption=Note
 
|text=Please try minimizing the use of the search functionality as much as possible – it is currently slow and very memory intensive.
  +
}}
   
 
===Strings selection===
 
===Strings selection===
   
TDE Weblate performs many useful checks to help improve the quality of translations. After selecting a component, you have the option to choose the strings that you want to deal with. Strings selection is based on test results.
+
TWTW performs many useful checks to help improving the quality of translations. After selecting a component, you have the option to choose the strings that you want to deal with. Strings selection is based on test results.
   
 
[[File:TDE_Weblate_component_strings.png|642px]]
 
[[File:TDE_Weblate_component_strings.png|642px]]
Line 73: Line 77:
 
After selecting the strings, the translating editor will be opened.
 
After selecting the strings, the translating editor will be opened.
   
  +
===Translating with full editor===
''TODO''
 
  +
  +
The full editor is used to gradually translate individual strings. The full editor interface provides a large amount of translated string information – translation checks results, links to string locations in the source code, nearby strings, other translations of the same string, comments, and possibly also screenshots.
  +
  +
[[File:TDE_Weblate_editor_full.png|642px]]
  +
  +
Once you edit the string, the flag that the string needs to be edited (the fuzzy flag) is automatically turned off. The keyboard icon provides information about using keyboard shortcuts that may be useful.
  +
  +
===Translating with zen editor===
  +
  +
The Zen editor can be invoked using the ''Zen'' button on the top right of the translation page. It is useful for translating all selected strings within a single long page. Therefore, additional information displayed about individual translations is limited compared to the full editor.
  +
  +
[[File:TDE_Weblate_editor_zen.png|642px]]
  +
  +
Changes in translation are saved automatically when you move to the next string. Once you edit the string, the flag that the string needs to be edited (the fuzzy flag) is automatically turned off. The Edit button can be used to switch back to the full editor.
  +
 
==Adding a new language==
  +
  +
After selecting a component, there may be a situation where the translation does not exist in your language. Because translation templates are part of the GIT repositories, TDE Weblate allows to create translations for new languages.
  +
  +
*'''To start a translation for a new language:'''
  +
# Select a project and a component from the ones available.
  +
# On the component page use Tools / Start new translation or the Start new translation button below the list of existing languages.
  +
# Select your language from the list and click the Start new translation button.<br/>A new translation will be created.<br/><br/>[[File:TDE_Weblate_translation_new.png|642px]]<br/>&nbsp;
  +
 
When a new translation is created, it automatically pushes a commit with translation for a new language into TGW. Similarly, translation can be removed from TWTW and again, a commit will be automatically pushed to remove the translation from TGW. However, please note that deleting translations requires administrative privileges.
  +
  +
==Checking tests results==
  +
  +
TWTW includes several tests to check translations. Of course, these tests will not solve grammar mistakes or detect inaccurate or incomplete translations; that has to be done by the translator himself. TWTW tests perform syntax checking. For example, whether the translation ends with a period as the original string, whether the translation contains tags for C formatting as they were in the original string, whether the html / xml tags in the translation text are correctly paired, and so on.
  +
  +
The result of the checks for individual translations are displayed during the translation in the full editor. The test results can also be used to select strings to translate. If you want to focus on correcting detected errors, there is a page that shows the result of the checks for all the components.
  +
  +
# Use Languages in the top bar to select your language
  +
# On the language page use Tools / Failing checks.<br/>Results of all failed checks for your language will be displayed.<br/><br/>[[File:TDE_Weblate_translation_checks.png|642px]]<br/>&nbsp;
  +
# Select a check whose results you want to address.
  +
# Select the project and the component whose translations you want to fix.<br/>An editor will be opened where you can fix the translation.
  +
  +
==Updating translators information==
   
  +
In many cases, "Your names" (context NAME OF TRANSLATORS)
=='''Adding a new language'''==
 
  +
and "Your emails" (context EMAIL OF TRANSLATORS)
  +
are the first two strings that ''require translation''.
   
  +
These strings have a special meaning: they are not intended to be translated literally,
Translation templates are contained in GIT repositories. This allows TDE Weblate to create translations for new languages. When a new translation is created, it automatically pushes a commit with translation for a new language into TGW. Similarly, translation from TDE Weblate can be removed. Again, commit will be automatically pushed to remove the translation from TGW.
 
  +
but are used to hold the names and emails of those people working on translation.
  +
All previously mentioned names and email addresses must be retained here.
  +
You should add your name and email address as the next entry in the list.
  +
These data are displayed in the About dialog box of the respective application.
   
  +
[[Category:Developers]]
''TODO''
 
  +
[[Category:Tutorials]]

Latest revision as of 16:01, 21 April 2022

Translating Trinity is a relatively easy process which nevertheless requires attention to details. If you want to contribute by translating TDE in your language then you will need to create an account in the translation workspace (called TWIW). The Trinity Project uses Weblate to manage translations. Below you will find a handy guide which walks you through from creating an account to contributing.

About Weblate

Weblate is an open source web-based translation management system that simplifies translation of strings in a project into multiple languages. It has a tight integration with version control tools used to manage the project source code and provides a simple and clean user interface, quality checks and automatic linking to source files.

TDE Weblate Translation Workspace (TWTW)

The TDE Weblate Translation Workspace (TWTW) is a self-hosted instance of Weblate designed to manage TDE translations. It is tightly integrated with TDE Gitea Workspace (TGW) and provides:

  • a simple and clean user interface for working on translations
  • integrated quality checks of translations
  • displaying of referenced source files in TGW
  • retrieving translations and templates from TGW
  • automatic updating of translations according to the templates
  • automated committing of translations back into TGW
  • proper crediting of translators in commit messages
  • consistent updating of strings from both stable and development branches

Thanks to TWTW users can simply focus on the translation work without having to worry about how to get the translation template files, how to update them and how to send their changes back to developers. Even users without any coding knowledge will be able to successfully contribute to improve translation strings and make TDE an even better environment.

TDE Weblate intro.png

Integration with TGW

TWTW manages its own copy of the source code repositories, but is very tightly integrated with TGW.

Commits into TGW automatically trigger the update of TWTW correspondent repositories. If some strings have changed and any translation template file has been updated, TWTW will automatically update the translation files for each language and immediately push them back to TGW. The translation files are therefore primarily maintained up to date by this mechanism.

User translation work consist in updating the changed strings into each of the modified translation files. When users work on translations, individual translated strings are not immediately pushed into TGW. In order for translators to have enough time to work and check their translations and to avoid having too many micro commits, changes are pushed into TGW after a delay of one day.

Strings from the development branch will be presented to the users for translation. Nevertheless TWTW also attempts to automatically update the same strings in the stable branch whenever possible. Strings already in the stable branch that are no longer in the development branch will be retained, therefore by continuously working on translating strings from the development branch should also result in the stable branch translations being up to date after an initial startup period. Please note that updates on the stable branch are pushed twice a week rather than daily.

Structure of translations

Each individual translation template file in TGW is represented in TWTW as a component. Components are grouped into projects (such as tdelibs, tdebase, applications ...) in order to ease navigation and workflow. Component names have been chosen so that translators can easily determine to which program and part they belong to.

Using TDE Weblate

Start with registration

To work on translations, you first need to register and log in into TWTW. All your work will be credited into TGW with your name as author.

To register, use the Register button in the upper right corner of the TWTW page. After registration you will receive a confirmation email to activate your account. Confirm your activation, set your password and choose the language of the TWTW interface and the languages you want to contribute to in your profile settings.

Although TWTW allows you to work as an unregistered user, it's not a good idea. In such case, you are only allowed to make suggestions for translations but someone else would have to actually make the changes. Chances are this would never be done since there are not enough translators for each language to review and approve the proposals. Making suggestions is not forbidden, but it is highly recommended to register and create your own translations.

Work on translations

In order to work on translations, you must first of all be logged in. Then select the component you want to translate and based on the results of the checks and the status of the translations, you can choose which strings you want to deal with and start working on translations.

Component selection

There are several ways to select a component to translate:

  1. If you just want to translate, but it's not important to you what component, you can use Suggested translations on the Dashboard.
    • You get a list of ten components in your language so you can choose one.

      TDE Weblate suggested.png
       
  2. If you want to translate a specific part – such as for example the TDEPowersave application – you have to choose the corresponding project and component. In this example, the project is applications and the compoment tdepowersave.
    • If you use the Projects button in the top bar, you get a component with a list of all the languages for which the component has already been translated.
    • If you use the links below the Dashboard – like applications – you get the component directly in your language.

      TDE Weblate component languages.png
       
  3. If you want to translate a string that appeared on the screen but you do not know which components this string belongs to, you can use the search functionality.
    • In the Dashboard use Tools / Search, type the string you want to search for (for example Closing applications), select your language if it is not already selected and click on the Search button.

      TDE Weblate search string.png
       
    • In the search result page, you can then click either the component name or the specific occurrence of the string. If you use a component name, then you will be able to select the strings you want to translate. If you use a specific occurrence of a string, the editor will be opened directly on that specific occurrence of the string.

      TDE Weblate search results.png
       
Messagebox warning.png
Note
Please try minimizing the use of the search functionality as much as possible – it is currently slow and very memory intensive.

Strings selection

TWTW performs many useful checks to help improving the quality of translations. After selecting a component, you have the option to choose the strings that you want to deal with. Strings selection is based on test results.

TDE Weblate component strings.png

After selecting the strings, the translating editor will be opened.

Translating with full editor

The full editor is used to gradually translate individual strings. The full editor interface provides a large amount of translated string information – translation checks results, links to string locations in the source code, nearby strings, other translations of the same string, comments, and possibly also screenshots.

TDE Weblate editor full.png

Once you edit the string, the flag that the string needs to be edited (the fuzzy flag) is automatically turned off. The keyboard icon provides information about using keyboard shortcuts that may be useful.

Translating with zen editor

The Zen editor can be invoked using the Zen button on the top right of the translation page. It is useful for translating all selected strings within a single long page. Therefore, additional information displayed about individual translations is limited compared to the full editor.

TDE Weblate editor zen.png

Changes in translation are saved automatically when you move to the next string. Once you edit the string, the flag that the string needs to be edited (the fuzzy flag) is automatically turned off. The Edit button can be used to switch back to the full editor.

Adding a new language

After selecting a component, there may be a situation where the translation does not exist in your language. Because translation templates are part of the GIT repositories, TDE Weblate allows to create translations for new languages.

  • To start a translation for a new language:
  1. Select a project and a component from the ones available.
  2. On the component page use Tools / Start new translation or the Start new translation button below the list of existing languages.
  3. Select your language from the list and click the Start new translation button.
    A new translation will be created.

    TDE Weblate translation new.png
     

When a new translation is created, it automatically pushes a commit with translation for a new language into TGW. Similarly, translation can be removed from TWTW and again, a commit will be automatically pushed to remove the translation from TGW. However, please note that deleting translations requires administrative privileges.

Checking tests results

TWTW includes several tests to check translations. Of course, these tests will not solve grammar mistakes or detect inaccurate or incomplete translations; that has to be done by the translator himself. TWTW tests perform syntax checking. For example, whether the translation ends with a period as the original string, whether the translation contains tags for C formatting as they were in the original string, whether the html / xml tags in the translation text are correctly paired, and so on.

The result of the checks for individual translations are displayed during the translation in the full editor. The test results can also be used to select strings to translate. If you want to focus on correcting detected errors, there is a page that shows the result of the checks for all the components.

  1. Use Languages in the top bar to select your language
  2. On the language page use Tools / Failing checks.
    Results of all failed checks for your language will be displayed.

    TDE Weblate translation checks.png
     
  3. Select a check whose results you want to address.
  4. Select the project and the component whose translations you want to fix.
    An editor will be opened where you can fix the translation.

Updating translators information

In many cases, "Your names" (context NAME OF TRANSLATORS) and "Your emails" (context EMAIL OF TRANSLATORS) are the first two strings that require translation.

These strings have a special meaning: they are not intended to be translated literally, but are used to hold the names and emails of those people working on translation. All previously mentioned names and email addresses must be retained here. You should add your name and email address as the next entry in the list. These data are displayed in the About dialog box of the respective application.