Skip to content

Missing PO Entry when using String Concatenation (+) or Referencing Text defined in const/Field/Property/Variable #87

Description

@BrunoJuchli

Repro Cases

String Concatenation +

S["Hey there " +
   "how do you like this?" + 
   "I know it's not recommended"];

String Reference (Field/Property...)

const string MyMessage = "This is my message";

....

S[MyMessage];

Actual Behavior

extractpo runs successfully, but the generated *.po file does not contain any entries for these calls.

Expected (Desired) Behavior

Either one of the following would be fine for me:

  • not support these and communicating it when hitting such a case:
    • crash the app with error message indicating the problem
    • exit the app with an error code, and write to
  • support these so that Hey there how do you like this? I know it's not recommended / This is my message turns up in the PO file, respectively.
    • note that the case of referencing an item would require either
      • a) using the S[...] line as context
      • b) or the one of the field/property, but then would require duplicate detection, because the same field/property might be referenced twice!

Note: for the string +-concatenation I would prefer if it would be supported. The reason is, that this is the only supported way how to break a long single-line string into multiple source code lines. All other approaches introduce new lines.
Also note, that the +-concatenation is compiler optimized so that the compilation actually contains a single string -> in the compiled assembly there is no difference between "a" + "b" and "ab"! Something I've learned today :D

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions