Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/9/14, Maxim Ganetsky gan...@narod.ru wrote: 2. PoChecker always complains about .po files from debian\po Lazarus subdirectory. Complains = ? See attached screenshot. Apparently it erroneously treats these files as master ones. Fixed (rather in a crude way) in r46533. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/9/14, Péter Gábor p...@freemail.hu wrote: - Showing the results as Graphic summary may take a very long time depending on the number of files, so the dialog may show a Please wait... and/or a counting from 0..NumberOfFiles to indicate that it's not frozen. I think it can be: I was waiting for the results (graphics) to show up for more than seven(!) minutes but nothing happened then killed the IDE manually. Maybe the problem is the image's size. Please test with r46535. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
POChecker (r46530) combines the file names of translated PO-s wrong. The language ID strings are taken from GUI's language list: lazaruside.Hungarian [hu].po ... 2014-10-10 23:30 keltezéssel, Bart írta: On 10/9/14, Péter Gábor p...@freemail.hu wrote: - Saving the last used language would be very handy Done in r46511. It took some silly statement in the Langfilter's OnChange event to make it work though (see the comments). bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- Péter Gábor p...@freemail.hu -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Some more issues: - Do not pop up summary automatically, because most users need to see it only if there are errors/warnings and such or when he/she want to see the percentage of translated/fuzzy strings - Allow open graphic and text summary (each without the other) from the main form of POChecker after running the tests - Currently opening a .po file via graphic summary closes text and graphic summary and a new run of tests required to open another .po file -- Péter Gábor p...@freemail.hu -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/11/14, Péter Gábor p...@freemail.hu wrote: - Do not pop up summary automatically, because most users need to see it only if there are errors/warnings and such or when he/she want to see the percentage of translated/fuzzy strings Yet another option, needs yet another GUI something to control it. Don't think I'm gonna implement that, but maybe I'll change my mind one of these day. You'r always wellcome to supply a patch (preferrably in bugtracker). - Allow open graphic and text summary (each without the other) from the main form of POChecker after running the tests No, won't do that. - Currently opening a .po file via graphic summary closes text and graphic summary and a new run of tests required to open another .po file This closing was designed so that the IDE does clutter with (modal) forms. The stand-alone version does not suffer from this. You can supply an editor via the --editor=someprogram commandline option. Maybe the dialog before opening in Lazarus IDE can be modified so you can choose to either open file+close window, open file+keep window, or cancel? (Probably using QuestionDialog with some custom buttons?) Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/11/14, Péter Gábor p...@freemail.hu wrote: POChecker (r46530) combines the file names of translated PO-s wrong. The language ID strings are taken from GUI's language list: lazaruside.Hungarian [hu].po Oops, fixed in r46531. Sorry. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/20/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Il 19/09/2014 22:30, Bart ha scritto: I refactored the GraphStat form using a TListView and a TImageList. See r46256. This is a test message. Somehow the last replies (t Peter) in this thread do not show up in my mail client (I use Gmail for the list), but I can see them in the archive. @Giuliano Colla: can you (and please not everybody) acknowledge this mail by replying? Please also CC to bartjunk64 at gmail dot com, so I can see that you replied 9in case it does not turn up in this thread in my GMail). Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 12/10/2014 00:27, Bart ha scritto: On 9/20/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Il 19/09/2014 22:30, Bart ha scritto: I refactored the GraphStat form using a TListView and a TImageList. See r46256. This is a test message. Somehow the last replies (t Peter) in this thread do not show up in my mail client (I use Gmail for the list), but I can see them in the archive. @Giuliano Colla: can you (and please not everybody) acknowledge this mail by replying? Please also CC to bartjunk64 at gmail dot com, so I can see that you replied 9in case it does not turn up in this thread in my GMail). Yes. I got it. Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 10/10/2014 04:50, Jesus Reyes ha scritto: If I understand correctly, the error here is that some tools cannot easily edit .po files and instead want .pot files? or what? No, the error is that a .po file is just a translation, while a master template file, i.e. a file containing only original messages and no translations should have .pot extension. e.g. lazaruside.pot should be the master template file for lazarus IDE, and lazaruside.pt_BR.po the translation file for Brazilian Portuguese. But we have instead lazaruside.po as a template file, i.e. with the same extensions as that of a normal translation. The master template is generated (by the Translations unit) from the resource files. Then existing translations are updated accordingly. Tools like PoChecker must easily locate the master template, to update or check translations against it. Editing tools accept a .pot file as a starting point to generate the first copy of your localized versions (for a new translation). Except that case, humans only deal with translations (.po files), while programs deal both with templates and with translations (.pot and .po files). A different extension (as suggestet by gettext) is the easiest way to tell them apart. If the concern is that we don't follow what gettext docs say, should we be worried also that we don't use .mo files? I wouldn't give a damn on what gettext says either, if it weren't that by not following its rule we generate troubles: 1) we have template files and translation files (which are two different beasts) with the same extension, and programs must figure out, by other means, which one is which. It's much easier and cleaner to tell them apart by a different extension. Moreover, sometimes the figuring out fails, as in the case of the files on the debian/po directory, where translation files are mistaken for templates. 2) We cannot use the translation tools as they should be used, to generate a new translation. We must manually create a first translation file by copying the template to a renamed file, and then editing it, thus loosing part of the header that the translation tools generate when they realize that they are generating a new translation. If I remember correctly, one of the reasons (but not the only) to use .po files directly (without .mo conversion) was because any text editor could be used to edit them, but text editors usually don't mind what extension a text file has (even, it could be argued if .txt extension should be used, but not please :)). .po and .mo are a different matter. A .mo is just a .po compiled, a binary version of the source. If it's more pactical to use the source, instead of the binary (and I agree that it is), that's a choice which doesn't create any confusion. We have files with an extension which tells exactly what they are: source translation files. We don't need binaries, and this means that we don't need to compile anything to modify a translation. Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On Fri, 10 Oct 2014 10:04:26 +0200 Giuliano Colla giuliano.co...@fastwebnet.it wrote: [...] Editing tools accept a .pot file as a starting point to generate the first copy of your localized versions (for a new translation). A valid point. Although I'm not sure why the generated header matters here. An important point are the new units with dots in their name. The IDE could check if unitname.po exists. If it does: update that for compatibility. If it it does not: update/generate a pot file. Would that help? I wouldn't give a damn on what gettext says either, if it weren't that by not following its rule we generate troubles: 1) we have template files and translation files (which are two different beasts) with the same extension, and programs must figure out, by other means, which one is which. It's much easier and cleaner to tell them apart by a different extension. Moreover, sometimes the figuring out fails, as in the case of the files on the debian/po directory, where translation files are mistaken for templates. In this case the template is called 'templates.pot' and the translations '??.po' instead of 'templates.??.po'. So this seems to be a special case. And note that these strings are not from a Pascal unit and are not used in an LCL application. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/10/14, Mattias Gaertner nc-gaert...@netcologne.de wrote: The IDE could check if unitname.po exists. If it does: update that for compatibility. If it it does not: update/generate a pot file. Would that help? We could also decide to switch to .pot in all cases. It'll temporariliy break stuff (like po-checker tool), but in the long run it's better to maintain. In this case the template is called 'templates.pot' and the translations '??.po' instead of 'templates.??.po'. So this seems to be a special case. And note that these strings are not from a Pascal unit and are not used in an LCL application. For po-checker, I think I will use the suggestion to treat any po-file as invalid if the filename is (langID).po. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On Fri, 10 Oct 2014 12:15:27 +0200 Bart bartjun...@gmail.com wrote: On 10/10/14, Mattias Gaertner nc-gaert...@netcologne.de wrote: The IDE could check if unitname.po exists. If it does: update that for compatibility. If it it does not: update/generate a pot file. Would that help? We could also decide to switch to .pot in all cases. It'll temporariliy break stuff (like po-checker tool), but in the long run it's better to maintain. Pochecker can break compatibility and support only pot files. The IDE should give people time to migrate. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 10/10/2014 11:01, Mattias Gaertner ha scritto: On Fri, 10 Oct 2014 10:04:26 +0200 Giuliano Colla giuliano.co...@fastwebnet.it wrote: [...] Editing tools accept a .pot file as a starting point to generate the first copy of your localized versions (for a new translation). A valid point. Although I'm not sure why the generated header matters here. It contains information which currently is irrelevant for Translations unit, but which can be useful to editing programs, or just to a new translator picking up a previous translation. From a quick browsing, it would appear that Translations unit currently doesn't supports multiple plural forms existing in some languages (e.g. singular, dual, and plural form, for n=1, n=2, n= 0 or n2 respectively. See: http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html ), but should it do it one day, the information of how many plural forms are used in that language, and the rule for picking up the righe one is one of the things found on the header generated by translation tools. But, as far as translators are concerned, the main point is that the process is much easier for a not-too-much IT literated translator. He doesn't need to locate a template file, which at first glance is identical to other translation files, and copy it renamed to his/her locale. With .pot extension, most translation tools take care of that automatically, given the translator language (header info again) An important point are the new units with dots in their name. I agree with you. It's difficult to be sure that the heuristics based on filename structure, currently used to detect a template file, won't fail with filenames more complex than a basic unitname.po / unitname.lang.po The IDE could check if unitname.po exists. If it does: update that for compatibility. If it it does not: update/generate a pot file. Would that help? I'd be in favor of a smooth transition versus .pot only templates. IDE could search for unitname.pot first. If not found search for unitname.po, and, if found, rename it to unitname.pot, thus deleting unitname.po (I don't see any reason to keep it). Then proceed as usual. I'd say that only a small portion of TMainIde.UpdateProjectPoFile in main.pp is involved, but you know better than me. After a grace period, support for unitname.po templates could be dropped completely (Lazarus 2.0 or maybe Lazarus 3.0) This would be completely transparent to translation maintainers, which deal only with their .po files, and would involve a minor adjustment to PoChecker. I wouldn't give a damn on what gettext says either, if it weren't that by not following its rule we generate troubles: 1) we have template files and translation files (which are two different beasts) with the same extension, and programs must figure out, by other means, which one is which. It's much easier and cleaner to tell them apart by a different extension. Moreover, sometimes the figuring out fails, as in the case of the files on the debian/po directory, where translation files are mistaken for templates. In this case the template is called 'templates.pot' and the translations '??.po' instead of 'templates.??.po'. So this seems to be a special case. And note that these strings are not from a Pascal unit and are not used in an LCL application. They've only been an incident, showing that an heuristic approach, based on file name structure, is less reliable than a dedicated extension. They could be treated as a special case, when looking for templates and translation files in the Lazarus tree, but as there's a cleaner and more general solution, why not take the occasion of this incident to adopt it? Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 10/10/2014 13:18, Mattias Gaertner ha scritto: On Fri, 10 Oct 2014 12:15:27 +0200 Bart bartjun...@gmail.com wrote: On 10/10/14, Mattias Gaertner nc-gaert...@netcologne.de wrote: The IDE could check if unitname.po exists. If it does: update that for compatibility. If it it does not: update/generate a pot file. Would that help? We could also decide to switch to .pot in all cases. It'll temporariliy break stuff (like po-checker tool), but in the long run it's better to maintain. Pochecker can break compatibility and support only pot files. The IDE should give people time to migrate. What else is using the template file, except the IDE itself? Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/10/14, Mattias Gaertner nc-gaert...@netcologne.de wrote: Pochecker can break compatibility and support only pot files. The IDE should give people time to migrate. This is not what I meant. Po-checker will follow what Lazarus does. It was written for the translations for use with Lazarus. I don't really care about use outside our project, the tool is meant for us. (For po-checker it will be not that hard to support .pot instead of, or alongside .po) What other migration issues are there? The end user does not use or need the template (master) file. We just (...) need to adjust all Lazarus tools that read from or write to the master (template) file. All this in trunk of course. What am I missing here? Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 10/10/2014 14:59, Bart ha scritto: On 10/10/14, Mattias Gaertner nc-gaert...@netcologne.de wrote: Pochecker can break compatibility and support only pot files. The IDE should give people time to migrate. This is not what I meant. Po-checker will follow what Lazarus does. It was written for the translations for use with Lazarus. I don't really care about use outside our project, the tool is meant for us. (For po-checker it will be not that hard to support .pot instead of, or alongside .po) What other migration issues are there? The end user does not use or need the template (master) file. We just (...) need to adjust all Lazarus tools that read from or write to the master (template) file. All this in trunk of course. What am I missing here? +1 Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/9/14, Maxim Ganetsky gan...@narod.ru wrote: 1. List of removed non-existent files can be quite big, so probably should be contained in Memo or something. 3. Message There are no files left to check. is displayd directly after message about non-existent files. It will be good to combine them. Done in r46508. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/9/14, Péter Gábor p...@freemail.hu wrote: - Saving the last used language would be very handy Done in r46511. It took some silly statement in the Langfilter's OnChange event to make it work though (see the comments). bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
2014-10-09 00:58 keltezéssel, Maxim Ganetsky írta: Works great, thank you very much. I agree! 2. PoChecker always complains about .po files from debian\po Lazarus subdirectory. (Some buttons still need AutSize := True, will do that some other time) Please consider using toolbars. ... and again: I agree. Some issues: - Saving the last used language would be very handy - Not all selected files are marked as selected after restarting the IDE if the selected items are in two or more section. - Showing the results as Graphic summary may take a very long time depending on the number of files, so the dialog may show a Please wait... and/or a counting from 0..NumberOfFiles to indicate that it's not frozen. I think it can be: I was waiting for the results (graphics) to show up for more than seven(!) minutes but nothing happened then killed the IDE manually. Maybe the problem is the image's size. Thanks for your work! -- Péter Gábor p...@freemail.hu -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/9/14, Maxim Ganetsky gan...@narod.ru wrote: Works great, thank you very much. Good to hear. 1. List of removed non-existent files can be quite big, so probably should be contained in Memo or something. Good Idea. 2. PoChecker always complains about .po files from debian\po Lazarus subdirectory. Complains = ? 3. Message There are no files left to check. is displayd directly after message about non-existent files. It will be good to combine them. Yes, agreed. (Some buttons still need AutSize := True, will do that some other time) Please consider using toolbars. I will look into that. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/9/14, Péter Gábor p...@freemail.hu wrote: Some issues: - Saving the last used language would be very handy Yes, I will implement that. - Not all selected files are marked as selected after restarting the IDE if the selected items are in two or more section. For me that works... - Showing the results as Graphic summary may take a very long time depending on the number of files, so the dialog may show a Please wait... and/or a counting from 0..NumberOfFiles to indicate that it's not frozen. I think it can be: I was waiting for the results (graphics) to show up for more than seven(!) minutes but nothing happened then killed the IDE manually. Maybe the problem is the image's size. I never dared to test that much files in one go. I'll put in on my ToDo list, but may take some time. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
2014-10-09 15:05 keltezéssel, Bart írta: On 10/9/14, Péter Gábor p...@freemail.hu wrote: - Not all selected files are marked as selected after restarting the IDE if the selected items are in two or more section. For me that works... Now for me too. However I'm the only thing that changed... :) -- Péter Gábor p...@freemail.hu -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
09.10.2014 17:03, Bart пишет: On 10/9/14, Maxim Ganetsky gan...@narod.ru wrote: 2. PoChecker always complains about .po files from debian\po Lazarus subdirectory. Complains = ? See attached screenshot. Apparently it erroneously treats these files as master ones. -- Best regards, Maxim Ganetsky mailto:gan...@narod.ru -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/9/14, Péter Gábor p...@freemail.hu wrote: For me that works... Now for me too. However I'm the only thing that changed... :) Revision 46482 maybe? Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/9/14, Maxim Ganetsky gan...@narod.ru wrote: See attached screenshot. Apparently it erroneously treats these files as master ones. Well I was under the impression that a child always - is in the same dir as the master - has it's name constructed by master + dot + lang + dot + po I think templates.pot is the masterfile? How can I even know that? Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 09/10/2014 22:49, Bart ha scritto: On 10/9/14, Maxim Ganetsky gan...@narod.ru wrote: See attached screenshot. Apparently it erroneously treats these files as master ones. Well I was under the impression that a child always - is in the same dir as the master - has it's name constructed by master + dot + lang + dot + po I think templates.pot is the masterfile? How can I even know that? There are two historical errors which in that case sum up to a messy situation: 1) a master file (template) according gettext specs should have a .pot extension, not to be mistaken with a translation. In the dawn of times Lazarus choose a .po extension also for the master file, and this was an error, which has never been corrected. 2) A translation should have a template name-dot-language spec-dot-po, and not Language spec-dot-po. Those files in /debian/po are the second error. IMHO, two solutions: a) long term: change extension for master files in Lazarus from .po to .pot. They're only handled by the Translations unit which creates them from resources and then uses them to update translations msgid. They can be used also by external translation programs, as a template for a new translation, and they would become finally compatible, because those usually accept only a .pot extension. One could allow for a period of grace in which both are accepted, but only .pot are generated. This would make life much easier to everybody. b) immediate hack: do not accept as a master a file whose name without extension is shorter than 3 characters. I don't believe that someone on earth does that! Sort of: Result := (Length(S) 2) and ... etc in IsMasterPoName. Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
If I understand correctly, the error here is that some tools cannot easily edit .po files and instead want .pot files? or what? If the concern is that we don't follow what gettext docs say, should we be worried also that we don't use .mo files? If I remember correctly, one of the reasons (but not the only) to use .po files directly (without .mo conversion) was because any text editor could be used to edit them, but text editors usually don't mind what extension a text file has (even, it could be argued if .txt extension should be used, but not please :)). Jesus Reyes A.-- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/8/14, Maxim Ganetsky gan...@narod.ru wrote: Isn't two listboxes and two pairs of Clear/Unselect buttons too much? It is not clear why listbox with master .po files is needed at all? To make it easier to find a given master po file amogst the clutter of translated po-files (if you select ($lazarus) folder to scan there will be 619 translated languagefiles in the second (Child) listbox... I think that one treeview (showing master .po files and their children) will look much better and will allow to avoid interface clutter. See my argument above. Rethinking for a minute... We could turn this around the other way. Only have a master po list, with a language selection combobox. The All Languages wil then act as the Find all translated PO files option. The disadvantage is that the user cannot see that e.g. pocheckerconsts.nl.po does not exist, so he gets an errormessage when hitting the Run button. Also I would like to have an option to check arbitrary number of selected .po files at once, not just one (useful e.g. to check/show statistics for all files of particular language). Unfortunately the PoFamilies class was never designed to be able to handle something like that. It would probably need a rewrite almost from the ground up. Or set up some collection of PoFamilies, run their separate tests and collect the aggregate of their logs and statistics somehow. I can see it would be practical for language maintainers though. End users never seem to be satisfied G... All this came from one question: can you write a tool that prevents exceptions in format() due to wrong translationfiles. And look where it has taken me... Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/8/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: (please find here attached the latest version if Italian translation, which escaped the big update) In revision 46454 there is an update from you of the pochecker language file. Is this one newer? Q: Do you have commit rights? If so, feel free to commit langage files for this tool. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 08/10/2014 12:14, Bart ha scritto: [...] Unfortunately the PoFamilies class was never designed to be able to handle something like that. It would probably need a rewrite almost from the ground up. Or set up some collection of PoFamilies, run their separate tests and collect the aggregate of their logs and statistics somehow. I can see it would be practical for language maintainers though. End users never seem to be satisfied G... All this came from one question: can you write a tool that prevents exceptions in format() due to wrong translationfiles. a LazFormat procedure in LazUtils, which encompasses a sysutils.format procedure in a try/except block might have been a simpler solution, maybe And look where it has taken me... I don't know if an attempt to further extend Pochecker functionality is a wise move: it's been conceived to perform a number of checking tasks, and it does its job. Starting from PoChecker, I've developed, for my personal usage, another tool (which I called PoHelper) to assist me in translations: it provides me the functions I found useful, picking code around (from the Translations unit, from Pochecker units, and elsewhere) and putting it together to suit my needs. It includes pretty much all the things Maxim requires. It may be an useful complement to Pochecker, leaving to Pochecker to perform its designed tasks, i.e. the final full check before committing. I was planning to make it available to the Lazarus community, but it's still a rough tool, requiring some ironing up to become of public domain. This goes together with a revised Translations unit, taking advantage of all Bart's improvements, which should obsolete SimplePoFiles, and simplify maintenance, both of Pochecker and of the PoHelper to come. Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/8/14, Bart bartjun...@gmail.com wrote: Also I would like to have an option to check arbitrary number of selected .po files at once, not just one (useful e.g. to check/show statistics for all files of particular language). My approach to that would probably be: - Let there be only one list: the one with master po-files - Give the user the option to select multiple files from thate list - If user selects All languages then find all translated files, if user selects a certain (one only please) language then find only the traslated ones for that language - Create a list of TPoFamilies (I would create a component for that) - Run test for each PoFamily in that list - Aggregate results (log, errorcount, stats) - Pass on the log and stats to the resultsform So then you will have the ability to: - test all translated files of one master po-file - test all translated files of a set of master po-files - test translated po-file of a given language of one master po-file - test translated po-files of a given language of a set of master po-files I am unwilling to implement something like: - test (language1, language2 of master1) and (language3, language4 of master2) etc. Just test all languages or one. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/8/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Il 08/10/2014 12:14, Bart ha scritto: All this came from one question: can you write a tool that prevents exceptions in format() due to wrong translationfiles. a LazFormat procedure in LazUtils, which encompasses a sysutils.format procedure in a try/except block might have been a simpler solution, maybe Nice suggestion, but you would only want to use that for translationstrings, so that would be a huge task to cahnge the Lazarus codebase.. I don't know if an attempt to further extend Pochecker functionality is a wise move: it's been conceived to perform a number of checking tasks, and it does its job. Thank you for that feedback. See however my last post about some of what Maxim wants. I think it sounds reasonable. I also stated what I would not be willing to implement. This goes together with a revised Translations unit, taking advantage of all Bart's improvements, which should obsolete SimplePoFiles, and simplify maintenance, both of Pochecker and of the PoHelper to come. That would be of great help. There have been updates and fixes to translations that never made it into SimplePofiles. I would suggest however to discuss that on devel list first. One thing I struggled with is the use of PChar instead of strings. It made it (to me, but that's probably a limitation of my skills) impossible to have line-info on the PoItem. That's why I rewrote all of this to use Strings. The disadvantage of that however is that if a po file is NOT in UTF8, the current code to then convert the entire PChar buffer to UTF8 cannot be used on a String. (So, as a result I just cut that part out, after verifying that no po file of Lazarus uses another encoding (which must be specified in the file) than utf8) In the past I have suggested that this part could be cut out, as long as we require po-files to be in UTF8 encoding always. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/8/14, Bart bartjun...@gmail.com wrote: My approach to that would probably be: - Let there be only one list: the one with master po-files - Give the user the option to select multiple files from thate list - If user selects All languages then find all translated files, if user selects a certain (one only please) language then find only the traslated ones for that language - Create a list of TPoFamilies (I would create a component for that) - Run test for each PoFamily in that list - Aggregate results (log, errorcount, stats) - Pass on the log and stats to the resultsform So then you will have the ability to: - test all translated files of one master po-file - test all translated files of a set of master po-files - test translated po-file of a given language of one master po-file - test translated po-files of a given language of a set of master po-files Implemented in r46475. Please give feedback. (Some buttons still need AutSize := True, will do that some other time) Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
08.10.2014 21:46, Bart пишет: On 10/8/14, Bart bartjun...@gmail.com wrote: My approach to that would probably be: - Let there be only one list: the one with master po-files - Give the user the option to select multiple files from thate list - If user selects All languages then find all translated files, if user selects a certain (one only please) language then find only the traslated ones for that language - Create a list of TPoFamilies (I would create a component for that) - Run test for each PoFamily in that list - Aggregate results (log, errorcount, stats) - Pass on the log and stats to the resultsform So then you will have the ability to: - test all translated files of one master po-file - test all translated files of a set of master po-files - test translated po-file of a given language of one master po-file - test translated po-files of a given language of a set of master po-files Implemented in r46475. Please give feedback. Works great, thank you very much. Still some comments ;) : 1. List of removed non-existent files can be quite big, so probably should be contained in Memo or something. 2. PoChecker always complains about .po files from debian\po Lazarus subdirectory. 3. Message There are no files left to check. is displayd directly after message about non-existent files. It will be good to combine them. (Some buttons still need AutSize := True, will do that some other time) Please consider using toolbars. -- Best regards, Maxim Ganetsky mailto:gan...@narod.ru -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 01/10/2014 21:09, Bart ha scritto: On 9/24/14, Bart bartjun...@gmail.com wrote: I'ḿ now planning on - extent the PoCheckerSettings - implement some mechanism (listbox probably) to access recently opened master/child po-files - implement searching an entire directory for all po's (listing them in one of the lisboxes) Finally done in r46394. There will be bugs, so please hunt them. After a week spent on hunting :-) , only a few cosmetic issues to report: small buttons such as select basic, select all, unselect all, clear, unselect, etc. should have AutoSize set to fit translations. At first I wanted also suggest to put in size constraints on the main form, but I see you've already done it in the meantime. Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/7/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: After a week spent on hunting :-) , only a few cosmetic issues to report: small buttons such as select basic, select all, unselect all, clear, unselect, etc. should have AutoSize set to fit translations. The downside being that the buttons will all get different sizes (I guess). Although that is still better than captions running out of space, any thoughts on how to prevet that from happening? Also, what language holds the longest captions (in general), so that it would be best suited for me testing all of this? At first I wanted also suggest to put in size constraints on the main form, but I see you've already done it in the meantime. Swen's idea. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 07/10/2014 23:54, Bart ha scritto: On 10/7/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: After a week spent on hunting :-) , only a few cosmetic issues to report: small buttons such as select basic, select all, unselect all, clear, unselect, etc. should have AutoSize set to fit translations. The downside being that the buttons will all get different sizes (I guess). Although that is still better than captions running out of space, any thoughts on how to prevet that from happening? It's difficult to have it both ways. But you may set in the size constraints for those buttons a MinWidth value reasonably large, so that while the text fits in the minimum value, they're all the same, and when some text is longer they're not too much different. Also, what language holds the longest captions (in general), so that it would be best suited for me testing all of this? I verified it with Italian http://www.bononiadocta.it/Lazarus/Pochecker-it.png (please find here attached the latest version if Italian translation, which escaped the big update) then I checked with Russian http://www.bononiadocta.it/Lazarus/Pochecker-ru.png because 1) I know that it's rather longish, 2) I know that russian translations are always kept up to date by Maxim. Also German is usually quite long, but in this case only Select basic doesn't fit in the button. But in general it's very difficult to predict: Russian is normally quite long, English Hi or Hello translates to something like but the word for //All// is ???, which is as short as English. In a short caption you can have surprises. Usually, from my experience, if Italian, German and Russian do fit, you shouldn't have too many surprises with other languages. But my experience comes only from what I've done in the past, so take it with caution. Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? # Giuliano Colla giuliano.co...@fastwebnet.it, 2014. msgid msgstr Project-Id-Version: \n POT-Creation-Date: \n PO-Revision-Date: 2014-10-07 23:00+0200\n Last-Translator: Giuliano Colla giuliano.co...@fastwebnet.it\n Language-Team: Lazarus\n Language: it\n MIME-Version: 1.0\n Content-Type: text/plain; charset=UTF-8\n Content-Transfer-Encoding: 8bit\n Plural-Forms: nplurals=2; plural=(n != 1);\n X-Generator: Virtaal 0.6.1\n #: pocheckerconsts.rspochecker msgid PO File Checker msgstr Verificatore di files PO #: pocheckerconsts.salllanguages msgid All Languages msgstr Tutte le lingue #: pocheckerconsts.scannotfindmaster msgid Cannot find master po file:\n %s\n for selected file\n %s\n msgstr Non trovato il file master po:\n %s\n per il file scelto\n %s\n #: pocheckerconsts.scheckforduplicateuntranslatedvalues msgid Check for duplicate untranslated values msgstr Verifica valori duplicati non tradotti #: pocheckerconsts.scheckforincompatibleformatarguments msgid Check for incompatible format arguments msgstr Verifica argomenti con format incompatibile #: pocheckerconsts.scheckformismatchesinuntranslatedstrings msgid Check for mismatches in untranslated strings msgstr Verifica mancate corrispondenze in stringhe non tradotte #: pocheckerconsts.scheckmissingidentifiers msgid Check missing identifiers msgstr Verifica identificatori mancanti #: pocheckerconsts.schecknumberofitems msgid Check number of items msgstr Verifica il numero di voci #: pocheckerconsts.scheckstatistics msgid Check percentage of (un)translated and fuzzy strings msgstr Verifica le percentuali di stringhe tradotte o incerte #: pocheckerconsts.sclearlistbox msgid Clear msgstr Azzera #: pocheckerconsts.scopycaption msgid Copy to clipboard msgstr Copia negli appunti #: pocheckerconsts.scurrenttest #| msgid Current Test: msgid Test: %s on %s msgstr Test: %s su %s #: pocheckerconsts.sduplicatelinenrwithvalue msgid [Line %d] %s msgstr [Riga %d] %s #: pocheckerconsts.sduplicateoriginals msgid The (untranslated) value \%s\ is used for more than 1 entry: msgstr Il valore (non tradotto) \%s\ è usato per più di 1 voce: #: pocheckerconsts.serroroncleanup msgid An unrecoverable error occurred\n %s\n Please close the program\n msgstr Si è prodotto un errore irrecuperabile\n %s\n Chiudere il programma\n #: pocheckerconsts.serroroncreate msgid Error creating an instance of TPoFamily:\n %s\n msgstr Errore nel creare una istanza di TPoFamily:\n %s\n #: pocheckerconsts.serrorsbytest msgid Errors / warnings reported by %s for: msgstr Errori / avvertimenti riportati da %s per: #: pocheckerconsts.sfindalltranslatedpofiles msgid Find all translated po-files msgstr Trova tutti i file po tradotti #: pocheckerconsts.sfuzzy msgid Fuzzy msgstr Incerto #: pocheckerconsts.sgrapstatformcaption msgid Graphical summary msgstr Riassunto grafico #: pocheckerconsts.sguipofilecheckingtool msgid GUI Po-file checking tool msgstr Strumento GUI di verifica di file po #: pocheckerconsts.sidentifiernotfoundin msgid Identifier [%s] not
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
01.10.2014 23:09, Bart пишет: On 9/24/14, Bart bartjun...@gmail.com wrote: I'ḿ now planning on - extent the PoCheckerSettings - implement some mechanism (listbox probably) to access recently opened master/child po-files - implement searching an entire directory for all po's (listing them in one of the lisboxes) Finally done in r46394. There will be bugs, so please hunt them. These changes are very useful, thanks. Some comments: Isn't two listboxes and two pairs of Clear/Unselect buttons too much? It is not clear why listbox with master .po files is needed at all? I think that one treeview (showing master .po files and their children) will look much better and will allow to avoid interface clutter. Also I would like to have an option to check arbitrary number of selected .po files at once, not just one (useful e.g. to check/show statistics for all files of particular language). I think that with this feature implemented we shouldn't need Find all translated PO files checkbox anymore. -- Best regards, Maxim Ganetsky mailto:gan...@narod.ru -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
08.10.2014 1:54, Bart пишет: On 10/7/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: After a week spent on hunting :-) , only a few cosmetic issues to report: small buttons such as select basic, select all, unselect all, clear, unselect, etc. should have AutoSize set to fit translations. The downside being that the buttons will all get different sizes (I guess). Although that is still better than captions running out of space, any thoughts on how to prevet that from happening? Maybe use toolbar instead of buttons. It will allow to avoid these problems. -- Best regards, Maxim Ganetsky mailto:gan...@narod.ru -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/1/14, Maxim Ganetsky gan...@narod.ru wrote: It seems that your IDE is not up to date and does not include recent Translations unit fixes, because your commit corrupts PrevMsg value in e.g. Russian translation. Please update/rebuild IDE and updatepofiles tool. I updated to r46390 and rebuilt both the IDE and updatepofiles tool. I then let the updatepofiles tool update the languagefiles for the pochecker. It modified 2 files (ru and de). I committed those on r46391. Can you check that it is now OK? Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 10/1/14, Bart bartjun...@gmail.com wrote: I updated to r46390 and rebuilt both the IDE and updatepofiles tool. I then let the updatepofiles tool update the languagefiles for the pochecker. It modified 2 files (ru and de). I committed those on r46391. Somethig went wrong here. I did a make clean again, then rebuilt. Now the updatepofiles tool does not alter any languagefiles from pochecker tool. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/24/14, Bart bartjun...@gmail.com wrote: I'ḿ now planning on - extent the PoCheckerSettings - implement some mechanism (listbox probably) to access recently opened master/child po-files - implement searching an entire directory for all po's (listing them in one of the lisboxes) Finally done in r46394. There will be bugs, so please hunt them. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
01.10.2014 13:42, Bart пишет: On 10/1/14, Bart bartjun...@gmail.com wrote: I updated to r46390 and rebuilt both the IDE and updatepofiles tool. I then let the updatepofiles tool update the languagefiles for the pochecker. It modified 2 files (ru and de). I committed those on r46391. Somethig went wrong here. I did a make clean again, then rebuilt. Now the updatepofiles tool does not alter any languagefiles from pochecker tool. Great. I cleaned up affected translations. -- Best regards, Maxim Ganetsky mailto:gan...@narod.ru -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/29/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Wouldn't it be more logical to use DoubleClick (ore select by mouse and have a button on the form)? The problem is that: 1) the OnItemSelected, which would have been the logical choice, doesn't appear to work (for the vsIcon mode) with some popular widgetsets (I don't remember which ones, but a couple among gtk2, win32 and Qt) I'll look into that. AFAIR it works on Windows and GTK2 Linux. 2) OnClick and OnDoubleClick do not provide you neither the ListView Item nor the mouse position: you know only that the full window has been clicked somewhere. Therefore one is forced to use an event which provides mouse position. No you can access the global Mouse.CursorPos in an OnClick or OnDblClick and use ScreenToClient to get the relative coordinates. I will test this apporach in my ListView test suite. No hurry though, it's a minor issue. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/29/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: This is wrong, I think. ErrCount depends on the previous tests that have run (and on the Ignore Fuzzy option. The CheckStatistics runs independantly from all other tests. As a result the new property for TStat can be rather misleading. Why should it be misleading? It just tells if there are any errors for the tests required. If you set Ignore Fuzzy it means that you don't care and the format errors of Fuzzy translations are not counted. The hint suggest an absolute value for the number of errors found, when in fact it is dependant on the test settings. It does not seem right to me. Maybe it should be refrased then? Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/29/14, Maxim Ganetsky gan...@narod.ru wrote: Do you really want to reimlement PoEdit or Lokalize in Lazarus (e.g. implement translation memory, dictionaries support etc.)? What for? I think it is better to just open external editor which is associated with PO files (e.g. PoEdit or Lokalize). I agree with you. Currently the file can be opened in the IDE. I plan to implement some external editor capability for the tool. (I don't want to implement yet another options dialog for it, so it'll probably a commandline paramter, and possibly stored in the config file.) Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/29/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: But as far as the indication of the presence of errors in the graphical view, I strongly disagree with you. I tested with the translations of ($Lazarus)/languages/lazaruside.po. You must scan exactly 12165 lines on the results page to see all the errors (the remaining lines give the percentage for translations). See OK, you have a point there. The hint text needs modification though IMHO, not jus a plain %d Errors. Feel free to commit. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 29/09/2014 22:46, Maxim Ganetsky ha scritto: 29.09.2014 22:08, Giuliano Colla пишет: [snip] I believe that there's a simple way to go in the right direction. Pochecker (when integrated in the IDE) is being added the capability of opening a po file in the IDE editor. The syntax highlighter for po files is already there. Adding to the IDE editor some smarter po-file editing capabilities can be done without a big effort, following the guidelines of the HTML editor provided by the weblaz package, and perhaps implementing a minimal codetool-like unit for po syntax (which is rather simple). Do you really want to reimlement PoEdit or Lokalize in Lazarus (e.g. implement translation memory, dictionaries support etc.)? What for? I think it is better to just open external editor which is associated with PO files (e.g. PoEdit or Lokalize). No, I never thought of reinventing the wheel. I was just thinking to provide the minimum required for translation maintenance, which, given the amount of small changes to resource strings (lower/upper case changes, an added or moved or removed for kb shortcuts, punctuation changes etc.), is IMHO a relevant part of translation activity. Opening a real full fledged po-editor is another option for more important editing. See Bart's answer on this subject. This could end in a smooth cycle: check, edit, check again, but even now it's already usable: after all translations are performed by developers. In many cases translators are not developers and have difficulties with programming. I'll keep it in mind. Thanks. Giuliano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 30/09/2014 08:49, Bart ha scritto: On 9/29/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: But as far as the indication of the presence of errors in the graphical view, I strongly disagree with you. I tested with the translations of ($Lazarus)/languages/lazaruside.po. You must scan exactly 12165 lines on the results page to see all the errors (the remaining lines give the percentage for translations). See OK, you have a point there. The hint text needs modification though IMHO, not jus a plain %d Errors. I can think of: 1. %d Detected Errors 2. %d Errors in Selected tests 3. %d Errors in %s (%s being built from selected tests) Any better idea? Feel free to commit. Let me know which hint text you'd like, then I'll send the patch (I don't believe to have yet commit rights) Giuliano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/30/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: The hint text needs modification though IMHO, not jus a plain %d Errors. I can think of: 2. %d Errors in Selected tests This one sounds good to me. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 30/09/2014 12:53, Bart ha scritto: On 9/30/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: The hint text needs modification though IMHO, not jus a plain %d Errors. I can think of: 2. %d Errors in Selected tests This one sounds good to me. It was my favorite too. Ok then. Here you are. (patch attached) Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? Index: pocheckerconsts.pas === --- pocheckerconsts.pas (revision 46356) +++ pocheckerconsts.pas (working copy) @@ -42,7 +42,8 @@ sFuzzy = 'Fuzzy'; sStatHint = '%3d Translated (%3.1f%%)' + LineEnding + '%3d UnTranslated (%3.1f%%)' + LineEnding + - '%3d Fuzzy (%3.1f%%)'; + '%3d Fuzzy (%3.1f%%)' + LineEnding + + '%d Error(s) in Selected Tests'; sOpenFile = 'Open file %s in Ide Editor?'; SOpenFail = 'Unable to open file %s'; Index: pofamilies.pp === --- pofamilies.pp (revision 46356) +++ pofamilies.pp (working copy) @@ -68,7 +68,7 @@ procedure CheckMissingIdentifiers(out ErrorCount: Integer; ErrorLog: TStrings); procedure CheckMismatchedOriginals(out ErrorCount: Integer; ErrorLog: TStrings); procedure CheckDuplicateOriginals(out WarningCount: Integer; ErrorLog: TStrings); -procedure CheckStatistics; +procedure CheckStatistics(ErrorCnt: Integer); public procedure RunTests(const TestTypes: TPoTestTypes; const TestOptions: TPoTestOptions; @@ -96,14 +96,16 @@ FNrTranslated: Integer; FNrUnTranslated: Integer; FNrFuzzy: Integer; +FNrErrors: Integer; public -constructor Create(APoName: String; ANrTotal, ANrTranslated, ANrUntranslated, ANrFuzzy: Integer); +constructor Create(APoName: String; ANrTotal, ANrTranslated, ANrUntranslated, ANrFuzzy,ANrErrors: Integer); function ShortPoName: String; property PoName: string read FPoName; property NrTotal: Integer read FNrTotal; property NrTranslated: Integer read FNrTranslated; property NrUnTranslated: Integer read FNrUnTranslated; property NrFuzzy: Integer read FNrFuzzy; +property NrErrors: Integer read FNrErrors; function PercTranslated: Double; inline; function PercUnTranslated: Double; inline; function PercFuzzy: Double; inline; @@ -119,7 +121,7 @@ function GetItems(Index: Integer): TStat; public procedure Clear; -procedure Add(AName: String; ANrTotal, ANrTranslated, ANrUnTranslated, ANrFuzzy: Integer); +procedure Add(AName: String; ANrTotal, ANrTranslated, ANrUnTranslated, ANrFuzzy,ANrErrors: Integer); constructor Create; destructor Destroy; override; procedure AddStatisticsToLog(ALog: TStrings); @@ -320,13 +322,14 @@ { TStat } -constructor TStat.Create(APoName: String; ANrTotal, ANrTranslated, ANrUntranslated, ANrFuzzy: Integer); +constructor TStat.Create(APoName: String; ANrTotal, ANrTranslated, ANrUntranslated, ANrFuzzy,ANrErrors: Integer); begin FPoName := APoName; FNrTotal := ANrTotal; FNrTranslated := ANrTranslated; FNrUntranslated := ANrUntranslated; FNrFuzzy := ANrFuzzy; + FNrErrors:= ANrErrors; end; function TStat.ShortPoName: String; @@ -381,9 +384,9 @@ FList.Clear; end; -procedure TPoFamilyStats.Add(AName: String; ANrTotal, ANrTranslated, ANrUnTranslated, ANrFuzzy: Integer); +procedure TPoFamilyStats.Add(AName: String; ANrTotal, ANrTranslated, ANrUnTranslated, ANrFuzzy,ANrErrors: Integer); begin - FList.Add(TStat.Create(AName, ANrTotal, ANrTranslated, ANrUntranslated, ANrFuzzy)); + FList.Add(TStat.Create(AName, ANrTotal, ANrTranslated, ANrUntranslated, ANrFuzzy,ANrErrors)); end; constructor TPoFamilyStats.Create; @@ -758,7 +761,7 @@ //debugln('TPoFamily.CheckDuplicateOriginals: ',Dbgs(WarningCount),' Errors'); end; -procedure TPoFamily.CheckStatistics; +procedure TPoFamily.CheckStatistics(ErrorCnt: Integer); var i: Integer; CPoItem: TPOFileItem; @@ -791,7 +794,7 @@ NrTotal := NrTranslated + NrUntranslated + NrFuzzy; if (NrTotal 0) then begin -FPoFamilyStats.Add(ChildName, NrTotal, NrTranslated, NrUntranslated, NrFuzzy); +FPoFamilyStats.Add(ChildName, NrTotal, NrTranslated, NrUntranslated, NrFuzzy,ErrorCnt); end; DoTestEnd(PoTestTypeNames[pttCheckFormatArgs], 0); //debugln('TPoFamily.CheckIncompatibleFormatArgs: ',Dbgs(ErrorCount),' Errors'); @@ -807,7 +810,7 @@ out ErrorCount, WarningCount: Integer; ErrorLog: TStrings); var SL: TStringList; - CurrErrCnt, CurrWarnCnt: Integer; + CurrErrCnt, CurrWarnCnt,ThisErrCnt: Integer; i: Integer; CurrChildName: String; S: String; @@ -897,6 +900,7 @@ //then iterate all Children for i := 0 to SL.Count - 1 do begin + ThisErrCnt:= 0; CurrChildName := SL.Strings[i]; //debugln('TPoFamily.RunTests: setting
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/30/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: It was my favorite too. Ok then. Here you are. (patch attached) Committed in r46376. Thanks. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/30/14, Bart bartjun...@gmail.com wrote: I plan to implement some external editor capability for the tool. (I don't want to implement yet another options dialog for it, so it'll probably a commandline paramter, and possibly stored in the config file.) Done in r46386. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
01.10.2014 2:47, Bart пишет: On 9/30/14, Bart bartjun...@gmail.com wrote: I plan to implement some external editor capability for the tool. (I don't want to implement yet another options dialog for it, so it'll probably a commandline paramter, and possibly stored in the config file.) Done in r46386. It seems that your IDE is not up to date and does not include recent Translations unit fixes, because your commit corrupts PrevMsg value in e.g. Russian translation. Please update/rebuild IDE and updatepofiles tool. -- Best regards, Maxim Ganetsky mailto:gan...@narod.ru -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 26/09/2014 18:51, Bart ha scritto: Feel free to commit it, I will probably not interfere with my work. I'll be working on the mainform most of the time now (and the settings unit). Please find here enclosed my proposed patch for Pochecker. I've implemented the opening in the IDE editor (which brought a number of consequences), but I've also made some improvements. What I've done: 1) cosmetic: adding an AntialiasingMode := amOn to the canvas in TGraphStatForm.CreateBitmap, the Qt image is much better (Qt has antialiasing support). Other widgetsets are unaffected. 2) In order to be able to open the file, I needed its full name, so I've been forced to add a new property to Tstat, and then pass its value to TStat.Create. 3) If you open the file in the IDE editor, you have still two modal windows and the main window open, in front of the Editor Window, and you don't get any visual feedback that a new editor window has been opened. I introduced a custom Modal Result mrOpenEditorFile, so that the modal windows are closed, and the main window is minimized. 4) Once you're done editing you may want to check again, but this requires that Pochecker is visible in the Task Bar: the property ShowInTaskBar must be set to stAlways to make sure that it's accessible from the task bar in all platforms. 5) If after editing and saving your file(s) you click a second time on Run Selected Tests you'd like to see the current situation, not the previous one. Therefore I've added a boolean FNewRun, to know if a call to TryCreatePoFamily is required before running the tests. 6) At startup the last choices are remembered, but not by the OpenFile dialog. Therefore I've set the InitialDir of the dialog to the one of the last file, which is usually a much better starting point than the defaults. 7) Trying to use the tool I realized that another feature was missing: GraphStat provided only information about the Translated/Untranslated/Fuzzy, but didn't tell a thing about errors. Therefore I've added another property to Tstat, and filled it properly (TStat.Create, etc). Then I've added a red question mark to the pie image when the errors are 0, and I've added the number of errors to the hint. If you like what I've done, but it creates conflicts with your changes, let me know if you prefer that I take care of adapting my patch to the current situation. Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? Index: pocheckerconsts.pas === --- pocheckerconsts.pas (revisione 46344) +++ pocheckerconsts.pas (copia locale) @@ -3,6 +3,7 @@ {$mode objfpc}{$H+} interface +uses Controls; resourcestring //Main form @@ -40,7 +41,8 @@ sFuzzy = 'Fuzzy'; sStatHint = '%3d Translated (%3.1f%%)' + LineEnding + '%3d UnTranslated (%3.1f%%)' + LineEnding + - '%3d Fuzzy (%3.1f%%)'; + '%3d Fuzzy (%3.1f%%)' + LineEnding + + '%d Errors'; //PoFamiles sOriginal = 'Original'; @@ -78,6 +80,12 @@ sPercTranslated = '%s: %4.1f%% translated strings.'; sPercUntranslated = '%s: %4.1f%% untranslated strings.'; sPercFuzzy = '%s: %4.1f%% fuzzy strings.'; + //GraphStat + sOpenFile = 'Open file %s in Ide Editor?'; + SOpenFail = 'Unable to open file %s'; +const + mrOpenEditorFile = mrNone+100; + implementation end. Index: resultdlg.lfm === --- resultdlg.lfm (revisione 46344) +++ resultdlg.lfm (copia locale) @@ -27,10 +27,10 @@ object CloseBtn: TBitBtn AnchorSideRight.Control = Panel1 AnchorSideRight.Side = asrBottom - Left = 657 - Height = 26 + Left = 651 + Height = 27 Top = 12 - Width = 75 + Width = 81 Anchors = [akRight] AutoSize = True BorderSpacing.Right = 10 @@ -41,10 +41,10 @@ end object SaveBtn: TBitBtn AnchorSideRight.Control = CloseBtn - Left = 544 - Height = 26 + Left = 524 + Height = 27 Top = 12 - Width = 103 + Width = 117 Anchors = [akRight] AutoSize = True BorderSpacing.Around = 10 @@ -90,10 +90,10 @@ end object CopyBtn: TBitBtn AnchorSideRight.Control = SaveBtn - Left = 393 - Height = 26 + Left = 357 + Height = 27 Top = 12 - Width = 141 + Width = 157 Anchors = [akRight] AutoSize = True BorderSpacing.Around = 10 @@ -139,10 +139,10 @@ end object GraphStatBtn: TBitBtn AnchorSideRight.Control = CopyBtn - Left = 226 - Height = 26 + Left = 162 + Height = 27 Top = 12 - Width = 157 + Width = 185 Anchors = [akRight] AutoSize = True Caption = 'Show statistics graph' @@ -198,7 +198,7 @@ ParentColor = False ParentFont = False TabOrder = 0 -
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 28/09/2014 21:13, Maxim Ganetsky ha scritto: 27.09.2014 10:06, Vincent Snijders пишет: 2014-09-26 22:49 GMT+02:00 Maxim Ganetsky gan...@narod.ru mailto:gan...@narod.ru: 26.09.2014 20 tel:26.09.2014%2020:53, Bart пишет: I propose to add two optional files sanitization/cleanup features: 1. Make all entries that have formatting errors fuzzy. 2. Remove PreviousMsgId (comments starting with #| ) from entries which are not fuzzy (in this case such comments are no longer relevant, but translation tools don't remove them themselves when removing fuzzy flag). No, I'm not going to, and I strongly feel we should no go that way. The tool is for checking. It's a pity. These features ease translations maintenance work and are not covered by PO file editors. Maybe it is better to add these feature to updatepofile? IMHO it better belongs to POChecker because it already has most of needed infrastructure. E.g. updatepofile cannot detect formatting errors while POChecker can. I believe that there's a simple way to go in the right direction. Pochecker (when integrated in the IDE) is being added the capability of opening a po file in the IDE editor. The syntax highlighter for po files is already there. Adding to the IDE editor some smarter po-file editing capabilities can be done without a big effort, following the guidelines of the HTML editor provided by the weblaz package, and perhaps implementing a minimal codetool-like unit for po syntax (which is rather simple). This could end in a smooth cycle: check, edit, check again, but even now it's already usable: after all translations are performed by developers. Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/29/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Please find here enclosed my proposed patch for Pochecker. I took a quick look at the patch: 2) In order to be able to open the file, I needed its full name, so I've been forced to add a new property to Tstat, and then pass its value to TStat.Create. I would rather call th eproperty FullName instead of Name... Also it we could just use the fullname only (and extract shortname when needed, or declare a function PoShortName). 6) At startup the last choices are remembered, but not by the OpenFile dialog. Therefore I've set the InitialDir of the dialog to the one of the last file, which is usually a much better starting point than the defaults. I intend to have that in the PoChecker.xml settings. 7) Trying to use the tool I realized that another feature was missing: GraphStat provided only information about the Translated/Untranslated/Fuzzy, but didn't tell a thing about errors. Therefore I've added another property to TStat, and filled it properly (TStat.Create, etc). Then I've added a red question mark to the pie image when the errors are 0, and I've added the number of errors to the hint. This is wrong, I think. ErrCount depends on the previous tests that have run (and on the Ignore Fuzzy option. The CheckStatistics runs independantly from all other tests. As a result the new property for TStat can be rather misleading. When I have more time I will test the patch and adapt it (see notes above). One further remark. For the sake of svn history it is encouraged to split commits per issue fixed, so in this case: - antialiasing - better hints - IDE integration Makes for better bug-hunting in the future. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/29/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Please find here enclosed my proposed patch for Pochecker. Committed (edited version) in 3 batches. I did not check the IDE integration myself. I noticed you uses MousUp for opening, this means you cannot click on an item without being prompted for opening. Wouldn't it be more logical to use DoubleClick (ore select by mouse and have a button on the form)? Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
29.09.2014 22:08, Giuliano Colla пишет: [snip] I believe that there's a simple way to go in the right direction. Pochecker (when integrated in the IDE) is being added the capability of opening a po file in the IDE editor. The syntax highlighter for po files is already there. Adding to the IDE editor some smarter po-file editing capabilities can be done without a big effort, following the guidelines of the HTML editor provided by the weblaz package, and perhaps implementing a minimal codetool-like unit for po syntax (which is rather simple). Do you really want to reimlement PoEdit or Lokalize in Lazarus (e.g. implement translation memory, dictionaries support etc.)? What for? I think it is better to just open external editor which is associated with PO files (e.g. PoEdit or Lokalize). This could end in a smooth cycle: check, edit, check again, but even now it's already usable: after all translations are performed by developers. In many cases translators are not developers and have difficulties with programming. -- Best regards, Maxim Ganetsky mailto:gan...@narod.ru -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 29/09/2014 21:35, Bart ha scritto: On 9/29/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Please find here enclosed my proposed patch for Pochecker. I took a quick look at the patch: 2) In order to be able to open the file, I needed its full name, so I've been forced to add a new property to Tstat, and then pass its value to TStat.Create. I would rather call th eproperty FullName instead of Name... Also it we could just use the fullname only (and extract shortname when needed, or declare a function PoShortName). I fully agree on FullName. For the rest, I think that one more property is less expensive in terms of code, and on speed. 6) At startup the last choices are remembered, but not by the OpenFile dialog. Therefore I've set the InitialDir of the dialog to the one of the last file, which is usually a much better starting point than the defaults. I intend to have that in the PoChecker.xml settings. 7) Trying to use the tool I realized that another feature was missing: GraphStat provided only information about the Translated/Untranslated/Fuzzy, but didn't tell a thing about errors. Therefore I've added another property to TStat, and filled it properly (TStat.Create, etc). Then I've added a red question mark to the pie image when the errors are 0, and I've added the number of errors to the hint. This is wrong, I think. ErrCount depends on the previous tests that have run (and on the Ignore Fuzzy option. The CheckStatistics runs independantly from all other tests. As a result the new property for TStat can be rather misleading. Why should it be misleading? It just tells if there are any errors for the tests required. If you set Ignore Fuzzy it means that you don't care and the format errors of Fuzzy translations are not counted. When I have more time I will test the patch and adapt it (see notes above). One further remark. For the sake of svn history it is encouraged to split commits per issue fixed, so in this case: - antialiasing - better hints - IDE integration Makes for better bug-hunting in the future. I'll remember for next time. Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 29/09/2014 22:40, Bart ha scritto: On 9/29/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Please find here enclosed my proposed patch for Pochecker. Committed (edited version) in 3 batches. I did not check the IDE integration myself. I'll test IDE integration and let you know. I noticed you uses MousUp for opening, this means you cannot click on an item without being prompted for opening. Wouldn't it be more logical to use DoubleClick (ore select by mouse and have a button on the form)? The problem is that: 1) the OnItemSelected, which would have been the logical choice, doesn't appear to work (for the vsIcon mode) with some popular widgetsets (I don't remember which ones, but a couple among gtk2, win32 and Qt) 2) OnClick and OnDoubleClick do not provide you neither the ListView Item nor the mouse position: you know only that the full window has been clicked somewhere. Therefore one is forced to use an event which provides mouse position. The choice is then between MouseDown and MouseUp. I picked up MouseUp because it simulates the behavior of OnClick (which is actually triggered when mouse is released. I've been fighting with ListView when working on editortoolbar and I learned that it's a sort of wild beast, which nobody has succeeded in taming up to now. It almost never does what's expected to do. That's why I had tried to avoid it. Code for positioning widdegts on a window is a child's play, with respect with events which do not occur, or which occur in reverse order, or things like that... Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 29/09/2014 21:35, Bart ha scritto: On 9/29/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: [..] 7) Trying to use the tool I realized that another feature was missing: GraphStat provided only information about the Translated/Untranslated/Fuzzy, but didn't tell a thing about errors. Therefore I've added another property to TStat, and filled it properly (TStat.Create, etc). Then I've added a red question mark to the pie image when the errors are 0, and I've added the number of errors to the hint. This is wrong, I think. ErrCount depends on the previous tests that have run (and on the Ignore Fuzzy option. The CheckStatistics runs independantly from all other tests. As a result the new property for TStat can be rather misleading. I tested the IDE integration, and it works as expected. But as far as the indication of the presence of errors in the graphical view, I strongly disagree with you. I tested with the translations of ($Lazarus)/languages/lazaruside.po. You must scan exactly 12165 lines on the results page to see all the errors (the remaining lines give the percentage for translations). See Image: http://www.bononiadocta.it/Lazarus/Pochecker-r.png This makes the tool completely useless to provide a general view of the state of the translations. If you compare with this image: http://www.bononiadocta.it/Lazarus/Pochecker-g.png you may judge by yourself what's more practical. Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 28/09/2014 00:10, Bart ha scritto: On 9/27/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: If Bart, who is the author and rightful owner of Pochecker, doesn't like the idea of making it too bloated, then creating a new tool becomes an option to be considered. First of all, this is a community driven project, so extending the PoChecker tool to have editing/fiximg/sanitizing capabilties is an option, if so desired by the community. I just did not envision this sort of tasks for the tool at all when I started out creating it. I already stated why I don't think extending it this way is a good idea earlier in this thread. Please do not misunderstand me. What I meant is that being you the author of the project you're also rightfully the project leader. It must be that way, because a leaderless project goes randomly nowhere. That said, I think that it would be unwise attempting to twist your arm to make the project take a different route, for two very good reasons. Personal reasons: this is not a commercial activity, it's an activity based on voluntary work. One must like what he does, be convinced that it's going in the right direction, and enjoy doing it. Technical reasons: being the author you're the one with the best knowledge of how it was originally planned, which features can be easily integrated in this frame, and which ones fall outside the planned frame. The community may ask features, and contribute to some extent, but must take very seriously your opinion. About the scattering of tools/code for these tasks: I created the SimplePoFiles, which basically is a rip-off of the Translations unit (I cut out all parts I did not need) because: [...] Again don't misunderstand me. I didn't mean Pochecker being scattered or whatever. Currently it's a po checking tool and it does exactly what's it's intended to do. What I meant is that the total of the tools required by a translator are scattered, and very far from being integrated. If we look how currently the translation process is carried on, we see that it's very far from smooth. 1. The IDE compares the po template and translations with resource string, and updates all Msgid field where appropriate, marking them as Fuzzy is changed. (btw. gettext and editing tools assumes a .po template to have the .pot extension, and actual translations to have .po extension, while in Lazarus both template and translations carry .po extension. Why?) 2. The translator locates the translations in need of editing. The tool available is Pochecker 3. The translator edits the translation by means of a po editing tool. The tool available is poedit (or an equivalent), which doesn't perform any check, but assists only in locating fuzzy and unstranslated strings, and in adding some escape characters. 4. If the translator wants to clean-up and sanitize the translation, getting rid of useless remnants, edits again the file with a text editor which provides none or minimal assistance for po file specific format. Many tools available, from IDE editor to lot of others. 5. The translator checks if the translation is good. The tool available is Pochecker. 6. Back to point 2 to locate next translation. Maxim may check this list, and see if I left out something. They're many steps with different tools, many manual operations, when computers are supposed to be devices providing automatic functions. A single tool providing steps from 2 to 6 would be a great help to translators, it would make the translation process much faster and less error-prone. And most of the functions required are already available in the Lazarus project units. This result can be achieved either by evolving PoChecker into a PoConditioner, or by creating a PoConditioner as a new tool. [...] Maybe extra the capabilities that SimplePoFiles has can be ported back to the Traslations unit. This would cut down on maintemance. This could be a preliminary step whatever is decided to do after. If you need manpower for this, you may count on me. I also consider getting rid of PChars a sort of moral duty :-) Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/28/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Please do not misunderstand me. What I meant is that being you the author of the project you're also rightfully the project leader. Yes, but at some time you must be prepared to let it leave the nest... ... Again don't misunderstand me. I didn't mean Pochecker being scattered or whatever. Currently it's a po checking tool and it does exactly what's it's intended to do. What I meant is that the total of the tools required by a translator are scattered, and very far from being integrated. I did not think your comment was abot PoChecker, I merely wanted to say that I am also partly to blame maybe Anyhow I appreciate your input (and that of the other contributors to this thread). Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
27.09.2014 10:06, Vincent Snijders пишет: 2014-09-26 22:49 GMT+02:00 Maxim Ganetsky gan...@narod.ru mailto:gan...@narod.ru: 26.09.2014 20 tel:26.09.2014%2020:53, Bart пишет: I propose to add two optional files sanitization/cleanup features: 1. Make all entries that have formatting errors fuzzy. 2. Remove PreviousMsgId (comments starting with #| ) from entries which are not fuzzy (in this case such comments are no longer relevant, but translation tools don't remove them themselves when removing fuzzy flag). No, I'm not going to, and I strongly feel we should no go that way. The tool is for checking. It's a pity. These features ease translations maintenance work and are not covered by PO file editors. Maybe it is better to add these feature to updatepofile? IMHO it better belongs to POChecker because it already has most of needed infrastructure. E.g. updatepofile cannot detect formatting errors while POChecker can. -- Best regards, Maxim Ganetsky mailto:gan...@narod.ru -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
2014-09-26 22:49 GMT+02:00 Maxim Ganetsky gan...@narod.ru: 26.09.2014 20:53, Bart пишет: I propose to add two optional files sanitization/cleanup features: 1. Make all entries that have formatting errors fuzzy. 2. Remove PreviousMsgId (comments starting with #| ) from entries which are not fuzzy (in this case such comments are no longer relevant, but translation tools don't remove them themselves when removing fuzzy flag). No, I'm not going to, and I strongly feel we should no go that way. The tool is for checking. It's a pity. These features ease translations maintenance work and are not covered by PO file editors. Maybe it is better to add these feature to updatepofile? Vincent -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 27/09/2014 08:06, Vincent Snijders ha scritto: 2014-09-26 22:49 GMT+02:00 Maxim Ganetsky gan...@narod.ru mailto:gan...@narod.ru: 26.09.2014 20 tel:26.09.2014%2020:53, Bart ?: I propose to add two optional files sanitization/cleanup features: 1. Make all entries that have formatting errors fuzzy. 2. Remove PreviousMsgId (comments starting with #| ) from entries which are not fuzzy (in this case such comments are no longer relevant, but translation tools don't remove them themselves when removing fuzzy flag). No, I'm not going to, and I strongly feel we should no go that way. The tool is for checking. It's a pity. These features ease translations maintenance work and are not covered by PO file editors. Maybe it is better to add these feature to updatepofile? Do you mean the procedures in /ide/idetranslations and /lcl/translations or what? -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/27/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Do you mean the procedures in /ide/idetranslations and /lcl/translations or what? Maybe he means in the updatepofiles tool ($Lazarus)/tools/updatepofiles.lpi ? Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
2014-09-27 17:59 GMT+02:00 Bart bartjun...@gmail.com: On 9/27/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Do you mean the procedures in /ide/idetranslations and /lcl/translations or what? Maybe he means in the updatepofiles tool ($Lazarus)/tools/updatepofiles.lpi ? That is the one I meant, but I guess the IDE uses the same routines nowadays. Vincent -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On Sat, 27 Sep 2014 21:58:14 +0200 Vincent Snijders vincent.snijd...@gmail.com wrote: 2014-09-27 17:59 GMT+02:00 Bart bartjun...@gmail.com: On 9/27/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Do you mean the procedures in /ide/idetranslations and /lcl/translations or what? Maybe he means in the updatepofiles tool ($Lazarus)/tools/updatepofiles.lpi ? That is the one I meant, but I guess the IDE uses the same routines nowadays. Yes, both use the routines of the LCL unit translations. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 27/09/2014 21:58, Vincent Snijders ha scritto: 2014-09-27 17:59 GMT+02:00 Bart bartjun...@gmail.com mailto:bartjun...@gmail.com: On 9/27/14, Giuliano Colla giuliano.co...@fastwebnet.it mailto:giuliano.co...@fastwebnet.it wrote: Do you mean the procedures in /ide/idetranslations and /lcl/translations or what? Maybe he means in the updatepofiles tool ($Lazarus)/tools/updatepofiles.lpi ? That is the one I meant, but I guess the IDE uses the same routines nowadays. Yes, I checked, and currently updatepofiles in ($Lazarus)/tools is little more than a wrapper around the Translations unit, the same unit used by the IDE to manage translations. To summarize, for translations currently there's a number of scattered tools, providing each one a limited number of functions, with some amount of overlap and with some functions missing. In an ideal world 1. a maintainer would have a tool to quickly verify the state of the translations of the project he maintains, in order to possibly alert translators. 2. a translator would have a tool which quickly shows him the state of the translations he's responsible of, and is capable to perform a clean up, to edit the translations and to validate them, without being obliged to jump from one tool to another. Pochecker provides point 1. Nothing at the moment provides point 2. This can be achieved either extending Pochecker functions, or by creating a new tool, which could take advantage for a large extent of existing units and components, but assembling them having in mind translator needs. If Bart, who is the author and rightful owner of Pochecker, doesn't like the idea of making it too bloated, then creating a new tool becomes an option to be considered. Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/27/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: If Bart, who is the author and rightful owner of Pochecker, doesn't like the idea of making it too bloated, then creating a new tool becomes an option to be considered. First of all, this is a community driven project, so extending the PoChecker tool to have editing/fiximg/sanitizing capabilties is an option, if so desired by the community. I just did not envision this sort of tasks for the tool at all when I started out creating it. I already stated why I don't think extending it this way is a good idea earlier in this thread. About the scattering of tools/code for these tasks: I created the SimplePoFiles, which basically is a rip-off of the Translations unit (I cut out all parts I did not need) because: - I needed line support (on which line does a PoItem start in the Po file), and could not get this working using the Transations unit (which uses PChars everywhere (PChars still creap me out), so I translated all that code to be using Strings) - My version then turned out to be 4 times faster loading a Po file than the Translations unit, but that has been fixed in the mean time. - I did not want to drag in the lconvencoding unit (all Lazarus po files are UTF8, and lconvencoding drags in a whooping 1MB of static data). Later on somebody added i18n capabilities to the tool, so this argument now is not relevant anymore... Maybe extra the capabilities that SimplePoFiles has can be ported back to the Traslations unit. This would cut down on maintemance. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 26/09/2014 00:42, Maxim Ganetsky ha scritto: [..] I propose to add two optional files sanitization/cleanup features: 1. Make all entries that have formatting errors fuzzy. 2. Remove PreviousMsgId (comments starting with #| ) from entries which are not fuzzy (in this case such comments are no longer relevant, but translation tools don't remove them themselves when removing fuzzy flag). Currently Pochecker provides only information about po files, without touching them. If I understand properly, you propose to provide also some cleanup/sanitization functions. If such is the case, a +1 from me. Giuliano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/25/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Yes, sort of a sub-choice: all languages or just a language string . No need to be fussy: if a string for a non-existing language is selected, nothing is found, and that's all. Actually I think I will implement a filter of some sort on the ListBox holding the (non-master) files. I'll let the code after the SelectDirectoryDialog just find all files. What may be relatively easy to implement is just opening a specific file in the IDE editor .. I have no clue as to how to achieve this. So, help on that is needed. I believe I can do it, by taking advantage of some code I found already implemented by Graeme on the editor toolbar. Just let me know when you're done with your updates, so that my patches will not conflict with yours, as it may happen if we both modify the same unit at the same time I think you can assing an OnSelectItem for the ListView in GraphStat form and call some procedure there. Feel free to commit it, I will probably not interfere with my work. I'll be working on the mainform most of the time now (and the settings unit). Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
I propose to add two optional files sanitization/cleanup features: 1. Make all entries that have formatting errors fuzzy. 2. Remove PreviousMsgId (comments starting with #| ) from entries which are not fuzzy (in this case such comments are no longer relevant, but translation tools don't remove them themselves when removing fuzzy flag). No, I'm not going to, and I strongly feel we should no go that way. The tool is for checking. Currently it doesn't even have capabilities to create a PO-file from code. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
26.09.2014 20:53, Bart пишет: I propose to add two optional files sanitization/cleanup features: 1. Make all entries that have formatting errors fuzzy. 2. Remove PreviousMsgId (comments starting with #| ) from entries which are not fuzzy (in this case such comments are no longer relevant, but translation tools don't remove them themselves when removing fuzzy flag). No, I'm not going to, and I strongly feel we should no go that way. The tool is for checking. It's a pity. These features ease translations maintenance work and are not covered by PO file editors. Currently it doesn't even have capabilities to create a PO-file from code. This can be taken from Translations unit. -- Best regards, Maxim Ganetsky mailto:gan...@narod.ru -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/26/14, Maxim Ganetsky gan...@narod.ru wrote: Currently it doesn't even have capabilities to create a PO-file from code. This can be taken from Translations unit. I know, I cut all that out when creating the SimplePofiles unit. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 26/09/2014 18:51, Bart ha scritto: [..] Feel free to commit it, I will probably not interfere with my work. Before committing, I'll need to find a slot of free time, and then implement it :-) Giuliano -- Giuliano Colla Project planning question: when it's 90% done, are we halfway or not yet? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 24/09/2014 23:53, Bart ha scritto: On 9/21/14, Bart bartjun...@gmail.com wrote: Zeljan has fixed several ListView bugs now for GTK2 and QT Linux. - The GetItemAt() now works correctly for both Qt and GTK2. - QT showing all icons on a single line is a user error on my part, it needs IconOptions.AutoArrange to be True. (Actually it is a bug in the other WS that they AutoArrange always). Please test with r46317. Yes, now also here it looks much better. Qt icons are a little too crowded but perhaps there's still some ListView option to play with. Not a high priority in any case. What IMO isn't very practical are the percentages shown in the hint. The pie already gives you an idea of the percentages. The actual numbers would be much more useful: knowing that 20% needs translation, not knowing the total numbers, tells much less than 5 need translation, or 400 need translation. A 5 minutes work or a full day work! A trivial change, but very useful by my point of view. I'ḿ now planning on - extent the PoCheckerSettings Very good. - implement some mechanism (listbox probably) to access recently opened master/child po-files Very good - implement searching an entire directory for all po's (listing them in one of the lisboxes) This would be very useful to judge the state of the translations before a release. But another thing which might be very helpful for individual translators would be to search an entire directory tree for a specific language: e.g. sort of *.fr.po or *.de.po. Same idea of all po's, but limited to a specific language. Shown in a Listview, one would see in a glance all the files he/she needs to take care of. I'm not going to implement any form of editing of po-files inside this tool. It is not meant for that. What may be relatively easy to implement is just opening a specific file in the IDE editor, which already has the proper highlighter for po files: you check, find that a translation has some errors, open it in the Editor, edit it, and then check again. This, of course, only for the IDE version, not for the standalone one. Also any editing capabilities will start yet another series of feature request, until weǘe implemented yet another editor with tons of features, that in the end will not be any better than readily available tools for editing po-files. An option to open a given file in a user specied tool _may_ be an option, but is not very high on my prioritylist. Let me know what you think of my comments, and if there is some item I can take care of. Giuliano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/25/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: What IMO isn't very practical are the percentages shown in the hint. The pie already gives you an idea of the percentages. The actual numbers would be much more useful: knowing that 20% needs translation, not knowing the total numbers, tells much less than 5 need translation, or 400 need translation. A 5 minutes work or a full day work! A trivial change, but very useful by my point of view. The percentages are not written to the pie, so I wouldn't ditch them, maybe show both in the hint; 50 ranslated (95%)? But another thing which might be very helpful for individual translators would be to search an entire directory tree for a specific language: e.g. sort of *.fr.po or *.de.po. Same idea of all po's, but limited to a specific language. This can be incorporated in the find all po's in a directory probably? What may be relatively easy to implement is just opening a specific file in the IDE editor, which already has the proper highlighter for po files: you check, find that a translation has some errors, open it in the Editor, edit it, and then check again. This, of course, only for the IDE version, not for the standalone one. I have no clue as to how to achieve this. So, help on that is needed. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/25/14, Bart bartjun...@gmail.com wrote: The percentages are not written to the pie, so I wouldn't ditch them, maybe show both in the hint; 50 Translated (95%)? Done in r46328. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 25/09/2014 21:14, Bart ha scritto: On 9/25/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: [..] The percentages are not written to the pie, so I wouldn't ditch them, maybe show both in the hint; 50 ranslated (95%)? That's perfect. I've seen your next post, and updated. Now it tells everything one needs. But another thing which might be very helpful for individual translators would be to search an entire directory tree for a specific language: e.g. sort of *.fr.po or *.de.po. Same idea of all po's, but limited to a specific language. This can be incorporated in the find all po's in a directory probably? Yes, sort of a sub-choice: all languages or just a language string . No need to be fussy: if a string for a non-existing language is selected, nothing is found, and that's all. What may be relatively easy to implement is just opening a specific file in the IDE editor, which already has the proper highlighter for po files: you check, find that a translation has some errors, open it in the Editor, edit it, and then check again. This, of course, only for the IDE version, not for the standalone one. I have no clue as to how to achieve this. So, help on that is needed. I believe I can do it, by taking advantage of some code I found already implemented by Graeme on the editor toolbar. Just let me know when you're done with your updates, so that my patches will not conflict with yours, as it may happen if we both modify the same unit at the same time Giuliano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
25.09.2014 1:53, Bart пишет: On 9/21/14, Bart bartjun...@gmail.com wrote: I'ḿ now planning on - extent the PoCheckerSettings - implement some mechanism (listbox probably) to access recently opened master/child po-files - implement searching an entire directory for all po's (listing them in one of the lisboxes) I'm not going to implement any form of editing of po-files inside this tool. It is not meant for that. I propose to add two optional files sanitization/cleanup features: 1. Make all entries that have formatting errors fuzzy. 2. Remove PreviousMsgId (comments starting with #| ) from entries which are not fuzzy (in this case such comments are no longer relevant, but translation tools don't remove them themselves when removing fuzzy flag). Also any editing capabilities will start yet another series of feature request, until weǘe implemented yet another editor with tons of features, that in the end will not be any better than readily available tools for editing po-files. An option to open a given file in a user specied tool _may_ be an option, but is not very high on my prioritylist. -- Best regards, Maxim Ganetsky mailto:gan...@narod.ru -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/21/14, Bart bartjun...@gmail.com wrote: On 9/21/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Yes. That's the problem. e.g. you put the mouse on the first visible Icon, and you get the hint of the first Icon of the original window (before scrolling) [..] ... Yes. Should we open a bugtracker issue? Yes we should. Zeljan has fixed several ListView bugs now for GTK2 and QT Linux. - The GetItemAt() now works correctly for both Qt and GTK2. - QT showing all icons on a single line is a user error on my part, it needs IconOptions.AutoArrange to be True. (Actually it is a bug in the other WS that they AutoArrange always). Please test with r46317. I'ḿ now planning on - extent the PoCheckerSettings - implement some mechanism (listbox probably) to access recently opened master/child po-files - implement searching an entire directory for all po's (listing them in one of the lisboxes) I'm not going to implement any form of editing of po-files inside this tool. It is not meant for that. Also any editing capabilities will start yet another series of feature request, until weǘe implemented yet another editor with tons of features, that in the end will not be any better than readily available tools for editing po-files. An option to open a given file in a user specied tool _may_ be an option, but is not very high on my prioritylist. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 21/09/2014 00:27, Bart ha scritto: [..] You mean, you scroll, then put the mouse over an icon and wait for the hitn, and the hint is the wrong one? Yes. That's the problem. e.g. you put the mouse on the first visible Icon, and you get the hint of the first Icon of the original window (before scrolling) [..] It would mean that this part: pt:= listview.ScreenToClient( mouse.cursorpos ); item := listview.GetItemAt( pt.x, pt.y ); does not function properly unde GTK2 Yes. Should we open a bugtracker issue? With Qt no change: Icons are too small, I tested QT-Linux, and IIRC the icons were the same size as on GTK2 all items in one row, Yes, that sucks. Do you know if QT interface has a native ListView, or how is the drawin done? I know that Qt in itself provides a Qt_Listview, which should emulate Windows listview, but I don't know to what extent it's currently exploited. But, Qt is somehow optional (even if IMHO Qt widgetset is better and more complete than Gtk2) and we may live with it, if you manage to make it work with Gtk2. Many seem to prefer QT on Linux over GTK2 (visually more attractive?). I'm among them. Not only more attractive, but also significantly less buggy. Currently I'm trying to put some order in canvas drawing, because it would appear that each function and each widgetset has its own ideas of what the painting rectangle should be :-( , creating a mess if you want to have an ellipse inscribed in a rectangle, a pie slice into an ellipse, etc. and, in the process I'm trying to see if we may get a decent antialiasing for shapes and not only for fonts. As soon as I'll have some time I'll give a look to the ListView implementation in Gtk2 and Qt, if nobody else is willing to do it. In the meantime, did you give a look to my implementation of the graph window? It doesn't exploit ListView, but it provides the same final result. It only lacks a better arrangement of Icons, but it's a rather trivial matter (after creating all of them, find the maximum width, then use this value to arrange them neatly). It might be a way to get more quickly a result, unless you want to take this occasion to try and fix ListView. Giuliano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/21/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Yes. That's the problem. e.g. you put the mouse on the first visible Icon, and you get the hint of the first Icon of the original window (before scrolling) [..] ... Yes. Should we open a bugtracker issue? Yes we should. I already have a listView example somewhere on my Linux VM, so when I have time i'll do so. I know that Qt in itself provides a Qt_Listview, which should emulate Windows listview, but I don't know to what extent it's currently exploited. I find it hard to beleive that the native QT implementatiosn does not provide some method to allow more than one l;ne... In the meantime, did you give a look to my implementation of the graph window? I did have a look at your code. It looked impressive, but at the time I already implemented the ListView approach. It doesn't exploit ListView, but it provides the same final result. It only lacks a better arrangement of Icons, but it's a rather trivial matter (after creating all of them, find the maximum width, then use this value to arrange them neatly). Because all the drawing and all calculations need to be done by ourselves, I decided to use a standard LCL control that is _supposed_ to do all that just by itself. This way we keep re-inventing the wheel. It might be a way to get more quickly a result, unless you want to take this occasion to try and fix ListView. Maybe the current state of things (and the fact we show how awkward the results can look) will trigger people in fixing the TListView on GTK2 and QT. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 19/09/2014 22:30, Bart ha scritto: I refactored the GraphStat form using a TListView and a TImageList. See r46256. Bad news! On Windows it looks fine, it would just require some ironing (next hints shows only if you click on an empty area before) but on Linux it doesn't work. Windows: http://www.bononiadocta.it/Lazarus/Pochecker-a.png Linux (Qt Widgetset): http://www.bononiadocta.it/Lazarus/Pochecker-a1.png Linux (Gtk2 Widgetset): http://www.bononiadocta.it/Lazarus/Pochecker-a2.png It would appear that the Icon view of Listview (/ViewStyle:=vsIcon/) has not been implemented on those platforms. Actually ListView is a Windows native function, therefore on Windows it works by default. For other platforms it must be implemented. Two solutions: a) Someone implements it. b) We take a different approach. Giuliano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
The Qt seams to be working fine, it just puts all icons in a very long line instead of spreading them out in the area. ListView is the hardest control to implement always =) because it has multiple styles and so many details... Felipe Monteiro On Sat, Sep 20, 2014 at 10:57 AM, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Il 19/09/2014 22:30, Bart ha scritto: I refactored the GraphStat form using a TListView and a TImageList. See r46256. Bad news! On Windows it looks fine, it would just require some ironing (next hints shows only if you click on an empty area before) but on Linux it doesn't work. Windows: http://www.bononiadocta.it/Lazarus/Pochecker-a.png Linux (Qt Widgetset): http://www.bononiadocta.it/Lazarus/Pochecker-a1.png Linux (Gtk2 Widgetset): http://www.bononiadocta.it/Lazarus/Pochecker-a2.png It would appear that the Icon view of Listview (ViewStyle:=vsIcon) has not been implemented on those platforms. Actually ListView is a Windows native function, therefore on Windows it works by default. For other platforms it must be implemented. Two solutions: a) Someone implements it. b) We take a different approach. Giuliano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- Felipe Monteiro de Carvalho -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/20/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Bad news! On Windows it looks fine, it would just require some ironing (next hints shows only if you click on an empty area before) For me this part behaves as expected (Win7). but on Linux it doesn't work. ... It would appear that the Icon view of Listview (/ViewStyle:=vsIcon/) has not been implemented on those platforms. a) Someone implements it. Preferrably b) We take a different approach. If we keep working around it, then this will never get fixed. I could find an issue in bugtracker that says LargeIcons do not work on Carbon, I could not find an issue stating the same problem for GTK2, so why doesn't it draw the icons there? Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
The restricted tab in OI only mentions Color, Columns, Font and HideSelection as possible restricted properties If this component is as broken (on non-windows) as it seems to be, ther should be far more restrictions mentioned in OI. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/20/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: ... but on Linux it doesn't work. I moved the calling of DrawGraphs to the formś OnActivate, and now the Icons are there. Please test with r46266. Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 20/09/2014 17:51, Bart ha scritto: On 9/20/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: ... but on Linux it doesn't work. I moved the calling of DrawGraphs to the formś OnActivate, and now the Icons are there. Please test with r46266. Now on Linux Gtk2 there's a significant improvement. However there's still an issue: when there are many files, and you must scroll the window, the hint shown is not related to the proper icon, but to the one which would have been in that position before scrolling. I saw some discrepancies, and I suspected an error in the pie drawing. Then, in order to verify, I added one more line to the hint, with AStat.PoName, and I realized that it was simply showing the wrong Stats. Does it work in Windows? /Lazarus/languages/lazaruside.xx.po should have enough files to generate a scroll. Maybe you'll find a way adjust the Y coordinate for Listview.GetItemAt, but I'm afraid that we're again in trouble, because the procedure TControl.GetClientScrollOffset is implemented just with /Result:=Point(0,0);/ ! With Qt no change: Icons are too small, all items in one row, and no hint shown. But, Qt is somehow optional (even if IMHO Qt widgetset is better and more complete than Gtk2) and we may live with it, if you manage to make it work with Gtk2. Giuliano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
Il 20/09/2014 14:44, Felipe Monteiro de Carvalho ha scritto: The Qt seams to be working fine, it just puts all icons in a very long line instead of spreading them out in the area. If it weren't that the purpose would be to show in a compact way the situation of as many translations as possible, and that it doesn't show the hint (required to have actual numbers, and maybe some extra information)! ListView is the hardest control to implement always =) because it has multiple styles and so many details... That's what frightens me. I'm under the impression that someone in the past has implemented the bare minimum he needed for a specific purpose, and since then nobody else dared to put his hands on that matter! Giuliano -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Pochecker (was Fuzzy traslations ignored)
On 9/20/14, Giuliano Colla giuliano.co...@fastwebnet.it wrote: Now on Linux Gtk2 there's a significant improvement. Fine! However there's still an issue: when there are many files, and you must scroll the window, the hint shown is not related to the proper icon, but to the one which would have been in that position before scrolling. You mean, you scroll, then put the mouse over an icon and wait for the hitn, and the hint is the wrong one? Maybe you'll find a way adjust the Y coordinate for Listview.GetItemAt, but I'm afraid that we're again in trouble, because the procedure TControl.GetClientScrollOffset is implemented just with /Result:=Point(0,0);/ ! On windows it displays the correct hint. It would mean that this part: pt:= listview.ScreenToClient( mouse.cursorpos ); item := listview.GetItemAt( pt.x, pt.y ); does not function properly unde GTK2 With Qt no change: Icons are too small, I tested QT-Linux, and IIRC the icons were the same size as on GTK2 all items in one row, Yes, that sucks. Do you know if QT interface has a native ListView, or how is the drawin done? But, Qt is somehow optional (even if IMHO Qt widgetset is better and more complete than Gtk2) and we may live with it, if you manage to make it work with Gtk2. Many seem to prefer QT on Linux over GTK2 (visually more attractive?). Bart -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus