iOS Localization

As you know, iOS localized files are text files that contains key=value pairs:

"hello" = "Hello";
"world" = "World";
        

Whenever you want you can extract localized strings from our service to your iOS project.
You can do it manually via web-interface, using API, or shell script.

Web-interface

Open you project settings, select [iOS localized strings], choose a language and click export.

iOS export
API

guard let url = URL(string: "http://api.localize.to/v1/en?format=ios&apikey=YOUR_PROJECT_API_KEY") else { return }

let task = URLSession.shared.dataTask(with: url) {(data, response, error) in
    guard let data = data else { return }
    print(String(data: data, encoding: .utf8))
}

task.resume()
        
Shell script

Example below downloads six different languages to the YourProject/ folder.

#!/bin/sh

target_path="YourProject"
apikey="{YOUR_PROJECT_API_KEY}"

base_url="https://api.localize.to/v1"
declare -a langs=("en" "ru" "uk" "de" "fr" "es")

for lang in  "${langs[@]}"
do
    echo $lang
    name="${target_path}/${lang}.lproj/Localizable.strings"
    request="${base_url}/language/${lang}?apikey=${apikey}&format=ios"
    curl -o ${name} ${request}
done