Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ocworld authored Aug 26, 2018
1 parent bd0a07a commit 38b84d5
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ to
import Foundation

struct Localizable {
static let test = "test".localized // test_value
static let test = NSLocalizedString("test", tableName: "Localizable", comment: "") // test_value
}

```
Expand All @@ -40,14 +40,10 @@ foo@bar:~$ pip install -U pyxstr2swift
```

```bash
foo@bar:~$ xstr2swift [-f] [-m] [source_path] [target_path] [struct_name]
foo@bar:~$ python -m pyxstr2swift.pyxstr2swift [-f] [-m] [source_path] [target_path] [struct_name]
foo@bar:~$ xstr2swift [-f] [-m] [--structname=value] [source_path] [target_path]
foo@bar:~$ python -m pyxstr2swift.pyxstr2swift [-f] [-m] [--structname=value] [source_path] [target_path]
```

For using it, you should import a string extension library or write it.
Below the library help you to use it easily.
https://github.com/ocworld/OHSwiftLocalizedString


To use it in Xcode build pharses,
1. Install this module using python PIP.
Expand Down Expand Up @@ -84,7 +80,7 @@ source ~/.bash_profile
# a conda env is already created that name is iosdev
conda activate iosdev
pip install --upgrade pyxstr2swift
xstr2swift -f -m "${SRCROOT}/My Project/en.lproj/Localizable.strings" "${SRCROOT}/My Project/Localizable.swift" "Localizable"
xstr2swift -f -m "${SRCROOT}/My Project/en.lproj/Localizable.strings" "${SRCROOT}/My Project/Localizable.swift"
conda deactivate
```

Expand Down

0 comments on commit 38b84d5

Please sign in to comment.