Package net.i2p.util
Class TranslateReader
java.lang.Object
java.io.Reader
java.io.FilterReader
net.i2p.util.TranslateReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
public class TranslateReader extends FilterReader
Translate.
Strings are tagged with _("translateme")
or _("translate {0} me", "foo")
Max two parameters.
String and parameters must be double-quoted (no ngettext, no tagged parameters).
Escape quotes inside quote with \".
Commas and spaces between args are optional.
Entire tag (from '_' to ')') must be on one line.
Multiple tags allowed on one line.
Also will extract strings to a dummy java file for postprocessing by xgettext - see main().
- Since:
- 0.9.8
-
Field Summary
-
Constructor Summary
Constructors Constructor Description TranslateReader(I2PAppContext ctx, String bundle, InputStream in)
TranslateReader(I2PAppContext ctx, String bundle, Reader in)
-
Method Summary
Modifier and Type Method Description void
close()
static void
main(String[] args)
Do not comment out, used to extract tags as a part of the build process.void
mark(int readLimit)
boolean
markSupported()
int
read()
int
read(char[] cbuf, int off, int len)
boolean
ready()
void
reset()
long
skip(long n)
-
Constructor Details
-
TranslateReader
- Parameters:
bundle
- may be null for tagging onlyin
- UTF-8- Throws:
IOException
-
TranslateReader
- Parameters:
bundle
- may be null for tagging only- Throws:
IOException
- Since:
- 0.9.34
-
-
Method Details
-
read
- Overrides:
read
in classFilterReader
- Throws:
IOException
-
read
- Overrides:
read
in classFilterReader
- Throws:
IOException
-
skip
- Overrides:
skip
in classFilterReader
- Throws:
IOException
-
ready
- Overrides:
ready
in classFilterReader
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterReader
- Throws:
IOException
-
mark
public void mark(int readLimit)- Overrides:
mark
in classFilterReader
-
reset
- Overrides:
reset
in classFilterReader
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classFilterReader
-
main
Do not comment out, used to extract tags as a part of the build process.
-