Skip to content

An awesome development tool for automating localization progress in your XCode Project

License

Notifications You must be signed in to change notification settings

bigearsenal/XCodeLocalizationHelper

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

XCodeLocalizationHelper

An awesome development tool for automating localization progress in your XCode Project!

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Installation
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact

About The Project

LocalizationHelper Screen Shot

Localizing project is quite a hard and boring task in iOS/macOS application development process, so a lot of developers (me included) have skipped localizing during the first release of the app until the time when they are obligated to support multiple languages. And then the nightmare happens because they have to look for all strings and texts in UI, create strings files, translate each file (or send them to a translator).

There are some tools that help developers generate strings files like stringsgen, or generate api for localization like swiftgen. But these tools or these tools combined are simply just not enough, we still have to do a lot of works to make an awesome multilanguage-supported application.

Then XCodeLocalizationHelper (or LocalizationHelper) comes as a rescue.

Here's why:

  • LocalizationHelper helps you set up your project for localization if it has not been supported yet.
  • You can create and translate new keys for each Localizable.strings files in a blink of an eye with GoogleTranslate open API (steel works from your company's translators 😄).
  • You can edit the translation before adding to the project.
  • You can immediately get the code you need in clipboard or using swiftgen for generating API after adding any key to your strings files using LocalizationHelper.
  • See demo.

So if you like this project, I kindly ask you to buy me a coffee. Your support would be highly appreciated.

Built With

Installation

Getting started by downloading the installer of the latest version of the app.

Unzip the .zip file, copy it to your ~/Applications folder, open it and you're ready to go.

Usage

Add configuration file named .xcode-localization-helper-config.json into your project's root folder

{
  "automation": {
    "script": "/opt/homebrew/bin/swiftgen config run --config ${PROJECT_DIR}/swiftgen.yml",
    "pathType": "absolute"
  }
}

At the first time when you open the project, you will see the Open a .xcodeproj file button. Click it and open your .xcodeproj file.

If your project has not supported localization yet, then there will be a Localize button that helps you register your app for localization, add knownRegions, add .lproj folders and Localizable.strings files for these languages you choose.

Choose language to localize in LocalizationHelper

After succesfully setting up your project for localization, you will see the main screen of application that helps you to add new keys and their translations to the relative .strings files.

You can now add some keys and translate them by clicking Translate button.

Add and translate key in LocalizationHelper

Choose swiftgen option if you are using swiftgen for creating strings API (the swiftgen.yml must be located at $PROJECT_ROOT/swiftgen.yml and pod swiftgen must be installed in your Pods/), or leave it unselected and choose the pattern you want when copying to clipboard.

Add and copy to clipboard in LocalizationHelper

And the string with pattern you entered will be copied to clipboard. For example: NSLocalizedString("Submit", comment: "").

And that's it, you now can paste directly this text to your swift files!

For more examples, See demo

Roadmap

  • Support stringsdict.
  • Support edit existing key / value.
  • Support adding, deleting new languages alongside existing languages.

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Download and install tuist
  3. Navigate to folder and run tuist generate
  4. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  5. Commit your Changes (git commit -m 'Add some AmazingFeature')
  6. Push to the Branch (git push origin feature/AmazingFeature)
  7. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Chung Tran - twitter - bigearsenal@gmail.com

Project Link: https://github.com/bigearsenal/XCodeLocalizationHelper

About

An awesome development tool for automating localization progress in your XCode Project

Resources

License

Stars

Watchers

Forks

Packages

No packages published