You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -60,11 +60,11 @@ Before using BartyCrouch please **make sure you have committed your code**.
60
60
With BartyCrouch you can run commands like these:
61
61
62
62
```shell
63
-
# Incrementally update Englishand German strings of Main.storyboard
64
-
bartycrouch -i "path/Base.lproj/Main.storyboard" -o en de zh-Hans pt-BR"
63
+
# Incrementally update English, Simplified Chinese and Brazilian Portuguese strings of Main.storyboard
64
+
bartycrouch -i "path/Base.lproj/Main.storyboard" -o en zh-Hans pt-BR
65
65
66
-
# Incrementally update all languages of Main.storyboard
67
-
bartycrouch -i "path/Base.lproj/Main.storyboard" -a
66
+
# Incrementally update all languages of all Storyboard/XIB files
67
+
bartycrouch "/absolute/path/to/project" -a
68
68
69
69
# Machine-translate all empty values of all supported languages with English as source
70
70
bartycrouch -t "{ id: ID }|{ secret: SECRET }" -i "path/en.lproj/Localizable.strings" -a
@@ -79,11 +79,17 @@ Also you can make your life a lot easier by using the **build script method** de
79
79
80
80
The `bartycrouch` main command accepts one of the following combinations of arguments:
81
81
82
-
1. Input and Output/Auto/Except
83
-
2. Translate with Input and Output/Auto/Except
82
+
1. Automatic input and output search (all localized Storyboards/XIBs)
83
+
2. Input and Output/Auto/Except
84
+
3. Translate with Input and Output/Auto/Except
84
85
85
86
You can also additionally specify Force and/or Verbose on each command.
86
87
88
+
### Full Automatic (aka `/absolute/path -a`)
89
+
90
+
If you want BartyCrouch to **search for all localized Storyboards/XIBs** (those in Base.lproj folders) and also want BartyCrouch to find the respective output files,
91
+
then simply declare the BartyCrouch command with an absolute path followed by `-a` like `/absolute/path/to/project -a`.
92
+
87
93
#### Input (aka `-i`)
88
94
89
95
You can specify the input Storyboard, XIB or Strings file using `-i "path/to/my.storyboard"` (`-i` is short `--input`).
@@ -126,34 +132,34 @@ You may want to **update your `.strings` files on each build automatically** wha
126
132
127
133
```shell
128
134
if which bartycrouch > /dev/null;then
129
-
# Set path to base internationalized Storyboard/XIB files
130
-
BASE_PATH="$PROJECT_DIR/Sources/Base.lproj"
131
-
132
135
# Incrementally update all Storyboards/XIBs strings files
133
-
bartycrouch -i "$BASE_PATH/Main.storyboard" -a
134
-
bartycrouch -i "$BASE_PATH/LaunchScreen.storyboard" -a
135
-
bartycrouch -i "$BASE_PATH/CustomView.xib" -a
136
-
137
-
# Set Microsoft Translator API credentials
138
-
EN_PATH="$PROJECT_DIR/Sources/en.lproj"
139
-
CREDS="{ id: YOUR_ID }|{ secret: YOUR_SECRET }"
140
-
141
-
# Machine-translate empty language values for all languages
142
-
bartycrouch -t $CREDS -i "$EN_PATH/Localizable.strings" -a
143
-
bartycrouch -t $CREDS -i "$EN_PATH/Main.strings" -a
144
-
bartycrouch -t $CREDS -i "$EN_PATH/LaunchScreen.strings" -a
145
-
bartycrouch -t $CREDS -i "$EN_PATH/CustomView.strings" -a
136
+
bartycrouch $PROJECT_DIR -a
146
137
else
147
138
echo"warning: BartyCrouch not installed, download it from https://github.com/Flinesoft/BartyCrouch"
148
139
fi
149
140
```
150
-
151
141
<imgsrc="Build-Script-Example.png">
152
142
153
-
Update the `BASE_PATH` to point to your Base.lproj directory, remove all unneeded lines, add a `bartycrouch -i ... -a` (or any other BartyCrouch command) for each of your base internationalized Storyboards/XIBs (if any) and you're good to go. You should also uncomment or remove the lines below `# Set Microsoft ...` until `bartycrouch -t ...` if you don't want to use the machine translation feature. Xcode will now run BartyCrouch each time you build your project and update your `.strings` files accordingly.
154
-
155
143
*Note: Please make sure you commit your code using source control regularly when using the build script method.*
156
144
145
+
If you want to use the **machine translation functionality** too then simply add the following to the if part:
146
+
147
+
```
148
+
# OPTIONAL
149
+
150
+
# Set source language for machine translation
151
+
EN_PATH="$PROJECT_DIR/Sources/en.lproj"
152
+
153
+
# Set Microsoft Translator API credentials
154
+
CREDS="{ id: YOUR_ID }|{ secret: YOUR_SECRET }"
155
+
156
+
# Machine-translate empty language values for all languages
157
+
bartycrouch -t $CREDS -i "$EN_PATH/Localizable.strings" -a
158
+
bartycrouch -t $CREDS -i "$EN_PATH/Main.strings" -a
159
+
bartycrouch -t $CREDS -i "$EN_PATH/LaunchScreen.strings" -a
160
+
bartycrouch -t $CREDS -i "$EN_PATH/CustomView.strings" -a
161
+
```
162
+
157
163
### Exclude specific views from localization
158
164
159
165
Sometimes you may want to **ignore some specific views** containing localizable texts e.g. because **their values are set programmatically**.
0 commit comments