Skip to content

Commit c2e4fba

Browse files
authored
Update README.md
1 parent e0b1df5 commit c2e4fba

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# StringExtractor
2-
StringExtractor is used to extracts raw strings from a java and xml files of Android apps project to a optional xml file and link them<b>
3-
# Usage
4-
This is a sample code to extracts the strings from JavaFile.java and save to myapp_strings.xml
2+
StringExtractor is used to extracts raw strings from a java and xml files of Android apps project to a optional xml file and link them
3+
## Usage
4+
This is a sample code to extracts the strings from JavaFile.java and save to myapp_strings.xml
55
```java
66
File inputFile = new File("JavaFile.java");
77
File xmlFile = new File("myapp_strings.xml");
@@ -14,18 +14,18 @@ try{
1414
//handle errors here
1515
}
1616
```
17-
as we set backupFile to true the file JavaFile.java will be renamed to JavaFile.java.backup before writing the modified code to JavaFile.java<br>the file ```ExtractedString.java``` will be created at the same directory of inputFile.<br>every non blank string will be replaced with ```getResources().getString(R.string.myapp_string%s)``` or ```ExtractedString.getString(R.string.myapp_string%s)``` if ```extractedString=true```.<br>while %s is replaced with the number from 1 to total strings found.
18-
# Command Line
19-
firstly compile the file using
17+
Because we set backupFile to true the file JavaFile.java will be renamed to JavaFile.java.backup before writing the modified code to JavaFile.java<br>the file ```ExtractedString.java``` will be created at the same directory of inputFile.<br>every non blank string will be replaced with ```getResources().getString(R.string.myapp_string%s)``` or ```ExtractedString.getString(R.string.myapp_string%s)``` if ```extractedString=true```.<br>while %s is replaced with the number from 1 to total strings found.
18+
## Command Line
19+
firstly compile the file using
2020
```
21-
javadoc StringExtractor.java
22-
```
23-
and then executes with
21+
javac StringExtractor.java
2422
```
23+
and then executes with
24+
<pre>
2525
java StringExtractor -[r|b|c] -i FILE -d PATH -p TEXT -s TEXT -x FILE
26-
```
27-
- Options are:
28-
```
26+
</pre>
27+
Options are:
28+
<pre>
2929
-i FILE the single xml or java file to scan the string. options [-d,-r] are ignore if specified.
3030
-d PATH directory to scan for xml or java files. this option require -r to work.
3131
-p TEXT the prefix text to use when genarating xml string name.
@@ -35,5 +35,6 @@ java StringExtractor -[r|b|c] -i FILE -d PATH -p TEXT -s TEXT -x FILE
3535
-b backup the original file to filename.backup .
3636
-c use class ExtractedString for java files. this will generate java file 'ExtractedString.java' in the same directory of input file to access strings from classes that do not have a Context. and you must call ExtractedString.setContext(context) from your application or activity onCreate.
3737
-h show this usage message.
38-
```
38+
</pre>
39+
3940
> Note: StringExtractor is only for android apps project.

0 commit comments

Comments
 (0)