Skip to content

ggdxgettext capture const string array values #3

@scsneed

Description

@scsneed

I've used dxgetttext with Delphi for several years, and it's been a real boon. But there is one parser function in ggdxgettext that really needs to be added. Consider this very common sort of code:

type
  TValueDisplayFormat = (dfDecimal, dfHex, dfBinary);
const
  ValueDisplayFormatNames: Array[TValueDisplayFormat] of String = ('Decimal', 'Hex', 'Binary');
{...}
  Label1.Caption := _(ValueDisplayFormatNames[MyObject.DisplayFormat]);

ggdxgettext recognizes that the call to _() above references something it doesn't understand and throws a warning. While having it recognize that the reference is to a defined const array would be nice, that's not necessary - the type and const declarations may be (likely are) in some other file, and keeping track of that sort of thing across files is beyond the scope of the tool. But what it absolutely should do is to capture the strings in any declared const array of strings as translatable msgid's.

We use this type of construct heavily, and I see this sort of thing all the time in other people's code. Please consider adding this to the parser!! Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions