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
-
Fields inherited from class java.io.FilterReader
in
-
-
Constructor Summary
Constructors Constructor Description TranslateReader(I2PAppContext ctx, String bundle, InputStream in)TranslateReader(I2PAppContext ctx, String bundle, Reader in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static voidmain(String[] args)Do not comment out, used to extract tags as a part of the build process.voidmark(int readLimit)booleanmarkSupported()intread()intread(char[] cbuf, int off, int len)booleanready()voidreset()longskip(long n)-
Methods inherited from class java.io.Reader
nullReader, read, read, transferTo
-
-
-
-
Constructor Detail
-
TranslateReader
public TranslateReader(I2PAppContext ctx, String bundle, InputStream in) throws IOException
- Parameters:
bundle- may be null for tagging onlyin- UTF-8- Throws:
IOException
-
TranslateReader
public TranslateReader(I2PAppContext ctx, String bundle, Reader in) throws IOException
- Parameters:
bundle- may be null for tagging only- Throws:
IOException- Since:
- 0.9.34
-
-
Method Detail
-
read
public int read() throws IOException- Overrides:
readin classFilterReader- Throws:
IOException
-
read
public int read(char[] cbuf, int off, int len) throws IOException- Overrides:
readin classFilterReader- Throws:
IOException
-
skip
public long skip(long n) throws IOException- Overrides:
skipin classFilterReader- Throws:
IOException
-
ready
public boolean ready() throws IOException- Overrides:
readyin classFilterReader- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterReader- Throws:
IOException
-
mark
public void mark(int readLimit)
- Overrides:
markin classFilterReader
-
reset
public void reset() throws IOException- Overrides:
resetin classFilterReader- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classFilterReader
-
main
public static void main(String[] args)
Do not comment out, used to extract tags as a part of the build process.
-
-