Difference between revisions of "Translation Introduction"

From ReactOS Wiki
Jump to: navigation, search
m (Spelling)
m (See Also)
 
(119 intermediate revisions by 38 users not shown)
Line 1: Line 1:
This wiki article is not complete yet
+
The ReactOS team welcomes anyone who wishes to contribute by translating. This article is written to help you to get started.
  
 +
If you need more help with things, that are not covered by the article, feel free to ask in the ReactOS forum ([http://reactos.org/forum General Discussion section of ReactOS Forum]) or in the [https://chat.reactos.org/ ReactOS Chat]. You may also send your questions to the translation mailing list ([http://reactos.org/mailman/listinfo/ros-translate ros-translate]) or the development list ([http://reactos.org/mailman/listinfo/ros-dev ros-dev]).
  
 +
== First steps ==
  
=Introduction=
+
You should check if there are any other translators working on your language by checking the [[List of Translators]] page, you can also try to contact them in [https://chat.reactos.org/ the chat].
 +
If there are other translators listed, you should contact them and tell them you are interested in translating. You could also ask them about the actual translation status.
  
Translating software into the native language of different people is a very important thing to make the software usable to bigger audience.
+
If your language is not listed, feel free to write the language up in the list on the [[List of Translators]] page and put down your name there.
  
The ReactOS team welcomes anyone who wish to contribute by translating. This article is written to help you to get started.
+
=== Wine translations ===
  
 +
The files coming from Wine ([https://github.com/reactos/reactos/blob/master/media/doc/WINESYNC.txt?view=markup list]) should be translated in Wine to have them imported later.
  
The first thing you should check is if there are any other translators working on your language. You can see a list of languages and translators on the [[Translations]] page.
+
Please refer to [http://wiki.winehq.org/SubmittingPatches WineHQ Patch submission guidelines].
  
If there are other translators listed, you should contact them and tell them you are interested in translating. You could also ask them about the actual translation's status.
+
=== Translate ReactOS ===
  
If your language isn't listed, feel free to write the langeuage up in the list on the [[Translations]] page.
+
==== Where to download the files ====
  
Write your name down under the language together with your email
+
The latest files are available in our [https://github.com/reactos/reactos GitHub] repository. Make sure you get the files from the master branch and not from any release since they might be outdated.
  
 
+
==== How to translate the files ====
 
 
=How to translate=
 
 
 
Translating ReactOS is done by editing different resource files (.rc).
 
 
 
 
 
==Where to download the files==
 
 
 
The latest files are available in SVN. Make sure you get the files from there and not from any release since they might be outdated.
 
You can browse and download single files from SVN through this page: http://svn.reactos.com/viewcvs/trunk/reactos/
 
 
 
Most of the rc-files are in different folders in lib and subsys/system.
 
 
 
 
 
==How to translate the files==
 
  
 
Below is an example rc-file from ReactOS Access Control List Editor (aclui).
 
Below is an example rc-file from ReactOS Access Control List Editor (aclui).
  
(Note that in a few lines some unimportant things, from a translation point of view, have been cut out fit the formatting of this page)
+
(Note that in a few lines some unimportant things, from a translation point of view, have been cut out to fit the formatting of this page)
  
<pre><nowiki>#include <reactos/resource.h>
+
<syntaxhighlight lang="c">
 +
#include <reactos/resource.h>
 
#include <defines.h>
 
#include <defines.h>
 
#include "resource.h"
 
#include "resource.h"
  
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
+
LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
  
 
IDD_SECPAGE DIALOGEX 0, 0, 227, 215
 
IDD_SECPAGE DIALOGEX 0, 0, 227, 215
Line 59: Line 49:
  
 
STRINGTABLE DISCARDABLE
 
STRINGTABLE DISCARDABLE
{
+
BEGIN
 
   IDS_PSP_TITLE "Permissions for %1"
 
   IDS_PSP_TITLE "Permissions for %1"
}
+
END
 +
</syntaxhighlight>
  
</nowiki></pre>
+
The first thing to do is to make a copy of the English rc-file, usually called en-US.rc, and rename it in your language code. If you do not know the code for your language, take a look at the 2-letter codes at the bottom of [http://www.w3.org/WAI/ER/IG/ert/iso639.htm ISO-639] (you can also find the list of locale names on [http://msdn.microsoft.com/zh-TW/library/dd318693(v=VS.85).aspx this MSDN page]). Please note that a few files may differ from this list, for example, files originally from Wine. So make sure that a translation of your language does not exist before you start to translate it yourself.
  
The first thing to do is to make a copy of the english rc-file, usually called En.rc, and name it after your language. If you do not know the code for your language, take a look at the 2-letter codes in the bottom of [http://www.w3.org/WAI/ER/IG/ert/iso639.htm ISO-639]. Please note that a few files may differ from this list, for example files originally from Wine. So make sure that a translation of your language does not exist before you start to translate it yourself.
+
When you have copied the file it is just to begin the actual translation:
 +
* First change ''LANG_ENGLISH'' into your language (Example: ''LANG_SWEDISH''). Depending on your language and location, you might also have to change the [[Sublang]] from ''SUBLANG_NEUTRAL'' or ''SUBLANG_DEFAULT''.
  
 +
* The words to translate are between quotation marks. However, there are some exceptions but often it is pretty easy to see. For example, you should not translate "MS Shell Dlg" (which is a font, as you can see at the beginning of the line) or "SysListView32".
  
When you have copied the file it's just to begin the actual translation.
+
* As most translation resources are now encoded in UTF-8, please save your .rc files as "'''UTF-8'''".
* First change - LANG_ENGLISH
 
A good thing to start with is to change LANG_ENGLISH into your language. Depending on your language and location, you might also have to change SUBLANG_DEFAULT. A list with choices are available here: <b>link coming soon</b>
 
  
* The &-letter
+
* Leave an end of file line (a blank line) at the end of your rc file for ease of building.
Note the &-letter which is inside some words above. It defines a hotkey, the letter which comes after the &-letter becomes a hotkey.
 
  
A hotkey is a key you can use to fast access different menu's etc. The hotkey is shown with an underline.
+
===== Resizing =====
  
* %
+
If some of the fields, labels, etc. are too small for your language, you may resize them.
The %-sign is followed by another character like the %1 you see in the rc-file above. This should not be changed as it is usually a text string or a value being printed.
 
  
* \n
+
For example, in:
This is a linebreak.
 
  
 +
<syntaxhighlight lang="c">
 +
PUSHBUTTON "&Some text", IDC_ACELIST_REMOVE, 170, 87, 50, 14
 +
</syntaxhighlight>
  
Now the translation is pretty straight-forward. The words to translate are between quotation marks. However, you should not translate all words in quotation marks, there are some exceptions. But often it's pretty easy to see in the file what to translate and what to not translate. For example you should not translate "MS Shell Dlg" (which is a font, as you can see in the beginning of the line) or "SysListView32".
+
The numbers 170, 87, 50, 14 stand for ''LEFT'', ''TOP'', ''WIDTH'', ''HEIGHT''. So, changing 50 to 60 will result in a longer pushbutton.
  
 +
In case you are not updating old translations, you will have to edit some more files.
 +
In each application, DLL, etc. folder, there should be a file named either ''rsrc.rc'' or ''<applicationname>.rc''. You shall open it and add the path to your language file in it.
  
==Submit your translation==
+
=== Common Characters ===
  
One way to submit your translation could be to speak with an operator on the ReactOS IRC channel.
+
{| class="wikitable"
 +
! Char
 +
! Comment
 +
|-
 +
| &  || The ampersand, which is inside some words above. It defines a hotkey; the letter which comes after the ampersand becomes a hotkey.
  
 +
A hotkey is a key you can use to fast access different menus etc. The hotkey is shown with an underline.
 +
|-
 +
| %  || The percent sign is followed by another character, like the <tt>%1</tt> you see in the <tt>.rc</tt> file above. This should not be changed as it is usually a text string or a value being printed.
 +
|-
 +
| \n || This is a line break.
 +
|-
 +
| /* text */ || This is commented text. You may consider leaving the source language text in order to facilitate future work.
 +
|}
  
==Additional help==
+
=== Submit your translation ===
 +
1. Create a GitHub account (if you don’t have one).<br/>
 +
Git command line is a must to understand the basics of Git. TortoiseGit is also a very nice option for total beginners.<br/>
 +
More information about git can be found here: https://reactos.org/wiki/ReactOS_Git_For_Dummies<br/><br/>
 +
2. Fork ReactOS on github<br/>
 +
You should have correctly configured git with your real name and ReactOS repo as remote.<br/><br/>
 +
3. Create a branch in your fork where you commit your changes<br/>
 +
How to update your fork’s code to the latest reactos:master:<br/>
 +
In your git command-line session:
 +
  git remote -v
 +
This command allows you to view the list of remote repositories available for syncs.<br/>
 +
Typically you will find:
 +
  "origin https://github.com/<your_nickname>/reactos.git"
 +
and for example:
 +
  "upstream https://github.com/reactos/reactos.git"
 +
which means, you will refer to the original reactos:master via the name "upstream" (if nothing of the sort exists in the returned list, please read https://help.github.com/articles/config ... or-a-fork/ ).<br/>
 +
Now, when you are in some branch of your fork, run the following commands:
 +
  git fetch upstream
 +
  git rebase upstream/master
 +
The first command downloads all the new information, and the second one updates your branch with the commits that exist in the upstream/master branch, and then add backs on top of your own commits. Then, you need to update your remote fork by doing:
 +
  git push --force-with-lease
 +
Alternatively, you can try the solution explained at https://help.github.com/articles/syncing-a-fork/ , but that one doesn't keep a linear history.<br/><br/>
 +
4. Create a pull request <br/>
 +
Note, "pull request" is NOT the same as "git pull".  Pull Request is requesting the repository maintainers to do "git pull" from your branch or fork.<br/><br/>
 +
Please follow [[Commiting Changes]] guide.
  
If you need more help, feel free to send your question to the translation mailing list ([http://reactos.com:8080/mailman/listinfo/ros-translate ros-translate]). You can also speak with an operator in the ReactOS IRC channel.
+
Here is an example of a good commit message for the translation:
  
 +
  [EXPLORER] Improve german translation
  
=Terminology=
+
'''''Important:''''' If you are the first translator of a language (you created the language file), please follow these extra steps:
 +
* After you have finished translating the file, go outside of the "lang" folder (directory) and find another ".rc" file. Usually, this file has the same name as the folder you are currently in AND is the only "'''.rc'''" file in that folder. For example: if you are translating the files in the '''reactos/base/applications/charmap/lang''', then the file you need to look for is "charmap.rc" in '''base/applications/charmap'''. Open the file click, "Edit", find the line with:
  
You don't have to translate everything exactly the same as Windows. If you believe you can translate something better than Windows, go on! However you are encouraged to keep common terms, like for example the menus in the windows.
+
#pragma code_page(65001)
  
Also, Try to keep your translation consistent, ie try to not translate the same term differently in different places.
+
* Paste these lines (remember to follow alphabetical order): 
  
 +
#ifdef LANGUAGE_LANGUAGECODE_LANGUAGECODE
 +
    #include "lang/translationcodehere.rc"
 +
#endif
  
=Guidelines / Tips=
+
* Replace "LANGUAGECODE", "translationcodehere" accordingly. Example, if the translation language is Vietnamese, the above lines would be the following:
  
There are no enforced guidelines, but some things that are recommended.
+
#ifdef LANGUAGE_VI_VN
 +
    #include "lang/vi-VN.rc"
 +
#endif
  
 +
* Make sure that the two files (this file and your translation files) are in the same pull request to avoid the situation where only one file is merged into the main branch.
  
* Proofreading
+
== Terminology ==
By having another member of your translation team proofreading all your translations and giving his/her suggestions, the translation will keep a higher quality.
+
You don't have to translate everything exactly the same as Windows. If you believe you can translate something better than Windows, go on! However, you are encouraged to keep common terms, like for example the menus in the windows.
This idea started in the Swedish translation team, and this how we in that team handle it:
 
  
1. Someone translate a file and in our case uploads it to our ftp-server.
+
Also, try to keep your translation consistent, i.e. try to not translate the same term differently in different places.
  
2. Another member of the team proofreads the file and give his/hers comments.
+
== Recommendations ==
 
+
* Proofreading
3. The original author makes changes accordingly to the comments if he/she agrees with them.
+
:By having another member of your translation team proofreading all your translations and giving his/her suggestions, the translation will keep a higher quality.
 
+
:This idea started in the Swedish translation team, and this is how we in that team handle it:
4. If there is anything the two members don't agree on, we have a vote by all members.
+
:# Someone translates a file and in our case uploads it to our ftp-server.
 
+
:# Another member of the team proofreads the file and give his/her comments.
Of course you don't need to follow these steps but some kind of proofreading is highly recommended.
+
:# The original author makes changes accordingly to the comments if he/she agrees with them.
 +
:# If there is anything the two members don't agree on, we have a vote by all members.
  
 +
:Of course, you don't need to follow these steps but some kind of proofreading is highly recommended.
  
 
* A place to meet and chat
 
* A place to meet and chat
Having a place to meet and chat makes the translation a lot easier. A tip is to set up an IRC channel on the freenode network and meet there.
+
:Having a place to meet and chat makes the translation a lot easier. A tip is to use [https://chat.reactos.org/ ReactOS Chat] and meet there — in the chat you can click "More..." at the left panel to reveal additional language-specific channels.
 
 
  
=FAQ=
+
* Get in contact with [[List of Translators|other translators]] by E-mail, chat or language-specific forums.
  
In this section I've decided to add questions and answers which were asked on irc and/or the ros-translate mailing list.
+
== See Also ==
 +
[https://geob99.github.io/pages/usetup-translate.html Tutorial to translate the 1st stage setup component, for beginners]
  
*<b>Q</b>: Which files will be translated by the WINE project?
+
== Other Languages ==
*<b>A</b>: The Wine translations are already available in the ReactOS source tree. If you would translate/update a file which is also in Wine, the commiter will also send the update to Wine.
+
* [[Introdução para contribuir traduzindo|Portuguese]]
 +
* [[Introducción a la traducción|Spanish]]
 +
[[Category:Tutorial]]

Latest revision as of 19:21, 17 February 2021

The ReactOS team welcomes anyone who wishes to contribute by translating. This article is written to help you to get started.

If you need more help with things, that are not covered by the article, feel free to ask in the ReactOS forum (General Discussion section of ReactOS Forum) or in the ReactOS Chat. You may also send your questions to the translation mailing list (ros-translate) or the development list (ros-dev).

First steps

You should check if there are any other translators working on your language by checking the List of Translators page, you can also try to contact them in the chat. If there are other translators listed, you should contact them and tell them you are interested in translating. You could also ask them about the actual translation status.

If your language is not listed, feel free to write the language up in the list on the List of Translators page and put down your name there.

Wine translations

The files coming from Wine (list) should be translated in Wine to have them imported later.

Please refer to WineHQ Patch submission guidelines.

Translate ReactOS

Where to download the files

The latest files are available in our GitHub repository. Make sure you get the files from the master branch and not from any release since they might be outdated.

How to translate the files

Below is an example rc-file from ReactOS Access Control List Editor (aclui).

(Note that in a few lines some unimportant things, from a translation point of view, have been cut out to fit the formatting of this page)

#include <reactos/resource.h>
#include <defines.h>
#include "resource.h"

LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL

IDD_SECPAGE DIALOGEX 0, 0, 227, 215
STYLE WS_CHILD | WS_VISIBLE | WS_CAPTION
CAPTION "Security"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
  LTEXT "&Group or user names:", -1, 7, 7, 105, 8
  CONTROL "", IDC_ACELIST, "SysListView32", LVS_REPORT
  PUSHBUTTON "A&dd...", IDC_ACELIST_ADD, 116, 87, 50, 14
  PUSHBUTTON "&Remove", IDC_ACELIST_REMOVE, 170, 87, 50, 14
  LTEXT "Allow", -1, 135, 107, 32, 8, SS_CENTER
  LTEXT "Deny", -1, 176, 107, 32, 8, SS_CENTER
END

STRINGTABLE DISCARDABLE
BEGIN
  IDS_PSP_TITLE "Permissions for %1"
END

The first thing to do is to make a copy of the English rc-file, usually called en-US.rc, and rename it in your language code. If you do not know the code for your language, take a look at the 2-letter codes at the bottom of ISO-639 (you can also find the list of locale names on this MSDN page). Please note that a few files may differ from this list, for example, files originally from Wine. So make sure that a translation of your language does not exist before you start to translate it yourself.

When you have copied the file it is just to begin the actual translation:

  • First change LANG_ENGLISH into your language (Example: LANG_SWEDISH). Depending on your language and location, you might also have to change the Sublang from SUBLANG_NEUTRAL or SUBLANG_DEFAULT.
  • The words to translate are between quotation marks. However, there are some exceptions but often it is pretty easy to see. For example, you should not translate "MS Shell Dlg" (which is a font, as you can see at the beginning of the line) or "SysListView32".
  • As most translation resources are now encoded in UTF-8, please save your .rc files as "UTF-8".
  • Leave an end of file line (a blank line) at the end of your rc file for ease of building.
Resizing

If some of the fields, labels, etc. are too small for your language, you may resize them.

For example, in:

 PUSHBUTTON "&Some text", IDC_ACELIST_REMOVE, 170, 87, 50, 14

The numbers 170, 87, 50, 14 stand for LEFT, TOP, WIDTH, HEIGHT. So, changing 50 to 60 will result in a longer pushbutton.

In case you are not updating old translations, you will have to edit some more files. In each application, DLL, etc. folder, there should be a file named either rsrc.rc or <applicationname>.rc. You shall open it and add the path to your language file in it.

Common Characters

Char Comment
& The ampersand, which is inside some words above. It defines a hotkey; the letter which comes after the ampersand becomes a hotkey.

A hotkey is a key you can use to fast access different menus etc. The hotkey is shown with an underline.

% The percent sign is followed by another character, like the %1 you see in the .rc file above. This should not be changed as it is usually a text string or a value being printed.
\n This is a line break.
/* text */ This is commented text. You may consider leaving the source language text in order to facilitate future work.

Submit your translation

1. Create a GitHub account (if you don’t have one).
Git command line is a must to understand the basics of Git. TortoiseGit is also a very nice option for total beginners.
More information about git can be found here: https://reactos.org/wiki/ReactOS_Git_For_Dummies

2. Fork ReactOS on github
You should have correctly configured git with your real name and ReactOS repo as remote.

3. Create a branch in your fork where you commit your changes
How to update your fork’s code to the latest reactos:master:
In your git command-line session:

  git remote -v

This command allows you to view the list of remote repositories available for syncs.
Typically you will find:

  "origin https://github.com/<your_nickname>/reactos.git"

and for example:

  "upstream https://github.com/reactos/reactos.git"

which means, you will refer to the original reactos:master via the name "upstream" (if nothing of the sort exists in the returned list, please read https://help.github.com/articles/config ... or-a-fork/ ).
Now, when you are in some branch of your fork, run the following commands:

  git fetch upstream
  git rebase upstream/master

The first command downloads all the new information, and the second one updates your branch with the commits that exist in the upstream/master branch, and then add backs on top of your own commits. Then, you need to update your remote fork by doing:

  git push --force-with-lease

Alternatively, you can try the solution explained at https://help.github.com/articles/syncing-a-fork/ , but that one doesn't keep a linear history.

4. Create a pull request
Note, "pull request" is NOT the same as "git pull". Pull Request is requesting the repository maintainers to do "git pull" from your branch or fork.

Please follow Commiting Changes guide.

Here is an example of a good commit message for the translation:

 [EXPLORER] Improve german translation

Important: If you are the first translator of a language (you created the language file), please follow these extra steps:

  • After you have finished translating the file, go outside of the "lang" folder (directory) and find another ".rc" file. Usually, this file has the same name as the folder you are currently in AND is the only ".rc" file in that folder. For example: if you are translating the files in the reactos/base/applications/charmap/lang, then the file you need to look for is "charmap.rc" in base/applications/charmap. Open the file click, "Edit", find the line with:
#pragma code_page(65001)
  • Paste these lines (remember to follow alphabetical order):
#ifdef LANGUAGE_LANGUAGECODE_LANGUAGECODE
    #include "lang/translationcodehere.rc"
#endif
  • Replace "LANGUAGECODE", "translationcodehere" accordingly. Example, if the translation language is Vietnamese, the above lines would be the following:
#ifdef LANGUAGE_VI_VN
    #include "lang/vi-VN.rc"
#endif
  • Make sure that the two files (this file and your translation files) are in the same pull request to avoid the situation where only one file is merged into the main branch.

Terminology

You don't have to translate everything exactly the same as Windows. If you believe you can translate something better than Windows, go on! However, you are encouraged to keep common terms, like for example the menus in the windows.

Also, try to keep your translation consistent, i.e. try to not translate the same term differently in different places.

Recommendations

  • Proofreading
By having another member of your translation team proofreading all your translations and giving his/her suggestions, the translation will keep a higher quality.
This idea started in the Swedish translation team, and this is how we in that team handle it:
  1. Someone translates a file and in our case uploads it to our ftp-server.
  2. Another member of the team proofreads the file and give his/her comments.
  3. The original author makes changes accordingly to the comments if he/she agrees with them.
  4. If there is anything the two members don't agree on, we have a vote by all members.
Of course, you don't need to follow these steps but some kind of proofreading is highly recommended.
  • A place to meet and chat
Having a place to meet and chat makes the translation a lot easier. A tip is to use ReactOS Chat and meet there — in the chat you can click "More..." at the left panel to reveal additional language-specific channels.

See Also

Tutorial to translate the 1st stage setup component, for beginners

Other Languages