Skip to content

A simple script to localize your Localizable.xcstrings file with ChatGPT

Notifications You must be signed in to change notification settings

ConfuseIous/Xcode-Localizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iOS - Localiser

⚠️ NOTE

This script has been superseded by AutoLocalizer, a free GUI that translates your strings locally using an open Large Language Model rather than ChatGPT. Not only does this require less effort, it's also more private as your data doesn't leave your Mac at all. This script will still continue to work for the foreseeable future if you prefer to use ChatGPT.

A simple script to localize your Localizable.xcstrings file with ChatGPT

Usage

  1. Open your Localizable.xcstrings file with a text editor and copy it into data.json.
  2. The ChatGPT API costs money and isn't really necessary here, so instead, use extract.py to extract all strings from your project and translate them with ChatGPT. Example prompt:
"Please help me translate all these sentences into german:"
  1. Copy the output into the sentence_str variable in merge.py
  2. Specify your language_key in merge.py
  3. Run merge.py. This will update your data.json file.
  4. Open your Localizable.xcstrings file with a text editor and replace its contents with the output of merge.py (which you will find in data.json)

To add more languages, repeat steps 2-5, and then finish off with 6.

Contributing

Pull requests are welcome. I did all this in like 30min so there are almost certainly edge cases I haven't thought of.

License

MIT

About

A simple script to localize your Localizable.xcstrings file with ChatGPT

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages