Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-10

PoHelper: a tool to assist translators

12 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Giuliano Colla

Whoever is interested, may download from:

http://www.bononiadocta.it/Lazarus/pohelper.zip

the version 0.1 of PoHelper, a tool I've developed to help me in translation maintenance.

I've put there the features I felt necessary for routine translation work, which were not avialable elsewhere.

It provides:

A quick verification of the state of all translations (Translated, Untranslated, Fuzzy and format argument errors). Items with format argument errors are marked as Fuzzy.

A graphical representation of all the translations requiring maintenance, for a given language, in a given directory tree.

Missing translations are represented with a yellow full pie, others are represented with a pie partitioned for translated/untranslated/fuzzy entries and a question mark for format argument errors (the same as PoChecker new graphical display, available in trunk). Optionally all translations can be seen (including those 100% translated), or missing translations can be hidden.

Opening a translation (by clicking on it) with a choice of two configurable external editors (left-click/right-click). I use both Virtaal and Poedit, depending on needs, so I made it that way.

Creating a new empty translation from template, for missing translations, and then opening it in the selected editor.

Performing a clean-up of translations, by removing PreviousId from non-Fuzzy items, and then saving all the translations which have been somehow modified in the session (added/removed Fuzzy flags, removed PreviousId, etc).

A few more things to come.

It should be complementary to PoChecker as it doesn't provide all the statistics and more exhaustive tests of PoChecker, but does provide utilities which are outside the scope of PoChecker.

The human interface should be self-explaining. If not, just ask.

If found useful, it could be added to Lazarus Tools, or to Lazarus Components (it could be integrated in the IDE). If not, I'll just keep it for myself.

I'll be thankful to whoever will test it and report bugs, suggest improvements, or asks for useful features.

Giuliano

Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet?

Reply by email

Maxim Ganetsky
to Giuliano Colla

13.10.2014 16:31, Giuliano Colla ?????:

Show quoted text 11 lines
Whoever is interested, may download from: http://www.bononiadocta.it/Lazarus/pohelper.zip the version 0.1 of PoHelper, a tool I've developed to help me in translation maintenance. I've put there the features I felt necessary for routine translation work, which were not avialable elsewhere. It provides:

[...]

Show quoted text 11 lines
Opening a translation (by clicking on it) with a choice of two configurable external editors (left-click/right-click). I use both Virtaal and Poedit, depending on needs, so I made it that way. Creating a new empty translation from template, for missing translations, and then opening it in the selected editor. Performing a clean-up of translations, by removing PreviousId from non-Fuzzy items, and then saving all the translations which have been somehow modified in the session (added/removed Fuzzy flags, removed PreviousId, etc).

Cleanup functions break e.g. lazaruside.ru.po. It looks corrupted in PoEdit. I didn't have time to investigate further.

IMO all this should be integrated into PoChecker.

Best regards, Maxim Ganetsky mailto:

Reply by email

Giuliano Colla
to Maxim Ganetsky

Il 14/10/2014 00:39, Maxim Ganetsky ha scritto:

Cleanup functions break e.g. lazaruside.ru.po. It looks corrupted in PoEdit. I didn't have time to investigate further.

Yes, you're right. I've been too bold. There are two issues which didn't come out in my simpler tests: multiline strings aren't properly rewritten, and / are doubled. I'll need some time to understand why and fix. I merged Translation unit with Bart's SimplePoFiles, and it would appear that I didn't adjust all the incompatibilities.

IMO all this should be integrated into PoChecker.

The final goal would be to have those function added to the LCL Translations unit. Then it'll be up to Bart to decide if he wants to take advantage of them or not.

Giuliano

Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet?

Reply by email

Giuliano Colla
to Giuliano Colla: Il 14/10/2014 00:39, Maxim Ganetsky ha scritto: Yes, you're right. I've been too bold.…

Il 14/10/2014 11:01, Giuliano Colla ha scritto:

Show quoted text 6 lines
Il 14/10/2014 00:39, Maxim Ganetsky ha scritto: > Cleanup functions break e.g. lazaruside.ru.po. It looks corrupted in > PoEdit. I didn't have time to investigate further. >

Fixed. Now CleanUp removes around 900 stale PreviousId from lazaruside.ru.po, without corrupting it.

Please test.

Giuliano

Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet?

Reply by email

Maxim Ganetsky
to Giuliano Colla

14.10.2014 21:50, Giuliano Colla ?????:

Show quoted text 13 lines
Il 14/10/2014 11:01, Giuliano Colla ha scritto: > > Il 14/10/2014 00:39, Maxim Ganetsky ha scritto: >> Cleanup functions break e.g. lazaruside.ru.po. It looks corrupted in >> PoEdit. I didn't have time to investigate further. >> > Fixed. Now CleanUp removes around 900 stale PreviousId from lazaruside.ru.po, without corrupting it. Please test.

Where to get it?

Best regards, Maxim Ganetsky mailto:

Reply by email

Giuliano Colla
to Maxim Ganetsky

Il 14/10/2014 23:31, Maxim Ganetsky ha scritto:

Show quoted text 17 lines
14.10.2014 21:50, Giuliano Colla ?????: > > Il 14/10/2014 11:01, Giuliano Colla ha scritto: >> >> Il 14/10/2014 00:39, Maxim Ganetsky ha scritto: >>> Cleanup functions break e.g. lazaruside.ru.po. It looks corrupted in >>> PoEdit. I didn't have time to investigate further. >>> >> > > Fixed. Now CleanUp removes around 900 stale PreviousId from > lazaruside.ru.po, without corrupting it. > > Please test. Where to get it?

You're right, I forgot to say. Same place. i.e.:

http://www.bononiadocta.it/Lazarus/pohelper.zip

Giuliano

Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet?

Reply by email

Péter Gábor
to Giuliano Colla

Hi!

Here is the Hungarian translation for pohelper!
However I did not test pohelper yet... :)

2014-10-14 23:45 keltez?ssel, Giuliano Colla ?rta:

Show quoted text 26 lines
Il 14/10/2014 23:31, Maxim Ganetsky ha scritto: > 14.10.2014 21:50, Giuliano Colla ?????: >> >> Il 14/10/2014 11:01, Giuliano Colla ha scritto: >>> >>> Il 14/10/2014 00:39, Maxim Ganetsky ha scritto: >>>> Cleanup functions break e.g. lazaruside.ru.po. It looks corrupted in >>>> PoEdit. I didn't have time to investigate further. >>>> >>> >> >> Fixed. Now CleanUp removes around 900 stale PreviousId from >> lazaruside.ru.po, without corrupting it. >> >> Please test. > > Where to get it? > You're right, I forgot to say. Same place. i.e.: http://www.bononiadocta.it/Lazarus/pohelper.zip Giuliano
P?ter G?bor -------------- next part -------------- A non-text attachment was scrubbed... Name: pohelper.hu.po Type: text/x-gettext-translation Size: 3476 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141015/7e3d58c1/attachment.bin>

Reply by email

Giuliano Colla
to Péter Gábor

Il 15/10/2014 11:05, P?ter G?bor ha scritto:

Hi! Here is the Hungarian translation for pohelper! However I did not test pohelper yet... :)

Thanks a lot.
Let me know if you find some bugs, or would like to add/change some features.

Giuliano

Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet?

Reply by email

Péter Gábor
to Giuliano Colla

Hi!

Tips (mostly for the GUI):

- Setting up an external editor would be better to define the command line instead of a simple FileOpen form (or combined). In my case poedit is on the path (so it can run without path name) and someone may need to pass parameters too.
- List of files (TMemo) is not read-only
- Too long lines are wrapped and looks confusing
- TListBox would be better (instead of TMemo)
- Anchors not optimized for window resizing
- Missing (for me) descriptive hints for buttons
- Two strings in pohelpermain are not translatable (required changes and the updated 'hu' translation attached):
'Nothing to do',
aPofile.PoName+' saved' ==convert=to=resource=as==> '%s saved'

2014-10-15 11:12 keltez?ssel, Giuliano Colla ?rta:

Let me know if you find some bugs, or would like to add/change some features.
P?ter G?bor -------------- next part -------------- A non-text attachment was scrubbed... Name: pohelperstrconsts.diff Type: text/x-patch Size: 76 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141025/d1d83160/attachment.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: pohelpermain.diff Type: text/x-patch Size: 354 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141025/d1d83160/attachment-0001.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: pohelper.hu.po Type: text/x-gettext-translation Size: 3624 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141025/d1d83160/attachment-0002.bin>

Reply by email

Giuliano Colla
to Péter Gábor

Thank you for the feedback.

I've put it temporarily in hold, because in the meantime I have begun elaborating a more complete solution: a po "swiss army knife", i.e. to put together in a single package a collection of tools for po files handling.

It should include PoChecker, of course, then a PoHelper and also a minimal PoEditor.

They should all share the basic environment and configuration, so that the choices made on PoHelper would be "remembered" by PoChecker, etc.

The reason for a PoEditor is not to reinvent the wheel, but to provide some extra facilities not available to my knowledge in current editors:

* a "global find", to verify the consistency of translations in the same file or across multiple files
* a "global replace" to adjust the consistency, if required,
* the capability of displaying and editing the header: currently available editor provide it in a limited way, and with different capabilities.
* the capability to handle comments and "extracted-comments" ( https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html )

Again suggestions and critics are welcome.

Giuliano

Il 25/10/2014 15:15, P?ter G?bor ha scritto:

Show quoted text 29 lines
Hi! Tips (mostly for the GUI): - Setting up an external editor would be better to define the command line instead of a simple FileOpen form (or combined). In my case poedit is on the path (so it can run without path name) and someone may need to pass parameters too. - List of files (TMemo) is not read-only - Too long lines are wrapped and looks confusing - TListBox would be better (instead of TMemo) - Anchors not optimized for window resizing - Missing (for me) descriptive hints for buttons - Two strings in pohelpermain are not translatable (required changes and the updated 'hu' translation attached): 'Nothing to do', aPofile.PoName+' saved' ==convert=to=resource=as==> '%s saved' 2014-10-15 11:12 keltez?ssel, Giuliano Colla ?rta: > Let me know if you find some bugs, or would like to add/change some > features. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20141102/8f4a7e2f/attachment.html>

Reply by email