Skip to content

XML processor ignores positional index on parametersΒ #35

@dalewking

Description

@dalewking

When specifying printf format strings you can include a parameter index to refer to which of the arguments you are referring to. For example this would include the first parameter followed by the second parameter

    <string name="foo">%1$d - %2$s</string>

This is important because not all translations will use the paramters in the same order and in some cases may use a paramter more than once. A particular translation is allowed to do something like:

    <string name="foo">%2$s - %1$d - %2$s</string>

The XML processor simply throws away the index and assumes that all translations use the parameters only once and in the same order. For the first one it will generate a function with Int and String parameters. The second one will generate parameters of String, Int, String

Metadata

Metadata

Assignees

No one assigned

    Labels

    codegen: android-xmlCodegen from Android String Resources conversion issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions