If I would have any knowledge about .po files I wouldn't mind having a go at it.If I understand any of it, then msgid and msgstr (if not "") should hold the same format arguments?I assume msgstr is the translation of msgid?I also assume we would check the created bla.xx.po agains bla.po?
This should not be to difficult then?What exactly do you mean by unused resourcestrings?Can you also give an example of a duplicate resourcestring?
Would we want it to be a gui or console program (with batch processing all po files?)?
If I understand any of it, then msgid and msgstr (if not "") should hold the same format arguments?I assume msgstr is the translation of msgid?
"Unused resourcestrings" means that a string is defined but not used anywhere in the project's pascal source.To find out if the string is used or not you need to scan all the source files. A simple search operation without context checking should be enough.You will always find one instance of the string which is its definition. You can make a rule:- if no instances are found -> something is wrong, should not happen.- one instance found -> unused in source.- more than one instances -> ok, used.
I don't know exactly how to use the gnugettext _() function.Do you just pass the string as a parameter for the function, and you don't need any resourcestring sections?
If there is existing open source .po parser code it can be used of course.Yet, parsing the .po file is not very difficult even with the string concatenation rules.
You are making this too big for me.
I can see myself wriitng a tool for processing po files and identifying wrong formatparameters, and duplicate resourcestringvalues (in one po file, so not across different po files, or is this "required" too?), but making it a general purpose translation checking tool is way beyond me.
B.t.w. looking for unused resourcestrings, can't we get that info from the compiler (doesn't it generate a hint), if we build lazarus?There are also probably other standard (and higly specialized) tools available for checking fast amounts of files for the occurence of a particular string?
If you want a simple tool, I think I can write one.It can have a GUI, and it can have a console front-end (which can be used for automated testing).If you want more than that, I don't think I can participate.
But seriously, often people are too shy or afraid or something with their own code. In reality they can create good code. Maybe the core developers' critical comments scare them away.
I have no experience with string-string maps, search trees and so on.So, my first job would be to think about a suitable data model: how do I store the strings/string-pairs, in a way I can search it fast.Given enough time, I'll come up with something.Where to share my initial code then?
I ended up adapting the code from Translations unit, stripping everything out that is not needed atm.Still it takes up to 2-3 seconds to load lazaruside.xx.po (the bloody thing being up to > 0.5 MB)[... skip ...]Juha: can you take a look. Is the TSimplePoFile class feasible for what we want to achieve, or should I go another way?I'ld rather hear this now, then trying to rewrite the base class of the app much later on in the process.