scripts/localize.sh

90be8b71598bc6efbd9a25b85145d5460cd32616
orgstar/scripts/localize.sh

18 lines · 633 bytes · executable

 1#!/bin/sh
 2# Compiles l10n/Localizable.xcstrings into the .lproj folders of each bundle folder given (an
 3# app's Contents/Resources, an iOS app or extension folder). English is the source language:
 4# its folder is empty, so the keys show as they are.
 5# Usage: scripts/localize.sh <folder>...
 6set -eu
 7
 8cd "$(dirname "$0")/.."
 9work="$(mktemp -d)"
10xcrun xcstringstool compile l10n/Localizable.xcstrings --output-directory "$work" > /dev/null
11mkdir -p "$work/en.lproj"
12for folder in "$@"; do
13    for lproj in "$work"/*.lproj; do
14        rm -rf "$folder/$(basename "$lproj")"
15        cp -R "$lproj" "$folder/"
16    done
17done
18rm -rf "$work"
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form