Crates.io | lproj2es |
lib.rs | lproj2es |
version | 0.2.0 |
source | src |
created_at | 2017-04-16 19:29:03.369453 |
updated_at | 2017-04-20 19:23:22.173588 |
description | Dump iOS localization strings into ElasticSearch |
homepage | |
repository | https://github.com/kennytm/lproj2es |
max_upload_size | |
id | 10853 |
size | 49,488 |
lproj2es is a utility to extract all localized strings *.lproj/*.strings
into an ElasticSearch index for easy
look-up. This allows translators to produce localizations using terms from endorsed by Apple.
Download an IPSW from https://ipsw.me. IPSWs nowadays are typically over 2 GB in size, so make sure you have got enough time to download the file, and enough harddisk space to store and unzip it.
Unzip the IPSW to extract the root filesystem image (the filenames vary between iOS versions).
$ unzip iPhone_7Plus_10.3.1_14E304_Restore.ipsw 058-55433-171.dmg
Attach the image.
$ open 058-55433-171.dmg
Start the ElasticSearch cluster. We assume ElasticSearch is accessible via http://127.0.0.1:9200.
Run the program. It typically takes less than 3 minutes to finish with ElasticSearch on the local machine.
$ ./lproj2es /Volumes/Erie14E304.D11D111OS/
The indexed translations are stored in the localizations
index with ios
type, using 1 replica and 1 shard. Each
document looks like:
{
"BUNDLE": "/Volumes/Erie14E304.D11D111OS/System/Library/CoreServices/SpringBoard.app",
"FILE": "SpringBoard.strings",
"KEY": "AWAY_LOCK_LABEL",
"en_US": "slide to unlock",
"fr_FR": "Déverrouiller",
"es_ES": "Deslizar para desbloquear",
"de_DE": "Entsperren",
...
}
The BUNDLE field specifies the bundle the translation belongs to. The FILE field gives the *.strings
file that
contains the translation. The document encodes a single key-value entry in the *.strings
file, with the key in the
KEY field, and values in their respective locale-id field (en_US, fr_FR, etc.)
lproj2es 0.1.0
kennytm <kennytm@gmail.com>
Dump iOS localization strings into ElasticSearch
USAGE:
lproj2es [OPTIONS] <root>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-u, --url <base> Acesss point of the ElasticSearch cluster [default: http://127.0.0.1:9200]
-i, --index <index> Name of the index [default: localizations]
-t, --type <type_> Name of the type [default: ios]
--shards <shards> Number of shards of the new index [default: 1]
--replicas <replicas> Number of replicas of the new index [default: 1]
ARGS:
<root> Root directory to scan for localized bundles