String catalog and local package

Hello Apple community !

I'm facing an issue regarding xcstrings in a local package in my project.

It's an iOS application with a local package containing multiple targets. The Localizable.xcstrings is located in the app target and contains keys for the app and targets of the local package (Views in the targets look for keys in the main bundle)

My issue is that auto detection/extraction seems to work only for keys used inside the app bundle. It doesn't look in the package. However, if I add a Localizable.xcstrings inside a package target, it gets populated.

Is this normal behaviour & is there any way to make extraction put the keys in the main bundle xcstrings instead ? I feel like it should be normal behaviour if no xcstrings is found in the package

My fallback would be to set all keys in manual extraction state but it's not ideal ;)

Thanks in advance for the great work Eric

Answered by Developer Tools Engineer in 803566022

Hello,

Auto-extraction is only supported for String Catalogs in the same target as the code defining the strings, which is the best practice for localizable strings. That way clients of the package/target/framework aren’t required to have the strings defined in their own bundle.

But please feel free to file a feedback report if you’d like to see improvement in this area.

Hello,

Auto-extraction is only supported for String Catalogs in the same target as the code defining the strings, which is the best practice for localizable strings. That way clients of the package/target/framework aren’t required to have the strings defined in their own bundle.

But please feel free to file a feedback report if you’d like to see improvement in this area.

String catalog and local package
 
 
Q