Localization
For localization, we use a shared Google Docs spreadsheet and the ACKLocalization library to download the strings into the project.
How to setup localization
-
Create a copy of the following template and move it to your project folder here
- you need to be a member of Futured to access the second link
- if you don't see the project folder, create it
- please use lowerCamelCase for iOS keys to make searching within the project easier
-
Set the sharing permissions to Anyone on the internet with this link can view
-
Set up the integration into the project
- add the ACKLocalization library via SPM, you don't need to add it to any target
-
add a
localization.jsonfile to the project's root:{ "destinationDir": "{project_folder}/Resources/Localization", "keyColumnName": "key_ios", "languageMapping": { "EN": "en", "CS": "cs", "SK": "sk" }, "apiKey": "{spreadsheet_api_key}", "spreadsheetID": "{spreadsheet_id}", "stringsFileName": "Localizable.strings", "spreadsheetTabName": "Translations" }spreadsheet_api_key- you will find it in Futured's Bitwarden under Spreadsheet localizer service account entryspreadsheet_id- copy it from your spreadsheet's URL
-
In your Xcode project:
-
create a new Aggregate target for downloading the strings and name it
Localization -
in its Build Phases, add a New Run Script Phase
-
paste the path to the library and uncheck the
Based on dependency analysischeckboxFor standart project:
xcrun --sdk macosx swift run --package-path "${BUILD_DIR%Build/*}/SourcePackages/checkouts/ACKLocalization" ACKLocalizationFor localization in local Swift package:
xcrun --sdk macosx swift run --package-path "$SRCROOT/{package_folder}" ACKLocalizationpackages_folder- the path to your local Swift packages folder -
run the Localization target - you should see the new localization files upon successful completion
-
-
Kudos to our colleagues from Ackee 🖤





