Air Strings is a command-line tool for translating localizable strings in Google Sheets.
Tis is usually done in Xcode or AppCode. The preferred format is "key" = "value"; // comment
🤷♂️
The command like airstrings push --path en/Localizable.strings
will upload key-value pairs with their comments into the Google spreadsheet.
Then you translate strings into any language. By the way, Google Sheets are perfect for collaboration!
Once translation is done, download all strings back using a command like airstrings pull --path ru/Localizable.strings
.
In order to build an executable you need a client identifier and a secret for Google Sheets API. Please follow instructions at https://developers.google.com/sheets/api/guides/authorizing#OAuth2Authorizing to generate something like this:
Once generated, copy and replace string values for CLIENT_ID
and CLIENT_SECRET
in the following script:
git clone git@github.com:CirkusApp/airstrings.git
cd airstrings
CLIENT_ID=1234567890-abcdefg0987654321.apps.googleusercontent.com
CLIENT_SECRET=abcdefgh123456789
echo "GCC_PREPROCESSOR_DEFINITIONS = \$(inherited) \
AIR_GOOGLE_SHEETS_CLIENT_IDENTIFIER=$CLIENT_ID \
AIR_GOOGLE_SHEETS_CLIENT_SECRET=$CLIENT_SECRET" > \
AirSecrets.xcconfig
swift package generate-xcodeproj \
--xcconfig-overrides AirSecrets.xcconfig
xcodebuild \
-project airstrings.xcodeproj \
-target airstrings \
-configuration Release
At the moment Air Strings is available only after building manually:
build/Release/airstrings <command> [options]
Once the app is ready for public, we’ll probably publish at Brew.
- Renew access token when it’s expired
- Improve error messages by overriding
AirStrings.Error.localizedDescription
- Write
Makefile
withswift build
and.xcconfig
passed via-Xcc
- Release a binary for public and implement
brew install airstrings
- Use OysterKit for parsing
.strings
- Add support for input configuration to parse Java
.properties
files usingOysterKit
- Open the website Cirkus Open Source at https://cirkusapp.github.io
- Move Air Strings website to https://cirkusapp.github.io/airstrings
- Maybe simplify API URL building by using URITemplate.swift
- Configure output format using Stencil or the like
- SwiftCLI — cool processor for command-line interfaces
- PathKit — nice helpers for writing and reading local files
- OAuthSwift — native library for Google Auth and Requests
Vadim @Shpakovski.
© 2018 Farmers WIFE S.L.
Air Strings is licensed under MIT License.