.inx format updates for Inkscape 1.0
We've been discussing in chat, that we'd like to slightly change the .inx format for 1.0 to simplify it and make preparations to allow for translation of individual extensions. Primarily this means dropping the underscore syntax for marking strings for translation.
The aim is to land this before the 1.0 release, so that we'll have a stable syntax in the 1.x branch. The changes are intended to be fully backwards-compatible, so pre-1.0 .inx file will continue to work in Inkscape 1.0+ (and vice-versa, with the limitation of missing translations).
The currently planned changes are as follows (compare also INX parameter reference):
- drop underscored element and attribute names
- Instead assume most strings to be translatable by default, notably
-
<name>
of extension -
gui-name
andgui-description
attributes of parameters - value of
<description>
elements - values of enum
<item>
s and optiongroup<options>
- the submenu entry name the extension wants to add itself into
- most
templatedata
elements (for procedural templates, but obviously also makes sense to change for templates themselves).
-
- Not translatable by default will be parameter values.
- The default can be overridden per element by setting the
translatable="yes/no"
attribute (should typically be used sparingly) - For backwards-compatibility we'll continue to parse underscored element and attribute names, but will treat them identical to the non-underscored variant.
- Instead assume most strings to be translatable by default, notably
- Add a
translationdomain
attribute to the rootinkscape-extension
element.
This will (eventually) allow to specify a different gettext textdomain, so translations can ship their own .mo files instead of depending on the unlikely assumption that strings might be available in inkscape.mo. Implementation of this detail is intended for Inkscape 1.1 or later; goal for 1.0 is only to introduce the keyword and to support two specific values:- default (i.e. attribute not specified): re-use
inkscape
translation domain, i.e. what we always did for all extensions -
translationdomain="none"
: disable translation for the whole extension
This is necessary as extension authors can't "unmark" strings for translations manually anymore with the changes suggested in the last bullet point, unless they SPAM thetranslatable="no"
attribute onto each element (which seems undesirable). Third-party extensions will typically want to set this attribute in order to avoid having a few common strings extracted from the Inkscape message catalog, with most of the extension remaining untranslated.
- default (i.e. attribute not specified): re-use
- We should likely support
msgctxt
for translatable elements (we already support it for the most relevant). This will actually become less relevant, though, once we have separate message catalogs, e.g. one for "inkscape" and once for the bundled "inkscape-extensions", which is a context of sorts already.
Comments and suggestions are welcome. If this plan is approved I'm willing to implement the necessary changes in Inkscape and adjust the .inx files in the extension repo accordingly.