Skip to content

Commit

Permalink
1.7 - Exclusive Keys Support
Browse files Browse the repository at this point in the history
  • Loading branch information
metasmile committed Feb 4, 2020
1 parent 7d604be commit 11f2a33
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ usage: strsync-runner.py [-h] [-b BASE_LANG_NAME]
[-v [VERIFY_RESULTS [VERIFY_RESULTS ...]]]
[-s [INCLUDE_SECONDARY_LANGUAGES [INCLUDE_SECONDARY_LANGUAGES ...]]]
[-i [IGNORE_UNVERIFIED_RESULTS [IGNORE_UNVERIFIED_RESULTS ...]]]
[target path]
[target path] [only for keys [only for keys ...]]
Automatically translate and synchronize .strings files from defined base
language.
positional arguments:
target path Target localization resource path. (root path of
Base.lproj, default=./)
only for keys Some specified keys for exclusive work. All operations
will work for only that keys therefore other keys will
be ignored. Not specified by default. (default=None)
optional arguments:
-h, --help show this help message and exit
Expand Down Expand Up @@ -122,6 +125,11 @@ Copy all items from Base language without translation.
$ strsync ./myapp/Resources/Localizations -w
```

All operations will work for only keys "exclusive key1" "exclusive key2" "exclusive key3". Other keys will be ignored.
```
$ strsync ./myapp/Resources/Localizations "exclusive key1" "exclusive key2" "exclusive key3"
```

Excluding japanese, spanish, finnish
```
$ strsync ./myapp/Resources/Localizations -x ja es fi
Expand Down Expand Up @@ -230,7 +238,7 @@ zh-CN
```


## Utilities
## Utilities

There are some additional scripts to help your workflow with strsync.

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="strsync",
version="1.6.1",
version="1.7",
packages=[
'strsync',
],
Expand All @@ -36,7 +36,7 @@
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Topic :: Software Development :: Internationalization",
Expand Down
5 changes: 3 additions & 2 deletions strsync/strsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,9 @@ def resolve_file_names(target_file_names):
# Init with Base.lproj
for dir, subdirs, files in walked:
if os.path.basename(dir) == __BASE_RESOUCE_DIR__:
for _file in resolve_file_names(files):
f = os.path.join(dir, _file)
for _file in resolve_file_names(files):
f = os.path.join(dir, _file)



if notexist_or_empty_file(f):
Expand Down

0 comments on commit 11f2a33

Please sign in to comment.