Translate 200 strings to German, Spanish, French, Japanese, Korean, and Brazilian Portuguese, bringing localization coverage from 35% to 95%. Also adds translation helper script for future localization work. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
30 lines
786 B
Python
30 lines
786 B
Python
#!/usr/bin/env python3
|
|
import json
|
|
import sys
|
|
|
|
with open('/Users/treyt/Desktop/code/Feels/Feels/Localizable.xcstrings', 'r') as f:
|
|
d = json.load(f)
|
|
|
|
strings = d.get('strings', {})
|
|
|
|
# Get strings that need translation
|
|
missing = []
|
|
for key, val in strings.items():
|
|
if not key.strip():
|
|
continue
|
|
localizations = val.get('localizations', {})
|
|
|
|
# Check if German has a translation
|
|
if 'de' not in localizations:
|
|
missing.append(key)
|
|
elif 'stringUnit' in localizations.get('de', {}):
|
|
state = localizations['de']['stringUnit'].get('state', '')
|
|
if state != 'translated':
|
|
missing.append(key)
|
|
|
|
# Print all missing strings
|
|
print("Missing translations:")
|
|
for s in missing:
|
|
print(repr(s))
|
|
print(f'\nTotal missing: {len(missing)}')
|