A PO editor

Hi!
I’m building a simple PO editor in python and Bethon, as before it runs only in 32 bit Haiku…
I know that Haiku software uses catkeys but I hope it will be useful in translations for other projects.
It’s in an early stage, but can do some basic operations
here some screenshots:
screenshot0
screenshot1
screenshot2

screenshot3

19 Likes

Is it already available online somewhere?

No, it’s under development, but I think it will be available soon (one or two weeks if everything works)

3 Likes

Well, I published the code here https://github.com/tmtfx/HaiPO

It’s a bad piece of software, not optimized, slow and maybe you’ll face some bugs… This is why I consider it in alpha state
Anyhow it seems to do its job.
I’ll add some features in the near future (like handling the header of pofiles)
Notice this:

  • In github repo I placed a zipped file with gettext mimetype to place in /boot/home/config/settings/mime_db/text
  • At first run it will create a user profile which will be saved in config.ini
  • Temporary changes will be saved on a file called normalfile.temp.po
  • Load of “big” files takes some time due to double checks for multiple occurrencies (one day I’ll rewrite the source code) for example a file with 5800 entries takes more or less 7.5 seconds to load on my Intel Icelake 1.2Ghz
  • To run this application you’ll need python, Bethon (which runs only on Haiku-32bit), and polib for python which you can install with pip command

I Hope it will be usefull

Here some more screenshots:
screenshot4

screenshot7

9 Likes

Update:
An issue has been fixed and the workaround has been eliminated, i.e. now load-time of a file with 5800 entries takes 0,5 seconds on an older and slower machine (equipped with an Intel Pentium N3700 at 1.6GHz)

next time more speedups

4 Likes

screenshot1

Well, some progress…
As there’s no hunspell integration for python 2
I did it the wrong and worst way: launch hunspell as command and decode the output.
As the output of hunspell counts the position as characters and not as byte I had to analyze the string and exclude some double bytes chars (I know that’s not good) so for my language I have to analyze including characters and excluding categories of characters (will be implemented in a configuration section)…
If I find a better solution I’ll do it later. For now it works for me and maybe for other languages… didn’t try…
But at least now I have what I need for my work.
(the spellcheck works only on some calls: typing and moving the list selection with CTRL+DOWN/UP/PGUP/PGDOWN)

1 Like

What does PO stands for?

Portable Object

ok, thanks for clarification

I forgot to mention that I’ve updated Bethon integrating BTextView.FindWord function, that was not linked.

1 Like

I mainly just want to say, it made me smile, to randomly select a thread here and find that it’s about a Bethon project. With extra functions, which means someone figured out how that horrible apparatus works. Do you know why Bethon isn’t available on 64 bit? I don’t really know who’s supporting it these days - not me, for many years - and I suppose that’s likely the problem right there, but just wondering if there’s some real issue there.

Just tried to compile it on x86_64, it runs into typecasting errors where it is assumed that pointers are 32bit. These shouldn’t be too hard to fix but I don’t know if there are any other issues.

And it is still python2, right? We really need Haiku API bindings for python3 if we want to have python as a serious option for app development on Haiku.

1 Like