translations for extensions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

translations for extensions

Mark Schafer
Several extensions have indicated they would like translation to other
languages.

Its not clear how this can be achieved.
Any ideas on the proper approach - even if we can't do it now ?
  - current info -
https://inkscape.org/en/contribute/translations/#translatable-content

Currently .po files are:
- not dynamic and distributed with the main distributon
- are per language
They use a mechanism of direct translation of one phrase into a
substitution phrase as outlined here:
  -
http://wiki.inkscape.org/wiki/index.php/Translation_information#PO_translation_files

So this mechanism cannot accommodate the extensions which probably need:
- one file per language added to the current inx and code file.
- perhaps a way of merging all these new po files when extensions are
loaded.

Now:
When we write an extension we can use the underscore variants (below) to
get translations.
My assumption is that this is looking in the translation database on the
off-chance the word has been translated. However this will fail for all
descriptions and currently untranslated names, options, gui-texts and items.

The complete set of translateable types for extensions is:
-  _gui-text, _name, _description, _filetypename, _filetypetooltip,
_item, _option, _param
- but its not clear any do get translated.

Can anyone confirm this is how it works now ?
Any ideas on a plan for what might be done in the future so we can add
it to the todo list ?


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: translations for extensions

Eduard Braun

Hi Mark,

the current mechanism works more or less as you described:

  • During build translatable strings are extracted from *.inx files in /share/extension.
    Those strings end up in the /po/inkscape.pot file so they can be translated along with all the other UI strings.
  • At runtime gettext is used to get the proper translation from the compiled inkscape.mo files

Obviously this mechanism will only work for bundled extensions (as you noted), as other strings won't be part of the inkscape.pot file. Bundled extensions can be fully translated, though. You're right that this makes it currently impossible to translate extensions that are not bundled with Inkscape.

Some thoughts:

  • If there's a possibility to "combine" *.mo files (unfortunately I don't know much about gettext myself), that could be a straightforward way to extend our extension system to also load third-party translations.
  • An alternative would be to include translations directly into the .inx file (similar to what <switch> and the systemLanguage attribute allow for SVGs). However this would require additional logic and might introduce some potentially undesirable inconsistency between bundled and third-party extensions. Also it might make extension files pretty bloated and hard to keep updated once many locales are included.

Regards,
Eduard


Am 16.04.2017 um 00:38 schrieb Mark Schafer:
Several extensions have indicated they would like translation to other 
languages.

Its not clear how this can be achieved.
Any ideas on the proper approach - even if we can't do it now ?
  - current info - 
https://inkscape.org/en/contribute/translations/#translatable-content

Currently .po files are:
- not dynamic and distributed with the main distributon
- are per language
They use a mechanism of direct translation of one phrase into a 
substitution phrase as outlined here:
  - 
http://wiki.inkscape.org/wiki/index.php/Translation_information#PO_translation_files

So this mechanism cannot accommodate the extensions which probably need:
- one file per language added to the current inx and code file.
- perhaps a way of merging all these new po files when extensions are 
loaded.

Now:
When we write an extension we can use the underscore variants (below) to 
get translations.
My assumption is that this is looking in the translation database on the 
off-chance the word has been translated. However this will fail for all 
descriptions and currently untranslated names, options, gui-texts and items.

The complete set of translateable types for extensions is:
-  _gui-text, _name, _description, _filetypename, _filetypetooltip, 
_item, _option, _param
- but its not clear any do get translated.

Can anyone confirm this is how it works now ?
Any ideas on a plan for what might be done in the future so we can add 
it to the todo list ?


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Inkscape-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel
Loading...