View Issue Details

IDProjectCategoryView StatusLast Update
0026360LazarusIDEpublic2014-09-19 09:32
ReporterPéter Gábor Assigned ToBart Broersma  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.3 (SVN) 
Summary0026360: Typo(?) in lazaruside.po
DescriptionPoChecker reports the following errors on translations:

[Line: 8729] Incompatible and/or invalid format() arguments for:
#: lazarusidestrconsts.lishideallhintsandwarningsbyinsertingidedirectivesh
msgid "Hide all hints and warnings by inserting IDE directives {%H-}" (= Original)
msgstr "Minden tipp és figyelmeztetés elrejtése IDE direktívák beszúrásával {%H-}" (= Translation)

[Line: 8733] Incompatible and/or invalid format() arguments for:
#: lazarusidestrconsts.lishidemessageatbyinsertingidedirectiveh
msgid "Hide message at %s by inserting IDE directive {%H-}" (= Original)
msgstr "Üzenet elrejtése (itt: %s) IDE direktíva beszúrásával {%H-}" (= Translation)

[Line: 8737] Incompatible and/or invalid format() arguments for:
#: lazarusidestrconsts.lishidemessagebyinsertingidedirectiveh
msgid "Hide message by inserting IDE directive {%H-}" (= Original)
msgstr "Üzenet elrejtése IDE direktíva beszúrásával {%H-}" (= Translation)

The mistake seems to be in the ResourceStrings: a bad formatting symbol %H
TagsNo tags attached.
Fixed in Revisionr45612
LazTarget-
Widgetset
Attached Files

Activities

Bart Broersma

2014-06-18 23:41

developer   ~0075789

I rather think this is an error in PoChecker tool.

Péter Gábor

2014-06-19 06:44

reporter   ~0075790

POChecker correctly assumes that %H should be a formatting symbol, because Format() requires %% where you want to write a single %.
See: http://www.freepascal.org/docs-html/rtl/sysutils/format.html

Bart Broersma

2014-06-19 18:21

developer   ~0075795

The problem of course being that NOT all resource string containing % are strigs used in with format().
%h is not a supported argtype for format(), so it _may_ be safe to assume that a string containing %h (and not %%h) is not intended to be used with fomat function.

Péter Gábor

2014-06-19 18:40

reporter   ~0075798

Last edited: 2014-06-19 18:41

View 2 revisions

Formatting symbols used by Format() seems that it try to be C Format compatible as much as it can.
A single % must be reserved for formatting symbols because when a new formatting symbol (eg. %h for any reason) will be implemented the %H in strings will be misunderstood.
As I see %H %G %K and others must be treated as formatting symbols as long as they are not preceded by another %: %%H %%G %%K
This is the same for %S %D and so on...

Bart Broersma

2014-06-19 20:32

developer   ~0075804

You misunderstand me (I think): the basic problems is that PoChecker expects that all strings conataining a % are intended to be used with format.
And obviously this is wrong.
And I don't see an easy method to decide wether a given string is intended to be used with format (by just studying the po-file).
Maybe for the time being I should just check for {%h}...

Péter Gábor

2014-06-19 20:45

reporter   ~0075805

I think POChecker works right if it expects that all strings will be passed to format() because POChecker cannot know which is for format.
If a string is not used with format today may be tomorrow...
.. and if a new format parameter is implemented POChecker keeps working right with them.

Bart Broersma

2014-06-22 12:41

developer   ~0075840

B.t.w. I could not find a string like "Hide all hints and warnings by inserting IDE directives {%H-}" in the given PO file.
Please test and close if OK.

Péter Gábor

2014-06-22 20:59

reporter   ~0075850

I have rev.45619 from http://svn.freepascal.org/svn/lazarus/trunk.
The above strings are there in lazaruside.po at the lines: 8731, 8735, 8739

After recompiling (the IDE with Packages) POChecker did not report error on %H

Issue History

Date Modified Username Field Change
2014-06-18 20:32 Péter Gábor New Issue
2014-06-18 23:40 Bart Broersma Assigned To => Bart Broersma
2014-06-18 23:40 Bart Broersma Status new => assigned
2014-06-18 23:41 Bart Broersma Note Added: 0075789
2014-06-19 06:44 Péter Gábor Note Added: 0075790
2014-06-19 18:21 Bart Broersma Note Added: 0075795
2014-06-19 18:40 Péter Gábor Note Added: 0075798
2014-06-19 18:41 Péter Gábor Note Edited: 0075798 View Revisions
2014-06-19 20:32 Bart Broersma Note Added: 0075804
2014-06-19 20:45 Péter Gábor Note Added: 0075805
2014-06-22 12:41 Bart Broersma Fixed in Revision => r45612
2014-06-22 12:41 Bart Broersma LazTarget => -
2014-06-22 12:41 Bart Broersma Note Added: 0075840
2014-06-22 12:41 Bart Broersma Status assigned => resolved
2014-06-22 12:41 Bart Broersma Resolution open => fixed
2014-06-22 20:59 Péter Gábor Note Added: 0075850
2014-09-19 09:32 Péter Gábor Status resolved => closed