yonaskolb / yonaskolb/XcodeGen
Localizable.strings files not correctly grouped when referenced directly
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 8.8k
- Forks
- 908
- Avg merge
- 17d 14h
- Merged PRs (30d)
- 2
Description
With this project spec:
{
"name": "Test",
"options": {
"createIntermediateGroups": true
},
"targets": {
"ResourceBundle": {
"platform": "iOS",
"sources": [
"Resources/Strings/Base.lproj/Localizable.strings"
],
"type": "bundle"
}
}
}
And this folder structure:
.
├── Resources
│ └── Strings
│ └── Base.lproj
│ └── Localizable.strings
└── project.json
When I run XcodeGen like this:
~/dev/XcodeGen/.build/debug/xcodegen --spec project.json
I end up with a project where the Localizable.strings file isn't correctly setup as a localized file. In this case it looks like this:

If you change the source path to be Resources/Strings instead of Resources/Strings/Base.lproj/Localizable.strings this issue is fixed and it looks like this:

But sometimes having the complete path to the file is useful so you don't include resources that shouldn't be a part of your target.
Here's the sample project showing this issue: XcodeGenLocalizable.zip
This was tested with b918a1e76b4b98883de2a8ba99a5dbce435764f8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the supplied project.json and Resources/Strings/Base.lproj/Localizable.strings using xcodegen --spec project.json. Trace how a directly referenced Localizable.strings path is added to the generated Xcode project, then verify that the file is grouped as a localized resource without including unrelated resources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100