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