Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated identifier is empty #179

Open
leszko11 opened this issue Oct 19, 2024 · 0 comments
Open

Generated identifier is empty #179

leszko11 opened this issue Oct 19, 2024 · 0 comments

Comments

@leszko11
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant