Discussion:
itstool avalability
Olivier Sessink
2014-05-23 13:50:48 UTC
Permalink
Hi all,

I'm looking how to make the descriptions of options in the language
files translatable. An existing tool to extract strings from xml files
is itstool. Would it be a problem if Bluefish gets a new dependency on
itstool? Is it widely available?

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Andrius Rinkevicius
2014-05-23 19:01:21 UTC
Permalink
ITStool is not included into gtk-osx supported list, but I found that
several people build it successfully on MacOSX. So, probably I just need to
try to build it and see.
Andrius


On Fri, May 23, 2014 at 4:50 PM, Olivier Sessink <
Post by Olivier Sessink
Hi all,
I'm looking how to make the descriptions of options in the language
files translatable. An existing tool to extract strings from xml files
is itstool. Would it be a problem if Bluefish gets a new dependency on
itstool? Is it widely available?
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
To unsubscribe from this list: send the line "unsubscribe bluefish-dev" in
panel at http://www.ems.ru/cgi-bin/listargate.cgi
Bluefish web site: http://bluefish.openoffice.nl/
Daniel Leidert
2014-05-23 23:18:14 UTC
Permalink
Post by Olivier Sessink
Hi all,
I'm looking how to make the descriptions of options in the language
files translatable. An existing tool to extract strings from xml files
is itstool. Would it be a problem if Bluefish gets a new dependency on
itstool? Is it widely available?
You can use intltool, which we already use for XML files. Don't you
think?

Regards, Daniel
Olivier Sessink
2014-05-24 09:28:39 UTC
Permalink
Post by Daniel Leidert
Post by Olivier Sessink
Hi all,
I'm looking how to make the descriptions of options in the language
files translatable. An existing tool to extract strings from xml files
is itstool. Would it be a problem if Bluefish gets a new dependency on
itstool? Is it widely available?
You can use intltool, which we already use for XML files. Don't you
think?
yes/no

I like to extract only a couple of strings (the option descriptions)
from the language file into a .po file, and translate them at runtime in
Bluefish. As far as I found intltool can only convert a template into a
translated xml file (foo.xml.in into foo.xml).

But perhaps this is possible?

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Daniel Leidert
2014-05-24 13:06:32 UTC
Permalink
Post by Olivier Sessink
Post by Daniel Leidert
Post by Olivier Sessink
Hi all,
I'm looking how to make the descriptions of options in the language
files translatable. An existing tool to extract strings from xml files
is itstool. Would it be a problem if Bluefish gets a new dependency on
itstool? Is it widely available?
You can use intltool, which we already use for XML files. Don't you
think?
yes/no
I like to extract only a couple of strings (the option descriptions)
from the language file into a .po file, and translate them at runtime in
Bluefish. As far as I found intltool can only convert a template into a
translated xml file (foo.xml.in into foo.xml).
Nope. The strings stay in the message catalog. So you can fetch the
untranslated string from any XML file and use the gettext functions to
receive the translation in the given domain/language. You can try
yourself, if you have bluefish installed :) For
example /usr/share/mime/packages/bluefish.xml contains the string
Post by Olivier Sessink
LANG=nl_NL gettext -d bluefish "Bluefish language definition file"
Bluefish taal definitie bestand
with your standard bluefish installation. The string from the XML file
is in the catalog.
Post by Olivier Sessink
But perhaps this is possible?
It is. The more interesting questions probably are: How to suppress the
output of the translated string into the XML file? How to put the
untranslated string into the XML file. E.g. in a sample XML file it is:

<_foo>untranslated string</_foo>

and we have

<option [..] description="untranslated string" />

The latter might be easy to fix.

Regards, Daniel
Olivier Sessink
2014-05-24 19:47:01 UTC
Permalink
Post by Daniel Leidert
It is. The more interesting questions probably are: How to suppress
the output of the translated string into the XML file? How to put the
untranslated string into the XML file. E.g. in a sample XML file it
is: <_foo>untranslated string</_foo> and we have <option [..]
description="untranslated string" /> The latter might be easy to fix.
Regards, Daniel
but can we configure intltool to read strings from the current language
files without changes to the language file? What would that easy fix you
are thinking of look like?

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Daniel Leidert
2014-05-25 09:02:00 UTC
Permalink
Post by Olivier Sessink
Post by Daniel Leidert
It is. The more interesting questions probably are: How to suppress
the output of the translated string into the XML file? How to put the
untranslated string into the XML file. E.g. in a sample XML file it
is: <_foo>untranslated string</_foo> and we have <option [..]
description="untranslated string" /> The latter might be easy to fix.
Regards, Daniel
but can we configure intltool to read strings from the current language
files without changes to the language file?
Doesn#t seem to be the case.
Post by Olivier Sessink
What would that easy fix you are thinking of look like?
For intltool to read the option, it woulkd be necessary to use this
syntax:

<_option name="Parentheses block_foldable" default="0">Allow folding of
the Parentheses block</_option>

and not put the translatable string into a parameter.

However, it seems, using intltool we would need several steps:
(a) Rename all files to be called foo.xml.in.
(b) Use the above syntax for translatable string or something like this:

<option name="Parentheses block_foldable" default="0">
<_description>Allow folding of the Parentheses block</_description>
</option>

(c) Create a rule to make language.bflang2 from language.xml and drop
all tags <description xml:lang="...">...</description>.

If you consider alternatives to intltool and itstool (xml2po) you can
also check out po4a. With this you can even internationalize our
bluefish's manpage using .po files :)

Regards, Daniel

Loading...