How can I remove a localization from a String Catalog in a Swift Package?

Hello,

I'm trying to remove a localization from a String Catalog in a Swift Package. How can I do that?

I tried to remove the file and create a new one, but all the languages are back. The only place where I've found a reference to the languages is in Package/.swiftpm/xcode/package.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate

But I don't know how to edit this file to remove a language.

Thank you, Axel

I wanted to drop a link to your equivalent thread on Swift Forums: How can I remove a localization from a String Catalog in a Swift Package?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hello,

The solution I came up to was:

  1. Close Xcode.
  2. Remove the hidden folder .swiftpm from the Package folder. I noticed the UserInterfaceState.xcuserstate file in a subfolder of this folder contained some references to the languages (I could find language codes in it like "pt-PT").
  3. Open the package again with Xcode.

The languages that weren't translated at all (0% progress) got removed from the string catalog. The other languages where at least one string was translated stayed in the string catalog.

I don't think this is ideal but I hope it can help others.

Axel

How can I remove a localization from a String Catalog in a Swift Package?
 
 
Q