What version of Xcode are you testing this with? I used Xcode 10.1 to create a project that has two targets, and then added a
Common
directory containing a
Localizable.strings
. The exported
en.xcloc
looks like this
en.xcloc
en.xcloc/Localized Contents
en.xcloc/Localized Contents/en.xliff
en.xcloc/Notes
en.xcloc/contents.json
en.xcloc/Source Contents
en.xcloc/Source Contents/TargetA
en.xcloc/Source Contents/TargetA/en.lproj
en.xcloc/Source Contents/TargetA/en.lproj/InfoPlist.strings
en.xcloc/Source Contents/TargetA/Base.lproj
en.xcloc/Source Contents/TargetA/Base.lproj/LaunchScreen.storyboard
en.xcloc/Source Contents/TargetA/Base.lproj/Main.storyboard
en.xcloc/Source Contents/TargetB
en.xcloc/Source Contents/TargetB/en.lproj
en.xcloc/Source Contents/TargetB/en.lproj/InfoPlist.strings
en.xcloc/Source Contents/TargetB/Base.lproj
en.xcloc/Source Contents/TargetB/Base.lproj/LaunchScreen.storyboard
en.xcloc/Source Contents/TargetB/Base.lproj/Main.storyboard
en.xcloc/Source Contents/Common
en.xcloc/Source Contents/Common/en.lproj
en.xcloc/Source Contents/Common/en.lproj/Localizable.strings
As you can see, there’s only one copy of
Localizable.strings
is the
Source Contents
directory. More to the point, the string I put in
Localizable.strings
only shows up once in the
en.xliff
.
$ grep aaa en.xcloc/Localized\ Contents/en.xliff
<trans-unit id="aaa">
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"