Description
A quick utility to remove a specific language from Apple's String Catalog (.xcstrings) files using jq.
Credit: This solution was provided by Jayson Rhynas, Co-founder of medlylabs.com.
The Problem
Currently, Xcode's String Catalog editor doesn't provide a global "Delete Language" option. Manually deleting a language from every single key is tedious for large projects.
The Solution: jq
If you have jq installed (via brew install jq), you can strip a language from the JSON structure of the .xcstrings file directly.
One-Liner (Standard)
Replace fr with the language code you want to remove (e.g., de, es, zh-Hans).
# 1. Back up your file
cp Localizable.xcstrings Localizable.xcstrings.bak
# 2. Filter out the unwanted language and overwrite
jq '.strings |= map_values(del(.localizations."fr"))' Localizable.xcstrings.bak > Localizable.xcstrings