Skip to content

Commit

Permalink
Add build step description for android/gradle to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kh0r committed Jun 25, 2015
1 parent 03ae460 commit 588f4c5
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions README.md
Expand Up @@ -47,7 +47,7 @@ Whitepace in this file is mostly ignored. If you absolutely need to put spaces a
en = No
fr = Non
ja = いいえ

[[Errors]]
[path_not_found_error]
en = The file '%@' could not be found.
Expand All @@ -57,7 +57,7 @@ Whitepace in this file is mostly ignored. If you absolutely need to put spaces a
en = The network is currently unavailable.
tags = app1
comment = An error describing when the device can not connect to the internet.

[[Escaping Example]]
[list_item_separator]
en = `, `
Expand All @@ -84,7 +84,7 @@ If you would like to enable twine to create language files in another format, cr
## Usage

Usage: twine COMMAND STRINGS_FILE [INPUT_OR_OUTPUT_PATH] [--lang LANG1,LANG2...] [--tags TAG1,TAG2,TAG3...] [--format FORMAT]

### Commands

#### `generate-string-file`
Expand Down Expand Up @@ -149,6 +149,8 @@ The easiest way to create your first strings.txt file is to run the `consume-all

## Twine and Your Build Process

### Xcode

It is easy to incorporate Twine right into your iOS and OS X app build processes.

1. In your project folder, create all of the `.lproj` directories that you need. It does not really matter where they are. We tend to put them in `Resources/Locales/`.
Expand All @@ -165,6 +167,21 @@ It is easy to incorporate Twine right into your iOS and OS X app build processes

Now, whenever you build your application, Xcode will automatically invoke Twine to make sure that your `.strings` files are up-to-date.

### Android Studio/Gradle

Add the following task at the top level in app/build.gradle:
```
task generateStrings {
String script = 'if hash twine 2>/dev/null; then twine generate-string-file strings.txt ./src/main/res/values/generated_strings.xml; fi'
exec {
executable "sh"
args '-c', script
}
}
Now every time you build your app the strings are generated from the twine file.
## User Interface
* [Twine TextMate 2 Bundle](https://github.com/mobiata/twine.tmbundle) — This [TextMate 2](https://github.com/textmate/textmate) bundle will make it easier for you to work with Twine strings files. In particular, it lets you use code folding to easily collapse and expand both strings and sections.
Expand Down

0 comments on commit 588f4c5

Please sign in to comment.