Skip to content

Disable parameters in generated strings or get strings with "%@" and "%1$s%2$s%3$s..." as is #941

@gerchicov-vg

Description

@gerchicov-vg

According to your readme:

let string = String(format: NSLocalizedString("welcome.withName", comment: ""), locale: NSLocale.current, "Arthur Dent")

becomes

let string = R.string.localizable.welcomeWithName("Arthur Dent")

But there is a problem - sometimes I don't need to insert localised string into another one immediately. What to do for example if these 2 strings have different colours? If I used NSLocalizedString I could transform "format" string into NSAttributedString, color its different parts, apply localization and only then combine these multiple strings into a single one.

P.S. Swiftgen has the same problem and doesn't resolve it for years. Hope this repo is maintained better.

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