Skip to content

XML processor generates invalid code for printf style formattingย #33

@dalewking

Description

@dalewking

If you have a string that has printf format specifiers like:

    <string name="total_duration">%1$s Total</string>

It generates:

    override val totalDuration = { p0: String -> 
        "%s Total"
            .format(p0)
    }

Problem is there is no such format method on string at least in common code.

For most simple cases you could simply generate string interpolation code and if the format specifier is more complex generate warnings

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