summaryrefslogtreecommitdiffstats
blob: 178f1e250b19a925654de818696b3997187421f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Translating Swift
-----------------
Below, you will find instructions on how to translate Swift. A prerequisite is to
have Qt (with Qt Linguist installed).


Starting a new translation
--------------------------
- Run the following command to generate a clean translation template 'swift.ts':
    scons update_translations=1 Swift/Translations/swift.ts
- Rename the new 'swift.ts' file to swift_<LANGUAGE-CODE>.ts, e.g. "swift_nl.ts"
  for Dutch
- Open the file in Qt Linguist, and translate the phrases. 
  For more information, see http://doc.qt.nokia.com/latest/linguist-manual.html
- Translate the Swift/resources/swift.desktop entry.
- Submit your finished translation file to the Swift development team.

If you have trouble generating the translation file yourself, you can ask the 
Swift development team to provide you with a new translation template for your 
language.


Updating an existing translation
--------------------------------
- Run the following command to update an existing translation template:
    scons update_translations=1 Swift/Translations/<your-translation-file>

If you have trouble updating the translation file yourself, you can ask the 
Swift development team to provide you with a new translation template for your 
language.


Testing your translation
------------------------
You can choose to manually test your translation (doesn't require a
development environment for Swift), or automatically:
- Manually:
  - In Linguist, select "File->Release". This will create a file called
    <YOURLANGUAGE>.qm.
  - Put <YOURLANGUAGE>.qm in the translations dir
      - On Windows, in the 'translations/' subdir of the installed package
      - On Mac OS X, use "Show Package Contents" on Swift.app, and put the
        translation file in Contents/Resources/translations
      - On Linux, in /usr/share/swift/translations
- Automatically:
  - Ensure your translation file is in Swift/Translations/swift_<YOURLANGUAGE>.ts
  - Build Swift (for more details, see the building documentation):
      scons Swift
    This will build translation modules (.qm) for your translation sources, and 
    put them in the right place.

Finally, run Swift. If your system isn't set up to use your language, set the 
LANG environment variable to the name of your language before running Swift.
For example:
  set LANG=nl (on Windows)
  export LANG=nl (on Linux or Mac OS X, in Bash)