Inkscape.org
Creating New Extensions translation file
  1. #1
    FrankI4466 FrankI4466 @FrankI4466

    Is it possible to create a translation file for an extension?

     
  2. #2
    Patrick Storz Patrick Storz @Ede_123

    It is possible since Inkscape 1.0 but I did not get around to write the documentation for it.

    In short, you need to set the translationdomain attribute on the root <extension> element, then Inkscape will look for a gettext translation catalog next to the .inx file of your extension, see https://gitlab.com/inkscape/inkscape/-/merge_requests/976/diffs#e8d978e6d87cf2f09241382e630d1e7249060b1c_428_461

  3. #3
    FrankI4466 FrankI4466 @FrankI4466

    Thank's.

    But i don't understand how i can use it. What is the ${translationdomain}.mo file and what is the format of translation  file (po ?)

    Could you help me with an example ?

  4. #4
    Patrick Storz Patrick Storz @Ede_123
    *

    Are you familiar with gettext and how to use it to create translation catalogs? If not I suggest you familiarize yourself with it first.

    An example does not exist yet (the example will be the core extensions shipped with Inkscape). As soon as I get around to create this "example" I'll also write the relevant documentation.

  5. #5
    FrankI4466 FrankI4466 @FrankI4466

    No I'm not. Then i will try it.

    Thank's

  6. #6
    George3300 George3300 @George3300
    *

    Hello!

    Have you got to create a translation file for an extension, @FrankI4466 ? If so, could you tell us how to?

    @Ede_123 , did you write the documentation to see some example?

    Thank you in advance

     

  7. #7
    FrankI4466 FrankI4466 @FrankI4466

    Unfortunetaly, I did not succeed.

  8. #8
    George3300 George3300 @George3300

    I get to translate an extension. I'm going to tell you guys how to i did.

     - Add a translationdomain attribute to the root inkscape-extension element.

     - Add underscore at the begining of the tag name. Example: <_label> and </_label>

     - Text must be in English

    - Download .po file from sources https://gitlab.com/inkscape/inkscape/-/tree/master/po and add the translation (english included).

    Example in English:

    #:
    #: .../share/inkscape/extensions/extension/file.inx:line
    msgid "Engraving Spedd (mm/min)"
    msgstr ""
     

    Example in Spanish:

    #: 
    #: File: ../share/inkscape/extensions/extension/file.inx:line
    msgid "Engraving Spedd (mm/min)"
    msgstr "Velocidad de grabado (mm/min)"

     

     - Compile to .mo.

     - Locate files to \share\locale in every folder. Rename de .mo to inkscape.mo

     

    Note: Inkscape has to be closed to see the changes.

     

    I hope this will be useful

  9. #9
    FrankI4466 FrankI4466 @FrankI4466

    Thank you George. I will try it. But i have read (somewhere ?) that the underscore is not necessary now (since 1.0 version).