2002-04-26 05:16:26 -07:00
|
|
|
|
(***********************************************************************)
|
|
|
|
|
(* *)
|
2011-07-27 07:17:02 -07:00
|
|
|
|
(* MLTk, Tcl/Tk interface of OCaml *)
|
2002-04-26 05:16:26 -07:00
|
|
|
|
(* *)
|
|
|
|
|
(* Francois Rouaix, Francois Pessaux, Jun Furuse and Pierre Weis *)
|
|
|
|
|
(* projet Cristal, INRIA Rocquencourt *)
|
|
|
|
|
(* Jacques Garrigue, Kyoto University RIMS *)
|
|
|
|
|
(* *)
|
|
|
|
|
(* Copyright 2002 Institut National de Recherche en Informatique et *)
|
|
|
|
|
(* en Automatique and Kyoto University. All rights reserved. *)
|
|
|
|
|
(* This file is distributed under the terms of the GNU Library *)
|
|
|
|
|
(* General Public License, with the special exception on linking *)
|
2011-07-27 07:17:02 -07:00
|
|
|
|
(* described in file LICENSE found in the OCaml source tree. *)
|
2002-04-26 05:16:26 -07:00
|
|
|
|
(* *)
|
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
|
|
(* language encoding using UTF-8 *)
|
|
|
|
|
open Tk
|
|
|
|
|
|
2010-01-22 04:48:24 -08:00
|
|
|
|
let top = opentk ()
|
2002-04-26 05:16:26 -07:00
|
|
|
|
|
|
|
|
|
(* declare Tk that we use utf-8 to communicate *)
|
|
|
|
|
(* problem: Text display is highly dependent on your font installation
|
|
|
|
|
and configulation. The fonts with no-scale setting are selected
|
|
|
|
|
only if the point sizes are exactly same???
|
|
|
|
|
*)
|
2010-01-22 04:48:24 -08:00
|
|
|
|
let _ =
|
2002-04-26 05:16:26 -07:00
|
|
|
|
Encoding.system_set "utf-8";
|
|
|
|
|
let l = Label.create top ~text: "???" in
|
|
|
|
|
pack [l];
|
|
|
|
|
let t = Text.create top in
|
|
|
|
|
pack [t];
|
|
|
|
|
|
|
|
|
|
let create_hello lang hello =
|
|
|
|
|
let b = Button.create t ~text: lang ~command: (fun () ->
|
2010-01-22 04:48:24 -08:00
|
|
|
|
Label.configure l ~text: hello)
|
2002-04-26 05:16:26 -07:00
|
|
|
|
in
|
|
|
|
|
Text.window_create t ~index: (`End,[]) ~window: b
|
|
|
|
|
in
|
|
|
|
|
List.iter (fun (lang, hello) -> create_hello lang hello)
|
|
|
|
|
["Amharic(አማርኛ)", "ሠላም";
|
|
|
|
|
"Arabic", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
"Croatian (Hrvatski)", "Bog (Bok), Dobar dan";
|
2002-07-23 07:12:03 -07:00
|
|
|
|
"Czech (česky)", "Dobrý den";
|
2002-04-26 05:16:26 -07:00
|
|
|
|
"Danish (Dansk)", "Hej, Goddag";
|
|
|
|
|
"English", "Hello";
|
|
|
|
|
"Esperanto", "Saluton";
|
|
|
|
|
"Estonian", "Tere, Tervist";
|
|
|
|
|
"FORTRAN", "PROGRAM";
|
|
|
|
|
"Finnish (Suomi)", "Hei";
|
|
|
|
|
"French (Français)", "Bonjour, Salut";
|
|
|
|
|
"German (Deutsch Nord)", "Guten Tag";
|
|
|
|
|
"German (Deutsch Süd)", "Grüß Gott";
|
|
|
|
|
"Greek (Ελληνικά)", "Γειά σας";
|
|
|
|
|
"Hebrew", "שלום";
|
|
|
|
|
"Italiano", "Ciao, Buon giorno";
|
|
|
|
|
"Maltese", "Ciao";
|
|
|
|
|
"Nederlands, Vlaams", "Hallo, Hoi, Goedendag";
|
|
|
|
|
"Norwegian (Norsk)", "Hei, God dag";
|
|
|
|
|
"Polish", "Cześć!";
|
|
|
|
|
"Russian (Русский)", "Здравствуйте!";
|
|
|
|
|
"Slovak", "Dobrý deň";
|
|
|
|
|
"Spanish (Español)", "¡Hola!";
|
|
|
|
|
"Swedish (Svenska)", "Hej, Goddag";
|
|
|
|
|
"Thai (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
|
|
|
|
"Tigrigna (ትግርኛ)", "ሰላማት";
|
|
|
|
|
"Turkish (Türkçe)", "Merhaba";
|
|
|
|
|
"Vietnamese (Tiếng Việt)", "Chào bạn";
|
|
|
|
|
"Japanese (日本語)", "こんにちは";
|
|
|
|
|
"Chinese (中文,普通话,汉语)", "你好";
|
|
|
|
|
"Cantonese (粵語,廣東話)", "早晨, 你好";
|
|
|
|
|
"Hangul (한글)", "안녕하세요, 안녕하십니까" ]
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
let _ = Printexc.print mainLoop ()
|