diff options
Diffstat (limited to 'java/demo/IceGrid/icebox/HelloI.java')
-rw-r--r-- | java/demo/IceGrid/icebox/HelloI.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/java/demo/IceGrid/icebox/HelloI.java b/java/demo/IceGrid/icebox/HelloI.java index 420638660b8..05395ff5f12 100644 --- a/java/demo/IceGrid/icebox/HelloI.java +++ b/java/demo/IceGrid/icebox/HelloI.java @@ -19,7 +19,26 @@ public class HelloI extends _HelloDisp public void sayHello(Ice.Current current) { - System.out.println("Hello from " + _serviceName); + java.util.Map<String,String> env = System.getenv(); + String lang = env.containsKey("LANG") ? env.get("LANG") : "en"; + String greeting = "Hello, "; + if(lang.equals("fr")) + { + greeting = "Bonjour, "; + } + else if(lang.equals("de")) + { + greeting = "Hallo, "; + } + else if(lang.equals("es")) + { + greeting = "Hola, "; + } + else if(lang.equals("it")) + { + greeting = "Ciao, "; + } + System.out.println(greeting + _serviceName); } private String _serviceName; |