Difference between revisions of "Interface translation"
(Review) |
(Keeping only what is specific to Interface translation; updated Windows installer section) |
||
Line 1: | Line 1: | ||
[ | Go back to the main [[Translation information]] page. | ||
== | == Main translation file == | ||
See [[Translation information#PO translation files|here]] to get information about how to deal with PO files. | |||
=== Get the PO file for your language === | |||
== Get the PO file for your language == | |||
Download the .po file for your language from [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head:/po/ here]. | Download the .po file for your language from [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head:/po/ here]. | ||
Line 30: | Line 14: | ||
The most straightforward way to obtain the inkscape.pot template is to download it from [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/annotate/head:/po/inkscape.pot here]. | The most straightforward way to obtain the inkscape.pot template is to download it from [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/annotate/head:/po/inkscape.pot here]. | ||
Alternatively, you can checkout the full | Alternatively, you can checkout the full Bazaar project repository and generate the project template. Information on how to get the source tree can be found [https://inkscape.org/develop/inkscape-bzr/ here]. Then, you have to follow some steps in order to generate the template: | ||
# <code>./autogen.sh</code> | # <code>./autogen.sh</code> | ||
Line 37: | Line 21: | ||
# Generate the current PO template: <code>intltool-update --pot</code> | # Generate the current PO template: <code>intltool-update --pot</code> | ||
To make an absolutely up-to-date translation (in case the PO file in | To make an absolutely up-to-date translation (in case the PO file in bzr is not up-to-date enough): | ||
# Update your local copy of Inkscape in the usual way: <code>bzr pull</code> | # Update your local copy of Inkscape in the usual way: <code>bzr pull</code> | ||
Line 49: | Line 33: | ||
Now that you have an empty PO template, you can start translating the messages. | Now that you have an empty PO template, you can start translating the messages. | ||
=== Locale Testing === | |||
= | |||
== Locale Testing == | |||
Before reporting that a locale doesn't work in Inkscape, you need to make sure that your system has that locale correctly set up. To do this, you need to generally find a way to run ‘locale-gen’ (under Debian/Ubuntu this is via <code>dpkg-reconfigure locales</code>). If you set both the LANG and LANGUAGE variables and check a regular tool, you should see the correct language for both the libc error (first line) and the tool error (second line): | Before reporting that a locale doesn't work in Inkscape, you need to make sure that your system has that locale correctly set up. To do this, you need to generally find a way to run ‘locale-gen’ (under Debian/Ubuntu this is via <code>dpkg-reconfigure locales</code>). If you set both the LANG and LANGUAGE variables and check a regular tool, you should see the correct language for both the libc error (first line) and the tool error (second line): | ||
Line 108: | Line 51: | ||
</pre> | </pre> | ||
== Submit finished work == | === Submit finished work === | ||
Upload your work via the [https://bugs.launchpad.net/inkscape/ Launchpad bug tracker]. Report a new bug and attach your translated file to it. Don't forget to compress your file before uploading it. | Upload your work via the [https://bugs.launchpad.net/inkscape/ Launchpad bug tracker]. Report a new bug and attach your translated file to it. Don't forget to compress your file before uploading it. | ||
Line 114: | Line 57: | ||
Additionally, you may send a message to Inkscape's translators mailing list. | Additionally, you may send a message to Inkscape's translators mailing list. | ||
== Windows installer == | |||
== Windows installer | |||
# Get the file according to your language [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head:/packaging/win32/languages/ here]. If there is not such a file, copy the ‘English.nsh’ file and rename it to ‘YourLanguage.nsh’. | |||
# Get the file according to your language. If there is not such a file, copy | |||
# Translate strings in the file. | # Translate strings in the file. | ||
# Change header information in | # Change header information in ‘YourLanguage.nsh’ file (language name, [https://msdn.microsoft.com/en-us/goglobal/bb895996.aspx local ID], [https://msdn.microsoft.com/en-us/goglobal/bb964654 windows code page] and authors list) to proper values. | ||
=== Testing the translation === | === Testing the translation === | ||
Line 137: | Line 72: | ||
# If the translation is tested successfully, submit it to the [https://bugs.launchpad.net/inkscape/ Launchpad bug tracker] and mark as ‘Translation’. If you haven't tested your translation yet, submit it too but enter this information to the patch information. You will be contacted about its correctness. | # If the translation is tested successfully, submit it to the [https://bugs.launchpad.net/inkscape/ Launchpad bug tracker] and mark as ‘Translation’. If you haven't tested your translation yet, submit it too but enter this information to the patch information. You will be contacted about its correctness. | ||
== Default template | == Default template == | ||
* To translate the default template, modify the default.svg file and save it as default.xx.svg where ‘xx’ is the ISO code of your language. You will find the current template [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head:/share/templates/ here]. | * To translate the default template, modify the default.svg file and save it as default.xx.svg where ‘xx’ is the ISO code of your language. You will find the current template [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head:/share/templates/ here]. | ||
Line 145: | Line 80: | ||
To translate the default template, you can use Inkscape as well as any UTF-8 encoding capable text editor. | To translate the default template, you can use Inkscape as well as any UTF-8 encoding capable text editor. | ||
[[Category:Translation]] |
Revision as of 21:59, 11 July 2016
Go back to the main Translation information page.
Main translation file
See here to get information about how to deal with PO files.
Get the PO file for your language
Download the .po file for your language from here.
If a .po file for your language does not yet exist, then you will have to get an empty template file to start a new translation. You may also need to use the updated template file (mentioned blow) to bring the .po file up to date with new strings introduced in the UI.
The most straightforward way to obtain the inkscape.pot template is to download it from here.
Alternatively, you can checkout the full Bazaar project repository and generate the project template. Information on how to get the source tree can be found here. Then, you have to follow some steps in order to generate the template:
./autogen.sh
./configure
- Enter the ‘po’ directory:
cd po
- Generate the current PO template:
intltool-update --pot
To make an absolutely up-to-date translation (in case the PO file in bzr is not up-to-date enough):
- Update your local copy of Inkscape in the usual way:
bzr pull
- Merge your existing translations into the new POT file (inkscape.pot):
msgmerge your_latest_PO_file inkscape.pot > new_PO_file
If you want to update ALL .po files in po/, cd there and run:
make update-po
Now that you have an empty PO template, you can start translating the messages.
Locale Testing
Before reporting that a locale doesn't work in Inkscape, you need to make sure that your system has that locale correctly set up. To do this, you need to generally find a way to run ‘locale-gen’ (under Debian/Ubuntu this is via dpkg-reconfigure locales
). If you set both the LANG and LANGUAGE variables and check a regular tool, you should see the correct language for both the libc error (first line) and the tool error (second line):
LANG=es_MX LANGUAGE=es_MX ls -z ls: opción inválida -- z Pruebe `ls --help' para más información.
If it reports the regular C messages, your locale has not been correctly configured, and you'll need to find the right way to run ‘locale-gen’ for your distribution:
LANG=es_ES LANGUAGE=es_MX ls -z ls: invalid option -- z Try `ls --help' for more information.
Submit finished work
Upload your work via the Launchpad bug tracker. Report a new bug and attach your translated file to it. Don't forget to compress your file before uploading it.
Additionally, you may send a message to Inkscape's translators mailing list.
Windows installer
- Get the file according to your language here. If there is not such a file, copy the ‘English.nsh’ file and rename it to ‘YourLanguage.nsh’.
- Translate strings in the file.
- Change header information in ‘YourLanguage.nsh’ file (language name, local ID, windows code page and authors list) to proper values.
Testing the translation
This part is optional but recommended.
- You need NSIS installer and run the
make -f Makefile.mingw dist
command after successful compilation of Inkscape. This command prepares binary of Inkscape for installer creation. - Add filename of your file to inkscape.nsi file, "STRING LOCALIZATION" section, "Language files" subsection.
- Right click on the inkscape.nsi file and choose ‘Compile NSIS Script’. The installer compilation will start.
- When the installer is finished, run it to test translations of strings in Installer and Uninstaller parts.
- If the translation is tested successfully, submit it to the Launchpad bug tracker and mark as ‘Translation’. If you haven't tested your translation yet, submit it too but enter this information to the patch information. You will be contacted about its correctness.
Default template
- To translate the default template, modify the default.svg file and save it as default.xx.svg where ‘xx’ is the ISO code of your language. You will find the current template here.
- You need to modify your PO translation as well to use your localized default template. Look up for a
msgid "default.svg"
on the PO file and translate it accordingly to the file name of the localized template. - To test it, save it to the proper location and restart Inkscape. Default document should be now based on your localized template (this is valid if your system is properly set to your locales).
- Upload default.xx.svg to the patch tracker.
To translate the default template, you can use Inkscape as well as any UTF-8 encoding capable text editor.