Difference between revisions of "Interface translation"

From Inkscape Wiki
Jump to navigation Jump to search
(→‎Test: Review)
 
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Go back to the main [[Translation information]] page.
Go back to the main [[Translation information]] page.


== Main translation file ==
== Main translation files ==


[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.
=== 1. Coordinate ===


When you are done with your translation, [[Translation information#Submit finished work|submit your work]].
As there may be other persons also currently working on the translation to your language, as a first step, please let your colleagues on the translators mailing list know that you'd like to start working on your language's translation, and coordinate your efforts (e.g. divide the work, set up a review system, … ). You can also check the mailing list archives to see whether there may be others who have started working on it recently. You can also ask for help finding previous translators for your language in the chat, to join their team.


=== Update strings ===
=== 2. Get the file ===
Get the most up-to-date translation files from GitLab's automatic builds:


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:
For the main development branch:
https://gitlab.com/inkscape/inkscape/-/jobs/artifacts/master/download?job=translations


# <code>./autogen.sh</code>
For release branches:
# <code>./configure</code>
https://gitlab.com/inkscape/inkscape/-/jobs/artifacts/<branch name>/download?job=translations
# 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):
The name of the release branch is usually something like '1.0.x' or '1.1.x'. You can ask on the mailing list or in the chat which branch is the current translation target.


# Update your local copy of Inkscape in the usual way: <code>bzr pull</code>
In some cases, this will give a 'Page not found' error. In that case, visit the [https://gitlab.com/inkscape/inkscape/ main Inkscape repository page on GitLab], select the correct branch at the top, then on the right side, click on the download icon and select to download the 'translations' artifact.
# 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>
Unzip the downloaded file and select the po file for your language from it.
 
=== 3. Translate ===
 
Translate the file for your language from the archive above with your [https://wiki.inkscape.org/wiki/index.php/Translation_information#Tools_for_translators favorite translation software].
 
Tip: if you encounter a case where, in the English text, the order of formatting arguments (numbers or text snippets that will be inserted into the string when the program runs) is different from the order in your language, and the arguments are not numbered in the original string, [https://gitlab.com/inkscape/inbox/-/issues/6544#note_996695887 you can try this].
 
=== 4. Test ===
 
# 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 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. <br>''Note: 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 versions. In some cases, you may need administrator privileges to edit files in said directory.''
# Rename the original inkscape.mo file to inkscape.mo.bak and save your compiled .mo file into its place as inkscape.mo instead
# Then start Inkscape and you'll see your strings!
 
=== 5. Get a GitLab account ===
 
If you don't have an account yet, now is the time to [https://gitlab.com/users/sign_up create one]
 
=== 6. Exchange the file on GitLab ===
 
For Inkscape 1.3.x, visit
<code><nowiki>https://gitlab.com/inkscape/inkscape/-/blob/1.3.x/po/<your_locale>.po</nowiki></code>
 
For the main development branch, go to
<code><nowiki>https://gitlab.com/inkscape/inkscape/-/blob/master/po/<your_locale>.po</nowiki></code>
 
Click on the "Replace" button and upload your translated file.
 
Enter your commit message below (something like "Update <your_locale>"). Choose a name for your branch. Do not use the same name as the target branch, but something like 'es_translations_for_1.3'.
 
=== 7. Make a merge request ===
 
Click on the "Create merge request" button.
 
In the form, check 'Allow commits from members who can merge to the target branch' and also 'squash commits'.
 
Submit the merge request.
 
<!--


== 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 [https://gitlab.com/inkscape/inkscape/tree/master/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 [https://gitlab.com/inkscape/inkscape/blob/master/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 73:
=== Test ===
=== Test ===


# [[Compiling Inkscape|Compile Inkscape]].
# [[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.
# Run the <code>make -f Makefile.mingw dist</code> command. It prepares the binary of Inkscape for the installer.
# Add the filename of your file to the ‘inkscape.nsi’ file (in the parent folder) in the <code>; Localization</code> section (with other languages).
# Install [http://nsis.sourceforge.net/Main_Page NSIS].
# Install [http://nsis.sourceforge.net/Main_Page NSIS].
# 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.
Line 43: Line 81:


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).
Line 49: Line 87:


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]]
[[Category:Translation]]

Latest revision as of 18:43, 6 June 2023

Go back to the main Translation information page.

Main translation files

1. Coordinate

As there may be other persons also currently working on the translation to your language, as a first step, please let your colleagues on the translators mailing list know that you'd like to start working on your language's translation, and coordinate your efforts (e.g. divide the work, set up a review system, … ). You can also check the mailing list archives to see whether there may be others who have started working on it recently. You can also ask for help finding previous translators for your language in the chat, to join their team.

2. Get the file

Get the most up-to-date translation files from GitLab's automatic builds:

For the main development branch: https://gitlab.com/inkscape/inkscape/-/jobs/artifacts/master/download?job=translations

For release branches: https://gitlab.com/inkscape/inkscape/-/jobs/artifacts/<branch name>/download?job=translations

The name of the release branch is usually something like '1.0.x' or '1.1.x'. You can ask on the mailing list or in the chat which branch is the current translation target.

In some cases, this will give a 'Page not found' error. In that case, visit the main Inkscape repository page on GitLab, select the correct branch at the top, then on the right side, click on the download icon and select to download the 'translations' artifact.

Unzip the downloaded file and select the po file for your language from it.

3. Translate

Translate the file for your language from the archive above with your favorite translation software.

Tip: if you encounter a case where, in the English text, the order of formatting arguments (numbers or text snippets that will be inserted into the string when the program runs) is different from the order in your language, and the arguments are not numbered in the original string, you can try this.

4. 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.
    Note: 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 versions. 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!

5. Get a GitLab account

If you don't have an account yet, now is the time to create one

6. Exchange the file on GitLab

For Inkscape 1.3.x, visit https://gitlab.com/inkscape/inkscape/-/blob/1.3.x/po/<your_locale>.po

For the main development branch, go to https://gitlab.com/inkscape/inkscape/-/blob/master/po/<your_locale>.po

Click on the "Replace" button and upload your translated file.

Enter your commit message below (something like "Update <your_locale>"). Choose a name for your branch. Do not use the same name as the target branch, but something like 'es_translations_for_1.3'.

7. Make a merge request

Click on the "Create merge request" button.

In the form, check 'Allow commits from members who can merge to the target branch' and also 'squash commits'.

Submit the merge request.