is there a solution ready for use to extract words from dtd and
properties files for creating an online dictionary? The dictionary is
based on php and mysql.
Regards and thanks in advance
Michael
I have a python script which reads all strings from a source checkout to
a MySQL table. It uses compare-locales and Silme to do that. My
intension was to make a web site which could translate error messages,
but I didn't manage to make the search work as well as I would like it.
Send me an email if you want the script. mail(at)jesperkristensen.dk
Silme can make it very easy.
It's a bit early in the game, and Silme has no stable release, but it
can easily read what you need.
I recommend using "multilocale" branch, and then you can write sth like:
#!/usr/bin/python
sys.path.append('./lib')
import silme.core
import silme.fp.object.dtd
import silme.fp.object.properties
import silme.io
io = silme.io.Manager.get('file')
l10nPackage = io.getL10nPackage('./path/to/your/directory/')
print l10nPackage.getPackages()
print l10nPackage.getObjects()
print l10nPackage.getPackage('subdirectory')
print l10nPackage.getObject('file.dtd').getEntities()
and you should understand the rest of API.
If you don't care for structure:
print l10nPackage.getEntities()
will give you all entities from all files from this package.
You can download it from
http://hg.mozilla.org/users/zbraniecki_mozilla.com/silme
Im currently working on releasing more stable version of silme after
merging the branch back to trunk
(https://bugzilla.mozilla.org/show_bug.cgi?id=458441)
Yes. Documentation is a part of the short-term plan :)
Greetings
Zbigniew Braniecki
--
Mozilla (http://www.mozilla.org)
My sceptic me mentions that the licensing implications on this are
somewhat tricky, as with language in general.
There is a similar project on the net somewhere, but I don't find the
URL right now. And we had a lenthy discussion about their licensing
scheme, too.
Axel
Hallo Michael
I am sure you are aware of the Translate Toolkit that can convert
Mozilla files to PO. With the recent release of the Toolkit, we have a
new tool called poterminology:
http://translate.sourceforge.net/wiki/toolkit/poterminology
It can extract frequent words and short phrases, and can even try to
fill in the translations used for them in the files. There are lots of
parameters to tweak, to control the type of output. The PO file can
easily be converted to other formats that you might prefer, such as CSV.
Poterminology is built on the API of the Translate Toolkit, which is
also used by Open-tran that Axel mentioned.
Keep well
Friedel
--
Recently on my blog:
http://translate.org.za/blogs/friedel/en/content/autocompletion-during-translation
Zbigniew Braniecki napisa:
> Silme can make it very easy.
>
> It's a bit early in the game, and Silme has no stable release, but it
> can easily read what you need.
>
> I recommend using "multilocale" branch, and then you can write sth like:
Hello Zbigniew,
thank you for message. Sorry for the late answer. Hm, to be honest, I
don't know what Silme is. I hoped that there would be a not too
complicated solution (a simple one probably doesn't exist).
I'd know how will be look the output? Mainly I need simple words useful
for a dictionary. Useless words shall be filtered off. there will be
example phrases too, but I think they should be entered manually.
I don't know much about script programming. It's for a new online
lexicon which shall collect Upper Sorbian and Lower Sorbian technical
terms together with their German and English equivalents:
http://www.serbski-leksikon.de/test/
The lexicon is still in development phase, there aren't much words in
it. I look for a method to input entries automatically because manual
entering will be a lot of work.
This lexicon is in fact a new reason to build such a glossary. I've been
translating Mozilla programs to Upper Sorbian (and now for Lower
Sorbian, too) for many years and want already for a long time to build
such a glossary to avoid that I use for the same English word a
different translation e.g. in SeaMonkey and Firefox. The translation
should be homogeneous.
Kind regards,
Michael
Hello Jesper,
yes, please send the script. But I haven't much clue about silme and
compare-locales. Is it possible to get some information about them?
Kind regards
Michael
Hello Friedel,
yes, I know the Translate Toolkit, I have installed it on my machine but
I don't use it. I use a Unicode editor only to edit the dtd and
properties files. Hm, I see there are already some tools that I don't
know. May be it's because I translate inofficially.
Kind regards
Michael
Hello Axel,
Yes, a long time ago I read something about open-tran and those
licencing issues. It even contains Upper Sorbian because it covers the
Upper Sorbian translation for KDE. Because my translations are
inofficial they are not contained in open-tran. The main vocabulary
probably will be the same. I think some translations of KDE are even
based on my translations because I've been already translating since
Mozilla 0.98 to Upper Sorbian.
KInd regards,
Michael