What is the text of those lines the IDE automatically inserts into new form etc. declarations in the localized Delphi versions?

What is the text of those lines the IDE automatically inserts into new form etc. declarations in the localized Delphi versions?

In English they are:

{ Private declarations }
{ Protected declarations }
{ Public declarations }
{ Published declarations }

As far as I know there are German, French and Japanese localizations. What's the text there? And please make sure you get the case right.

Comments

  1. { Private-Deklarationen }
    { Protected-Deklarationen }
    { Public-Deklarationen }
    { Published-Deklarationen }

    { Déclarations privées }
    { Déclarations protégées }
    { Déclarations publiques }
    { Déclarations publiées }

    Sorry, no Japanese.

    ReplyDelete
  2. Having a private keyword, followed by {private declarations} is a good example of a bad comment.

    ReplyDelete
  3. Wouter van Nifterick I guess Thomas is working on some functionality to automatically get rid of these.

    ReplyDelete
  4. The Japanese form is somewhat tricky, as it requires Ansi CodePage 932. The corresponding texts are

    { Private 宣言 }
    { Protected 宣言 }
    { Public 宣言 }
    { Published 宣言 }

    The Ansi codes of the two characters are: 90 E9 8C BE

    The UTF-8 codes are: E5 AE A3 E8 A8

    ReplyDelete
  5. Thanks a lot Uwe Raabe. Yes, you are right, I am trying to get rid of these stupid comments. I have been deleting them manually all my life as a Delphi programmer. Just to think of the time I wasted doing that makes me sad. So far, it's still a partly manual process since I found no way to detect when a new form is being created. But I'm sure there is one.

    ReplyDelete
  6. Perhaps IOTAProjectNotifier.ModuleAdded could be a start.

    ReplyDelete
  7. Attila Kovacs Hm, in this example, the comments are in English.

    ReplyDelete
  8. Uwe Raabe Yes, but unfortunately that one is also called when an existing module (form/unit) is being added to a project. Maybe I could check whether there are any components on the form or any existing methods. But that would still leave those comments in predefined forms e.g. the About form.

    ReplyDelete
  9. I found some more source code on Japanese websites with Japanese comments but English { Private / Public etc. declarations }.
    Uwe Raabe what is your source for { Private 宣言 } etc. ?

    ReplyDelete
  10. Thomas Mueller Switching the IDE to Japanese with BDSSetLang and creating a new component. The sources for these templates are stored in delphicoreideXXX.bpl and its similar named language resources. Unfortunately each template comes with its own source text, so there is still a chance that the new form template differs from the new component template - although I couldn't find any differences on a first glance.

    ReplyDelete
  11. Remember, in Delphi we can repeat the scopes w/o warnings:

    Public
    ....
    Private
    ....
    Private
    ...

    (On a phone, sry).

    ReplyDelete
  12. I implemented the searching for and removing part (used RegEx or plain text for that). I still haven't found a way to automatically call this.
    I used the functionality today for the first time. Felt great. ;-)
    (And I used it yesterday for a totally unrelated task with more complex RegExes. Worked fine too.)

    ReplyDelete
  13. Thomas Mueller I guess, having a hotkey for it might be sufficient.

    ReplyDelete
  14. Interesting feature. Now it only needs some favorites.

    ReplyDelete

Post a Comment