1
// Example for use of GNU gettext.
2
// This file is in the public domain.
4
// Source code of the Java program.
12
public static void main (String[] args) {
13
ResourceBundle catalog = ResourceBundle.getBundle("hello-java");
14
System.out.println(GettextResource.gettext(catalog,"Hello, world!"));
17
GettextResource.gettext(catalog,
18
"This program is running as process number {0}."),
19
new Object[] { getPid() }));
22
/* Return the process ID of the current process. */
23
private static String getPid () {
25
String[] args = new String[] { "/bin/sh", "-c", "echo $PPID" };
26
Process p = Runtime.getRuntime().exec(args);
27
InputStream p_out = p.getInputStream();
28
String s = (new BufferedReader(new InputStreamReader(p_out))).readLine();
32
} catch (IOException e) {