SwiftGen icon indicating copy to clipboard operation
SwiftGen copied to clipboard

Show translations instead of plural key for entries from stringdict files

Open PaulTaykalo opened this issue 1 year ago • 1 comments

  • [x] I've started my branch from the develop branch (gitflow)
    • [x] And I've selected develop as the "base" branch for this Pull Request I'm about to create
  • [x] I've added an entry in the CHANGELOG.md file to explain my changes and credit myself
    (or added #trivial to the PR title if I think it doesn't warrant a mention in the CHANGELOG)
    • [x] Add the entry in the appropriate section (Bug Fix / New Feature / Breaking Change / Internal Change)
    • [x] Add a period and 2 spaces at the end of your short entry description
    • [x] Add links to your GitHub profile to credit yourself and to the related PR and issue after your description

Currently, SwiftGen, when parsing .stringdict for earch entry generates "translation" in format /// Plural format key: "%#@apples@", which is a bit confusing. Since for other files i.e. .strings, real translation will be included.

So this PR changes what will be returned in the Strings.Entry. Now, real translation will go to the translation, and additional optional parameter formatKey added for the cases, if formatKey needed for the templates (i.e. in comments)

PaulTaykalo avatar Jun 19 '24 15:06 PaulTaykalo

I'm currently reading the whole conversation why is plularFormat There, But still, thinkg that from the developer's perpsective - having translation (any translation) in the Entry is more correct than having "format" in the translation key. https://github.com/SwiftGen/SwiftGen/pull/634

PaulTaykalo avatar Jun 19 '24 19:06 PaulTaykalo