Sign in Join

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

Mailing lists / lazarus / 2014-06

PoChecker possible cosmetical patch

11 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Václav Valíček

Hi, I have made improvement for PoChecker package/app for lazarus. I'm sending screenshot and asking if do you think it is usefull.... If yes, I'll export patches from git... If not, I'll keep it for myself. Another thing is patch to source of PoChecker, where I'm replacing raw strings with their existing resourcestring variants - whose are untranslated as origin strings at time of declaration, so the code does not lost functions...

Attaching: screenshot, path for strings (apply with patch -p1 < 0001-blah-blah-blah.patch)

V?clav Val??ek -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140619/82c2ae6e/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: screen-2014.06.19-22.18.32.png Type: image/png Size: 28502 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140619/82c2ae6e/attachment-0001.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Replace-raw-strings-with-their-existing-resourcestri.patch Type: text/x-patch Size: 1359 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140619/82c2ae6e/attachment-0001.bin>

Reply by email

Mattias Gaertner
to Václav Valíček
Show quoted text 20 lines
+++ b/components/pochecker/pofamilies.pp @@ -23,13 +23,13 @@ const optRunAllTestsOnAllChildren: TPoTestOptions = []; PoTestOptionNames: array[TPoTestOption] of String = ( - 'Check number of items', - 'Check for incompatible format arguments', - 'Check missing identifiers', - 'Check for mismatches in untranslated strings', - 'Check for duplicate untranslated values', - 'Check percentage of (un)translated and fuzzy strings', - 'Find all translated po-files' + sCheckNumberOfItems, + sCheckForIncompatibleFormatArguments, + sCheckMissingIdentifiers, + sCheckForMismatchesInUntranslatedStrings, + sCheckForDuplicateUntranslatedValues, + sCheckStatistics, + sFindAllTranslatedPoFiles );

ok. That's reduces some redudancy. They are not translated though. You must replace the array with a function for that.

Mattias

Reply by email

Bart
to Václav Valíček: Hi, I have made improvement for PoChecker package/app for lazarus. I'm sending screenshot…
V?clav Val??ek wrote 10 lines
Hi, I have made improvement for PoChecker package/app for lazarus. I'm sending screenshot and asking if do you think it is usefull.... If yes, I'll export patches from git... If not, I'll keep it for myself. Another thing is patch to source of PoChecker, where I'm replacing raw strings with their existing resourcestring variants - whose are untranslated as origin strings at time of declaration, so the code does not lost functions... Attaching: screenshot, path for strings (apply with patch -p1 < 0001-blah-blah-blah.patch)

I cannot see the image.
Please open a bugreport and attach the screenshot and diff. I'll assign it to me (or someone else can assign it to me, in case I miss it).

Bart

Reply by email

Sven Barth
to Mattias Gaertner: On Thu, 19 Jun 2014 22:25:49 +0200 ok. That's reduces some redudancy. They are not…
"Mattias Gaertner" wrote 27 lines
On Thu, 19 Jun 2014 22:25:49 +0200 V?clav Val??ek wrote: > +++ b/components/pochecker/pofamilies.pp > @@ -23,13 +23,13 @@ const > optRunAllTestsOnAllChildren: TPoTestOptions = []; > > PoTestOptionNames: array[TPoTestOption] of String = ( > - 'Check number of items', > - 'Check for incompatible format arguments', > - 'Check missing identifiers', > - 'Check for mismatches in untranslated strings', > - 'Check for duplicate untranslated values', > - 'Check percentage of (un)translated and fuzzy strings', > - 'Find all translated po-files' > + sCheckNumberOfItems, > + sCheckForIncompatibleFormatArguments, > + sCheckMissingIdentifiers, > + sCheckForMismatchesInUntranslatedStrings, > + sCheckForDuplicateUntranslatedValues, > + sCheckStatistics, > + sFindAllTranslatedPoFiles > ); ok. That's reduces some redudancy. They are not translated though. You must replace the array with a function for that.

There was a bug report some time ago that Delphi *does* indeed translate such strings. AFAIK that was fixed, but I'll need to check that and in which version.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140620/a00f4092/attachment.html>

Reply by email

Václav Valíček
to Bart: I cannot see the image. Please open a bugreport and attach the screenshot and diff. I'll…

I'll make bug report next day, I'm going to mow meadows and there is not much of time for bug report today....

V?clav Val??ek

Dne 19.6.2014 23:39, Bart napsal(a):

Show quoted text 23 lines
On 6/19/14, V?clav Val??ek wrote: > Hi, I have made improvement for PoChecker package/app for lazarus. I'm > sending screenshot and asking if do you think it is usefull.... If yes, > I'll export patches from git... If not, I'll keep it for myself. Another > thing is patch to source of PoChecker, where I'm replacing raw strings > with their existing resourcestring variants - whose are untranslated as > origin strings at time of declaration, so the code does not lost > functions... > > Attaching: screenshot, path for strings (apply with patch -p1 < > 0001-blah-blah-blah.patch) I cannot see the image. Please open a bugreport and attach the screenshot and diff. I'll assign it to me (or someone else can assign it to me, in case I miss it). Bart -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: screen-2014.06.19-22.18.32.png
Type: image/png
Size: 28502 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140620/6e62ba61/attachment-0001.png>

Reply by email

Václav Valíček
to Bart: I cannot see the image. Please open a bugreport and attach the screenshot and diff. I'll…

I have opened bug no. #26395

Link: http://bugs.freepascal.org/view.php?id=26395

V?clav Val??ek

Dne 19.6.2014 23:39, Bart napsal(a):

Show quoted text 23 lines
On 6/19/14, V?clav Val??ek wrote: > Hi, I have made improvement for PoChecker package/app for lazarus. I'm > sending screenshot and asking if do you think it is usefull.... If yes, > I'll export patches from git... If not, I'll keep it for myself. Another > thing is patch to source of PoChecker, where I'm replacing raw strings > with their existing resourcestring variants - whose are untranslated as > origin strings at time of declaration, so the code does not lost > functions... > > Attaching: screenshot, path for strings (apply with patch -p1 < > 0001-blah-blah-blah.patch) I cannot see the image. Please open a bugreport and attach the screenshot and diff. I'll assign it to me (or someone else can assign it to me, in case I miss it). Bart -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Marco van de Voort
to Sven Barth: There was a bug report some time ago that Delphi *does* indeed translate such strings.…
Sven Barth wrote 13 lines
> > + sCheckMissingIdentifiers, > > + sCheckForMismatchesInUntranslatedStrings, > > + sCheckForDuplicateUntranslatedValues, > > + sCheckStatistics, > > + sFindAllTranslatedPoFiles > > ); > > ok. That's reduces some redudancy. They are not translated though. You > must replace the array with a function for that. There was a bug report some time ago that Delphi *does* indeed translate such strings. AFAIK that was fixed, but I'll need to check that and in which version.

I can confirm that D2009+ translates resourcestrings in aggregate CONST structures using its own (ITE, resource DLL) translation systems. I ran into this when I switched to dxgettext, and I had to add this manually.

I've no experience with translations in pre D2009. (one of the reasons to upgrade our D7 was that we needed to start with translation, with non Latin scripts a possibility oto)

Reply by email

Václav Valíček
to Marco van de Voort

I prefer using dxGetText in my projects, but if Lazarus uses resourcestrings, I must use resourcestrings when translating components. I have experience with delphi 2010 translations (probbably same as D2009) - and I wasn't very happy that I had to attach special translation files, I wanted something text based. I started using dxGetText... There is no problem for me if Lazarus does not translate consts arrays during startup.

V?clav Val??ek

Dne 27.6.2014 11:07, Marco van de Voort napsal(a):

Show quoted text 25 lines
On Fri, Jun 20, 2014 at 06:52:53AM +0200, Sven Barth wrote: >>> + sCheckMissingIdentifiers, >>> + sCheckForMismatchesInUntranslatedStrings, >>> + sCheckForDuplicateUntranslatedValues, >>> + sCheckStatistics, >>> + sFindAllTranslatedPoFiles >>> ); >> ok. That's reduces some redudancy. They are not translated though. You >> must replace the array with a function for that. > There was a bug report some time ago that Delphi *does* indeed translate > such strings. AFAIK that was fixed, but I'll need to check that and in > which version. I can confirm that D2009+ translates resourcestrings in aggregate CONST structures using its own (ITE, resource DLL) translation systems. I ran into this when I switched to dxgettext, and I had to add this manually. I've no experience with translations in pre D2009. (one of the reasons to upgrade our D7 was that we needed to start with translation, with non Latin scripts a possibility oto) -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mattias Gaertner
to Václav Valíček
Show quoted text 7 lines
I prefer using dxGetText in my projects, but if Lazarus uses resourcestrings, I must use resourcestrings when translating components. I have experience with delphi 2010 translations (probbably same as D2009) - and I wasn't very happy that I had to attach special translation files, I wanted something text based. I started using dxGetText... There is no problem for me if Lazarus does not translate consts arrays during startup.

po files are text based.
There is a binary format: mo files, which saves some bytes. But those few KB do not matter nowadays.
Of course you can use other ways to load your resourcestrings. You don't need to use po files.

Mattias

Reply by email

Václav Valíček
to Mattias Gaertner

I probbably wrote something in missunderstanding way... I prefer dxGetText against resorcestrings, becose ShowMessage(_'Text to translate')); is better for me than creating resourcestrings (because of future editing). But I have choosen it during my delphi era, because it is good to for translating comunity software - no need to edit sources, compile dll or lng files... Just editing po files by other users.

There is no difference for me as for raw translator. But when I want to tweak something, edit some message, I have to find resourcestring (easy, one click), find if is used on more or one place and then just edit or create new one... Or edit all other occurences. While using gettext as known from GNU Project apps, I just change strings in code and then regenerate .po files. If I have to use formatted messages with Format(), I can use __('str %s') instead of _().

I'm not complaining about anything in IDE, just pointing at advantages of gettext and giving reasons why I use it.

V?clav Val??ek

Dne 27.6.2014 15:15, Mattias Gaertner napsal(a):

Show quoted text 23 lines
On Fri, 27 Jun 2014 13:09:06 +0200 V?clav Val??ek wrote: > I prefer using dxGetText in my projects, but if Lazarus uses > resourcestrings, I must use resourcestrings when translating components. > I have experience with delphi 2010 translations (probbably same as > D2009) - and I wasn't very happy that I had to attach special > translation files, I wanted something text based. I started using > dxGetText... There is no problem for me if Lazarus does not translate > consts arrays during startup. po files are text based. There is a binary format: mo files, which saves some bytes. But those few KB do not matter nowadays. Of course you can use other ways to load your resourcestrings. You don't need to use po files. Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email