Skip to content

Generated identifier is empty #179

@leszko11

Description

@leszko11

During the implementation of Strings Catalog support for SwiftGen @jandrewmoore raised an issue with the output generation for localization keys that contain only placeholders, such as %@ %@.
In this case, SwiftGen generates the following code:

/// %1$@ %2$@
internal static func (_ p1: Any, _ p2: Any) -> String {
  return L10n.tr("Localizable", "%@ %@", String(describing: p1), String(describing: p2), fallback: "%1$@ %2$@")
}

This output causes a compilation error.

Would it make sense to add a validation step to check if the identifier is not empty in such cases here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions