20 грудня 2016, 13:07:29, від "Sylvain Chiron" <chironsylvain@...364...>:
Le 20/12/2016 à 03:47, Bryce Harrington a écrit :
On Mon, Dec 19, 2016 at 10:05:12PM +0200, Yuri Chornoivan wrote:
Some relatively new strings in 0.92.x branch are actually untranslatable due to such called "string puzzles":
http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/view/head:/share/e...
inkex.errormsg(_("Side Length 'a' (" + unit + "): " + str( params[0][0] ) )) inkex.errormsg(_("Side Length 'b' (" + unit + "): " + str( params[0][1] ) )) inkex.errormsg(_("Side Length 'c' (" + unit + "): " + str( params[0][2] ) ))
extracts as
Side Length 'a' ( Side Length 'b' ( Side Length 'c' (
Good point. There are probably other instances like this where variables are being included in the translatable. I would guess the proper way to do it would be something like:
inkex.errormsg(_("Side Length 'a'") + " (" + unit + "): " + str( params[0][0] ) )
Punctuation must be translatable too, e.g. in French you need a no-break space before the colon, so it would be closer to something like this:
inkex.errormsg(_("Side Length 'a' ({0}):").format(unit) + " " + str( params[0][0] ) )
But one should refer to the Gettext doc for Python.
Regards,
Just for the reference, I filed BR #1651334
https://bugs.launchpad.net/inkscape/+bug/1651334
Best regards, Yuri