Translation Introduction

From ReactOS Wiki
Jump to: navigation, search

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 [[Mattermost|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