Swiftpack.co - Package - AckeeCZ/ACKLocalization

ackee|ACKLocalization

Build Status Version License

ACKLocalization

Simply localize your app with translations stored in Google Spreadsheet.

Installation

Cocoapods

  1. Add ACKLocalization to your Podfile
pod 'ACKLocalization`
  1. Install pods
pod install

Manually

Just download binary from Github release

Usage

Get your Google Spreadsheet identifier

  1. your spreadsheet needs to be published - File -> Publish to the web -> Publish
  2. here you will get a publish link which will have the format similar to this, your document ID is located after the first hyphen to the next slash
https://docs.google.com/spreadsheets/d/e/2PACX-<here_is_your_document_id>/pubhtml

NOTE: Don't worry, we're thinking about simplifying this process

Calling ACKLocalization

Just call the binary with arguments that are appropriate for you.

Pods/ACKLocalization/Localization "<document_id>" "<name_of_column_with_key>" '<column_name_to_language_code_map>' "<destination_where_your_app_stores_localized_data>" "<name_of_localizable_file>" 

Well this code might be a bit confusing so let's give it an example.

Example

We love to call ACKLocalization from Xcode (we have a separate aggregate target which calls the script) so I'll stick with that with this example.

Project structure

This is example folder structure of the project

|-Podfile
|-Project.xcodeproj
|-Project
|---Resources
|------en.lproj
|----------Localizable.strings
|------cs.lproj
|----------Localizable.strings

Spreadsheet structure

This is example structure of the spreadsheet with translations

| key_ios | EN | CS | |---------|-------|------| | hello | Hello | Ahoj |

ACKLocalization also now supports plist files. Simply prefix the key with plist.NameOfPlist - please note that NameOfPlist is case-sensitive.

Example call

This is the example call of ACKLocalization

"$PROJECT_DIR/Pods/ACKLocalization/Localization" "<document_id>" "key_ios" '{"EN": "en", "CS": "cs"}' "$PROJECT_DIR/Project/Resources" "Localizable.strings" 

Let's have a look at the arguments

| Argument | Description | |----------------------------------|---------------------------------------------------------| | document_id | Document ID of your spreadsheet | | key_ios | Name of the column with keys | | {"EN":"en", "CS:"cs"} | Mapping between column names and your languages | | $PROJECT_DIR/Project/Resources | Destination where your localizable resources are stored | | Localizable.strings | Name of your localizable strings file |

NOTE: We're thinking about simplifying the call by using e.g. configuration file

Author

Ackee team

License

ACKLocalization is available under the MIT license. See the LICENSE file for more info.

Github

link
Stars: 6
Help us keep the lights on

Used By

Total: 0

Releases

0.3.1 - Nov 10, 2018

  • fixed pod homepage

0.3.0 - Nov 9, 2018

New

  • implement positioned arguments (#6, kudos to @fortmarek)
  • implement localization for plists (#8, kudos to @fortmarek)

Maintenance

  • write some tests 💪 (#7, kudos to @olejnjak)

0.2.3 - Jun 14, 2018

Tries to fix some possible caching issues

0.2.2 - Apr 5, 2018

Release with fat binary so it is now useful

0.2.1 - Dec 15, 2017