Version at: 16/03/2014, 21:54 vs. version at: 16/03/2014, 22:41
11#Checking in Extracted UI Strings and Their Translations
22
3These instructions describe how to extract UI strings, upload strings and translations, and finally commit them to a repository.
3These instructions describe how to extract UI strings, upload strings and translations, and finally commit them to a repository. Before executing these steps, follow the instructions in [Installing and Configuring Bazaar](install-bazaar).
44
55##Markup for internationalized strings in the code
66
77In the code, whenever developers write strings that will have to be translated, they use a special function whose name consists of a double underscore. A script (CakePHP's "i18n extract" script) can later be run to scan the code and extract the strings that are passed to this function.
88
99Examples, with the equivalent actions:
1010
1111* __(‘some text’) => echo ‘some text’;
1212* __(‘some text’, true) => return ‘some text’;
1313
1414The language used in the code will be English.
1515
1616##Running cake i18n
1717
1818* Open a console on a Linux machine or Linux virtual machine.
1919* Type : /var/http/tatoeba/cake/console/cake i18n
2020* Choose : E (Extract POT file from source)
2121* When asked if you want to merge all translations into a single file, say yes
2222* Type in the path to app: /home/tatoeba/tatoeba-www/app
2323* Type in the path to locale: /home/tatoeba/tatoeba-www/app/locale
2424* Choose a name for the file that will be generated (in this example, default.pot): default.pot
2525* Choose: Q (quit)
2626
2727##Modifying the header
2828
2929Before you upload the POT file, you may need to open it and change the header into this:
3030
3131msgid ""
3232
3333msgstr ""
3434
3535"Project-Id-Version: \n"
3636
3737"POT-Creation-Date: \n"
3838
3939"PO-Revision-Date: \n"
4040
4141"Last-Translator: \n"
4242
4343"Language-Team: \n"
4444
4545"MIME-Version: 1.0\n"
4646
4747"Content-Type: text/plain; charset=utf-8\n"
4848
4949"Content-Transfer-Encoding: 8bit\n"
5050
5151Otherwise, Launchpad may reject the file.
5252
5353##Uploading default.pot
5454
5555###Uploading default.pot to Launchpad via Bazaar
5656
57It is far better to upload files to Launchpad via Bazaar than via the import queue on the Launchpad site. See [Installing and Configuring Bazaar](install-bazaar).
57* Commit the file using the Bazaar Explorer GUI.
5858
59First commit the file using the Bazaar Explorer GUI. Then when it comes time to push your changes, go to a Windows command prompt, issue a launchpad-login command, and issue a push command. For user abc, the commands would be as follows:
59When it comes time to push your changes, go to a Windows command prompt, issue a launchpad-login command, and issue a push command. For user abc, the commands would be as follows:
6060
6161 cd bzr\trunk\trunk\default
6262 bzr launchpad-login abc
6363 bzr push lp:tatoeba
6464
65###Uploading default.pot to Launchpad via import queue (deprecated)
66
67Go to this URL:
68
69https://translations.launchpad.net/tatoeba/trunk/+translations-upload
70
71Set the following:
72* file type: template
73* path: default.pot
74* template: default
75
76You can leave name and translation domain empty.
77
78Upload the file.
79
80You may need to wait a day or so for the translation files to be updated.
81
8265##Editing .po files
8366
8467You may need to edit the .po files manually at this stage if you want to restore translations for UI strings that have changed. A merge tool such as WinMerge or KDiff3 may be useful here. Skip this step if you don't know what is entailed.
8568
8669##Check .po files
8770
8871Use this command on each .po file to ensure that it has the correct syntax:
8972
9073msgfmt -c filename.po
9174
9275The Launchpad site executes this step after the .po files are uploaded and approved, but checking the files first will save you more work in the long run.
9376
9477##Upload .po files
9578
9679Put all the .po files that have changed into a "tarball", which is a file with the extension .tar.gz or .tar.bz2 . You can use a zipfile utility such as [7Zip](http://www.7-zip.org/) command on Windows or *tar* on Linux to produce the tarball. Then upload them at the same URL that you used to upload the default.pot file.
9780
9881##Run update-translations.sh
9982
10083If you do not already have bzr installed on your Linux virtual machine, install it with this command: "apt-get install bzr" . You may need to issue a "su -" (superuser) command to perform the installation.
10184
10285Run this script:
10386
10487tatoeba-www/docs/update-translations.sh
10588
10689It will do the following:
10790
10891* check out the files from the Launchpad repository (using Bazaar)
10992* place them in a temporary directory
11093* check them into the final Tatoeba2 repository
11194
11295##Historical information only
11396
11497The original source of these instructions, stored on Assembla, is here: [1]
11598
11699 [1]: https://www.assembla.com/spaces/tatoeba2/wiki/Internationalization
117100
118101
102###Uploading default.pot to Launchpad via import queue (deprecated)
103
104Go to this URL:
105
106https://translations.launchpad.net/tatoeba/trunk/+translations-upload
107
108Set the following:
109* file type: template
110* path: default.pot
111* template: default
112
113You can leave name and translation domain empty.
114
115Upload the file.
116
117You may need to wait a day or so for the translation files to be updated.
118
diff view generated by jsdifflib

Version at: 16/03/2014, 21:54

#Checking in Extracted UI Strings and Their Translations

These instructions describe how to extract UI strings, upload strings and translations, and finally commit them to a repository. 

##Markup for internationalized strings in the code

In the code, whenever developers write strings that will have to be translated, they use a special function whose name consists of a double underscore. A script (CakePHP's "i18n extract" script) can later be run to scan the code and extract the strings that are passed to this function.

Examples, with the equivalent actions:

* __(‘some text’) => echo ‘some text’;
* __(‘some text’, true) => return ‘some text’;

The language used in the code will be English.

##Running cake i18n

* Open a console on a Linux machine or Linux virtual machine.
* Type : /var/http/tatoeba/cake/console/cake i18n
* Choose : E (Extract POT file from source)
* When asked if you want to merge all translations into a single file, say yes
* Type in the path to app: /home/tatoeba/tatoeba-www/app
* Type in the path to locale: /home/tatoeba/tatoeba-www/app/locale
* Choose a name for the file that will be generated (in this example, default.pot): default.pot
* Choose: Q (quit)

##Modifying the header

Before you upload the POT file, you may need to open it and change the header into this:
 
msgid ""

msgstr ""

"Project-Id-Version: \n"

"POT-Creation-Date: \n"

"PO-Revision-Date: \n"

"Last-Translator: \n"

"Language-Team: \n"

"MIME-Version: 1.0\n"

"Content-Type: text/plain; charset=utf-8\n"

"Content-Transfer-Encoding: 8bit\n"

Otherwise, Launchpad may reject the file.

##Uploading default.pot

###Uploading default.pot to Launchpad via Bazaar 

It is far better to upload files to Launchpad via Bazaar than via the import queue on the Launchpad site. See [Installing and Configuring Bazaar](install-bazaar).

First commit the file using the Bazaar Explorer GUI. Then when it comes time to push your changes, go to a Windows command prompt, issue a launchpad-login command, and issue a push command. For user abc, the commands would be as follows:

    cd bzr\trunk\trunk\default
    bzr launchpad-login abc
    bzr push lp:tatoeba
    
###Uploading default.pot to Launchpad via import queue (deprecated)

Go to this URL:
 
https://translations.launchpad.net/tatoeba/trunk/+translations-upload

Set the following:
* file type: template
* path: default.pot
* template: default

You can leave name and translation domain empty.

Upload the file. 

You may need to wait a day or so for the translation files to be updated.

##Editing .po files

You may need to edit the .po files manually at this stage if you want to restore translations for UI strings that have changed. A merge tool such as WinMerge or KDiff3 may be useful here. Skip this step if you don't know what is entailed.

##Check .po files

Use this command on each .po file to ensure that it has the correct syntax:

msgfmt -c filename.po

The Launchpad site executes this step after the .po files are uploaded and approved, but checking the files first will save you more work in the long run.

##Upload .po files

Put all the .po files that have changed into a "tarball", which is a file with the extension .tar.gz or .tar.bz2 . You can use a zipfile utility such as [7Zip](http://www.7-zip.org/) command on Windows or *tar* on Linux to produce the tarball. Then upload them at the same URL that you used to upload the default.pot file. 

##Run update-translations.sh

If you do not already have bzr installed on your Linux virtual machine, install it with this command: "apt-get install bzr" . You may need to issue a "su -" (superuser) command to perform the installation.
 
Run this script:

tatoeba-www/docs/update-translations.sh

It will do the following:

* check out the files from the Launchpad repository (using Bazaar)
* place them in a temporary directory
* check them into the final Tatoeba2 repository

##Historical information only

The original source of these instructions, stored on Assembla, is here: [1]

  [1]: https://www.assembla.com/spaces/tatoeba2/wiki/Internationalization

version at: 16/03/2014, 22:41

#Checking in Extracted UI Strings and Their Translations

These instructions describe how to extract UI strings, upload strings and translations, and finally commit them to a repository. Before executing these steps, follow the instructions in [Installing and Configuring Bazaar](install-bazaar).

##Markup for internationalized strings in the code

In the code, whenever developers write strings that will have to be translated, they use a special function whose name consists of a double underscore. A script (CakePHP's "i18n extract" script) can later be run to scan the code and extract the strings that are passed to this function.

Examples, with the equivalent actions:

* __(‘some text’) => echo ‘some text’;
* __(‘some text’, true) => return ‘some text’;

The language used in the code will be English.

##Running cake i18n

* Open a console on a Linux machine or Linux virtual machine.
* Type : /var/http/tatoeba/cake/console/cake i18n
* Choose : E (Extract POT file from source)
* When asked if you want to merge all translations into a single file, say yes
* Type in the path to app: /home/tatoeba/tatoeba-www/app
* Type in the path to locale: /home/tatoeba/tatoeba-www/app/locale
* Choose a name for the file that will be generated (in this example, default.pot): default.pot
* Choose: Q (quit)

##Modifying the header

Before you upload the POT file, you may need to open it and change the header into this:
 
msgid ""

msgstr ""

"Project-Id-Version: \n"

"POT-Creation-Date: \n"

"PO-Revision-Date: \n"

"Last-Translator: \n"

"Language-Team: \n"

"MIME-Version: 1.0\n"

"Content-Type: text/plain; charset=utf-8\n"

"Content-Transfer-Encoding: 8bit\n"

Otherwise, Launchpad may reject the file.

##Uploading default.pot

###Uploading default.pot to Launchpad via Bazaar 

* Commit the file using the Bazaar Explorer GUI. 

When it comes time to push your changes, go to a Windows command prompt, issue a launchpad-login command, and issue a push command. For user abc, the commands would be as follows:

    cd bzr\trunk\trunk\default
    bzr launchpad-login abc
    bzr push lp:tatoeba
    
##Editing .po files

You may need to edit the .po files manually at this stage if you want to restore translations for UI strings that have changed. A merge tool such as WinMerge or KDiff3 may be useful here. Skip this step if you don't know what is entailed.

##Check .po files

Use this command on each .po file to ensure that it has the correct syntax:

msgfmt -c filename.po

The Launchpad site executes this step after the .po files are uploaded and approved, but checking the files first will save you more work in the long run.

##Upload .po files

Put all the .po files that have changed into a "tarball", which is a file with the extension .tar.gz or .tar.bz2 . You can use a zipfile utility such as [7Zip](http://www.7-zip.org/) command on Windows or *tar* on Linux to produce the tarball. Then upload them at the same URL that you used to upload the default.pot file. 

##Run update-translations.sh

If you do not already have bzr installed on your Linux virtual machine, install it with this command: "apt-get install bzr" . You may need to issue a "su -" (superuser) command to perform the installation.
 
Run this script:

tatoeba-www/docs/update-translations.sh

It will do the following:

* check out the files from the Launchpad repository (using Bazaar)
* place them in a temporary directory
* check them into the final Tatoeba2 repository

##Historical information only

The original source of these instructions, stored on Assembla, is here: [1]

  [1]: https://www.assembla.com/spaces/tatoeba2/wiki/Internationalization


###Uploading default.pot to Launchpad via import queue (deprecated)

Go to this URL:
 
https://translations.launchpad.net/tatoeba/trunk/+translations-upload

Set the following:
* file type: template
* path: default.pot
* template: default

You can leave name and translation domain empty.

Upload the file. 

You may need to wait a day or so for the translation files to be updated.

Note

The lines in green are the lines that have been added in the new version. The lines in red are those that have been removed.