Difference between revisions of "Interface translation"

From Inkscape Wiki
Jump to navigation Jump to search
m (Added windows instructions on where to find LOCALE folder on Windows os betwen the lines "Find the .mo of..." and "Backup this .mo...".)
(Make instructions work for all operating systems with no special cases for any one of them, or for different installation directories, fix path typo. Add more info.)
Line 11: Line 11:
# 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.
# 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.
# 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’.
# Find and replace your language's .mo file. It is a file named ‘locale/your_language/LC_MESSAGES/inkscape.mo’, in the directory listed under '''Edit > Preferences > System > Inkscape Data''' in Inkscape. This will not work with the snap, .dmg, AppImage or flatpak version of Inkscape, but only with a version that has been properly installed on your system and with extracted binary archives (zip files for Windows or self-compiled). In some cases, you may need administrator privileges to edit files in said directory.
## For Windows OS go to: '''INKSCAPE_DIR/share/local/your_language/LC_MESSAGES/inkscape.mo'''
# Rename the original inkscape.mo file to inkscape.mo.bak and save your compiled .mo file into its place as inkscape.mo instead
### The same can be achieved if you go to '''Edit > Preferences > System > Inkscape Data'''
# Then start Inkscape and you'll see your strings!
# Backup this .mo and put your compiled .mo instead. Then start Inkscape and you'll see your strings!


== Windows installer ==
== Windows installer ==

Revision as of 21:17, 23 December 2019

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 and replace your language's .mo file. It is a file named ‘locale/your_language/LC_MESSAGES/inkscape.mo’, in the directory listed under Edit > Preferences > System > Inkscape Data in Inkscape. This will not work with the snap, .dmg, AppImage or flatpak version of Inkscape, but only with a version that has been properly installed on your system and with extracted binary archives (zip files for Windows or self-compiled). In some cases, you may need administrator privileges to edit files in said directory.
  4. Rename the original inkscape.mo file to inkscape.mo.bak and save your compiled .mo file into its place as inkscape.mo instead
  5. 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.