Difference between revisions of "Interface translation"

From Inkscape Wiki
Jump to navigation Jump to search
(Link to template information)
(Update for move to gitlab)
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
== Main translation file ==
== Main translation file ==


[http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head:/po/ Download] the PO file for your language (or the .pot template). See [[Translation information#PO translation files|here]] to get information about how to deal with PO files.
[https://gitlab.com/inkscape/inkscape/tree/master/po Download] the PO file for your language (or the .pot template). See [[Translation information#PO translation files|here]] to get information about how to deal with PO files.


When you are done with your translation, [[Translation information#Submit finished work|submit your work]].
When you are done with your translation and enjoyed testing it, [[Translation information#Submit finished work|submit your work]].


=== Update strings ===
=== Test ===
 
Using [[Working with Bazaar|Bazaar]], you can checkout the full project repository and generate the project template. Then, you have to follow some steps in order to generate the template:
 
# <code>./autogen.sh</code>
# <code>./configure</code>
# Enter the ‘po’ directory: <code>cd po</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 bzr is not up-to-date enough):
 
# Update your local copy of Inkscape in the usual way: <code>bzr pull</code>
# Merge your existing translations into the new POT file (inkscape.pot):<br/> <code>msgmerge your_latest_PO_file inkscape.pot > new_PO_file</code>


If you want to update '''all''' PO files in po/, cd there and run: <code>make update-po</code>
# Make sure you have the release of Inkscape you are translating installed. If you're translating the coming release, pick a pre-release and compile it.
# Compile your PO file to .mo. Some translation tools (e.g. Poedit) have an option for that.
# Find the .mo of your installation of Inkscape for your locale. It should be in a folder named ‘locale’.
# Backup this .mo and put your compiled .mo instead. Then start Inkscape and you'll see your strings!


== 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 [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head:/packaging/win32/languages/ here]. If there's no such file, copy the ‘English.nsh’ file and rename it to ‘YourLanguage.nsh’ (make sure someone updates the file [http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/packaging/win32/languages/_language_lists.nsh _language_lists.nsh] in this case).
# Translate the strings in the file.
# Translate the strings in the file.
# Change header information in ‘YourLanguage.nsh’ (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.
# Change/update header information in ‘YourLanguage.nsh’ (language name, [https://msdn.microsoft.com/en-us/goglobal/bb895996.aspx locale ID] and authors list) to proper values.
# Save the file. (Translation files should always use Unicode, encoded as UTF8!).
# Optionally, test your translation as described below.
# Optionally, test your translation as described below.
# [[Translation information#Submit finished work|Submit your work]] (specify whether you tested it or not).
# [[Translation information#Submit finished work|Submit your work]] (specify whether you tested it or not).
Line 33: Line 25:
=== Test ===
=== Test ===


# [[Compiling Inkscape|Compile Inkscape]] (you'll probably want to [[Compiling Inkscape on Windows|Compile Inkscape on Windows]]) and run <code>make install</code> to create the binary distribution directory of Inkscape.
# Install [http://nsis.sourceforge.net/Main_Page NSIS].
# Install [http://nsis.sourceforge.net/Main_Page NSIS].
# Run the <code>make -f Makefile.mingw dist</code> command after successful compilation of Inkscape. This command prepares binary of Inkscape for installer creation.
# Add the filename of your file to the ‘inkscape.nsi’ file (in the parent folder) in the <code>; Localization</code> section (with other languages).
# Right-click on the ‘inkscape.nsi’ file and choose ‘Compile NSIS Script’. The installer compilation will start.
# 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 your translations for the installer and the uninstaller.
# When the installer is ready, run it to test your translations for the installer and the uninstaller.


== Default template ==
== Default template ==


To translate the 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].
* 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 [https://gitlab.com/inkscape/inkscape/tree/master/share/templates here].
* Modify your PO translation to use your localized default template. Look up for a ‘default.svg’ string and translate it accordingly to the file name of the localized template.
* Modify your PO translation to use your localized default template. Look up for a ‘default.svg’ string and translate it accordingly to the file name of the localized template.
* To test your template, save it as well as the compiled PO file (.mo) to the proper location for your system and restart Inkscape. New documents should now be based on your localized template (this is valid if your system is properly set to your locale).
* To test your template, save it as well as the compiled PO file (.mo) to the proper location for your system and restart Inkscape. New documents should now be based on your localized template (this is valid if your system is properly set to your locale).

Revision as of 19:12, 9 June 2017

Go back to the main Translation information page.

Main translation file

Download the PO file for your language (or the .pot template). See here to get information about how to deal with PO files.

When you are done with your translation and enjoyed testing it, submit your work.

Test

  1. Make sure you have the release of Inkscape you are translating installed. If you're translating the coming release, pick a pre-release and compile it.
  2. Compile your PO file to .mo. Some translation tools (e.g. Poedit) have an option for that.
  3. Find the .mo of your installation of Inkscape for your locale. It should be in a folder named ‘locale’.
  4. Backup this .mo and put your compiled .mo instead. Then start Inkscape and you'll see your strings!

Windows installer

  1. Get the file according to your language here. If there's no such file, copy the ‘English.nsh’ file and rename it to ‘YourLanguage.nsh’ (make sure someone updates the file _language_lists.nsh in this case).
  2. Translate the strings in the file.
  3. Change/update header information in ‘YourLanguage.nsh’ (language name, locale ID and authors list) to proper values.
  4. Save the file. (Translation files should always use Unicode, encoded as UTF8!).
  5. Optionally, test your translation as described below.
  6. Submit your work (specify whether you tested it or not).

Test

  1. Compile Inkscape (you'll probably want to Compile Inkscape on Windows) and run make install to create the binary distribution directory of Inkscape.
  2. Install NSIS.
  3. Right-click on the ‘inkscape.nsi’ file and choose ‘Compile NSIS Script’. The installer compilation will start.
  4. When the installer is ready, run it to test your translations for the installer and the uninstaller.

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.
  • Modify your PO translation to use your localized default template. Look up for a ‘default.svg’ string and translate it accordingly to the file name of the localized template.
  • To test your template, save it as well as the compiled PO file (.mo) to the proper location for your system and restart Inkscape. New documents should now be based on your localized template (this is valid if your system is properly set to your locale).
  • Submit your work.

To translate the default template, you can use Inkscape as well as any UTF-8 encoding capable text editor.