[Pkg-ocaml-maint-commits] [SCM] laby packaging branch, upstream, updated. upstream/0.5.0-1-g5a6edda

Mehdi Dogguy dogguy at pps.jussieu.fr
Mon Jun 29 08:33:34 UTC 2009


The following commit has been merged in the upstream branch:
commit 5a6edda0ef9be4b8ccbbf3d637b10baf20c0d8cc
Author: Mehdi Dogguy <dogguy at pps.jussieu.fr>
Date:   Fri Jun 5 12:43:47 2009 +0200

    Imported Upstream version 0.5.1

diff --git a/INSTALL b/INSTALL
index 790250e..0627973 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-linux: 
+linux:
 
   you need ocaml >= 3.10.0 and lablgtk >= 2.10.0, then execute the
   following commands in this directory:
diff --git a/TRANSLATION b/TRANSLATION
new file mode 100644
index 0000000..20353f4
--- /dev/null
+++ b/TRANSLATION
@@ -0,0 +1,26 @@
+location:
+
+  translation data is stored in the file "data/texts"
+
+  its format is human-friendly, it consists of a bunch of entries of
+  this kind:
+
+    text            option <opt> requires an argument
+    en_US.UTF-8     option <opt> requires an argument
+    fr_FR.UTF-8     l'option <opt> nécessite un argument
+
+  the first line gives the text as written in the program source code,
+  following lines are translations of this text in various locales
+
+  you may use a modified version of this file, laby will look for it
+  at the following locations (in this order):
+    ~/.config/laby/texts
+    /usr/share/laby/texts
+
+contributions:
+
+  if you wish to contribute new translations or improve existing ones,
+  you are welcome to send them by email to:
+
+    Stéphane Gimenez <gimenez at pps.jussieu.fr>
+
diff --git a/build b/build
index 75cb9fa..dee16cc 100755
--- a/build
+++ b/build
@@ -17,7 +17,7 @@ export PKG_VERSION="${OCAMLFIND-ocamlfind} query -format %v"
 OCAMLBUILD=${OCAMLBUILD-ocamlbuild}
 OCAMLFIND=${OCAMLFIND-ocamlfind}
 
-OCB="${OCAMLBUILD} -use-menhir -no-links -no-sanitize -no-hygiene"
+OCB="${OCAMLBUILD} -no-links -no-sanitize -no-hygiene"
 OFQ="${OCAMLFIND} query -r -format -I,%d"
 
 [ "${THREADS}" = "yes" ] && OCBF="${OCBF} -lflags -thread -cflags -thread"
diff --git a/data/run/c/robot.c b/data/run/c/robot.c
index 647fedb..fb807fc 100644
--- a/data/run/c/robot.c
+++ b/data/run/c/robot.c
@@ -3,7 +3,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-enum Case {
+enum Tile {
   laby_name_Void,
   laby_name_Wall,
   laby_name_Rock,
@@ -29,7 +29,7 @@ void laby_name_right() { output("right"); free(input()); }
 
 void laby_name_forward() { output("forward"); free(input()); }
 
-enum Case laby_name_look() {
+enum Tile laby_name_look() {
   output("look");
   char *s = input();
   if (strcmp(s, "void\n") == 0) { free(s); return laby_name_Void; }
diff --git a/data/run/java/Robot.java b/data/run/java/Robot.java
index 6e00ef4..3be7bc0 100644
--- a/data/run/java/Robot.java
+++ b/data/run/java/Robot.java
@@ -4,11 +4,17 @@ import java.io.BufferedReader;
 public class Robot {
 
   BufferedReader r;
-  public enum Case {
+  public enum Tile {
       laby_name_Void, laby_name_Wall, laby_name_Rock,
       laby_name_Web, laby_name_Exit
   }
 
+  public Tile laby_name_Void = Tile.laby_name_Void;
+  public Tile laby_name_Wall = Tile.laby_name_Wall;
+  public Tile laby_name_Rock = Tile.laby_name_Rock;
+  public Tile laby_name_Web = Tile.laby_name_Web;
+  public Tile laby_name_Exit = Tile.laby_name_Exit;
+
   Robot() {
       r = new BufferedReader(new InputStreamReader(System.in));
       output("start"); input();
@@ -37,16 +43,16 @@ public class Robot {
       output("forward"); input();
   }
 
-  public Case laby_name_look() {
+  public Tile laby_name_look() {
     output("look");
     String ans = input ();
-    if (ans.equals("void")) return Case.laby_name_Void;
-    if (ans.equals("wall")) return Case.laby_name_Wall;
-    if (ans.equals("rock")) return Case.laby_name_Rock;
-    if (ans.equals("web")) return Case.laby_name_Web;
-    if (ans.equals("exit")) return Case.laby_name_Exit;
+    if (ans.equals("void")) return Tile.laby_name_Void;
+    if (ans.equals("wall")) return Tile.laby_name_Wall;
+    if (ans.equals("rock")) return Tile.laby_name_Rock;
+    if (ans.equals("web")) return Tile.laby_name_Web;
+    if (ans.equals("exit")) return Tile.laby_name_Exit;
     assert false;
-    return Case.laby_name_Void;
+    return Tile.laby_name_Void;
   }
 
   public void laby_name_door_open() {
diff --git a/data/texts b/data/texts
index 862fb44..98ae20f 100644
--- a/data/texts
+++ b/data/texts
@@ -1,3 +1,200 @@
+# say.ml
+
+text		I'm ready.
+en_US.UTF-8	I'm ready.
+fr_FR.UTF-8	Je suis prêt.
+
+text		I can't go through the wall.
+en_US.UTF-8	I can't go through the wall.
+fr_FR.UTF-8	Je ne peux pas avancer dans le mur.
+
+text		I can't go through this rock.
+en_US.UTF-8	I can't go through this rock.
+fr_FR.UTF-8	Je ne peux pas passer sur ce caillou.
+
+text		I can't go through the door.
+en_US.UTF-8	I can't go through the door.
+fr_FR.UTF-8	Je ne peux pas passer à travers la porte.
+
+text		Oops, a spider web.
+en_US.UTF-8	Oops, a spider web.
+fr_FR.UTF-8	Oups, une toile d'araignée.
+
+text		I can't move anymore.
+en_US.UTF-8	I can't move anymore.
+fr_FR.UTF-8	Je ne peux plus bouger.
+
+text		Wohoo, the exit!
+en_US.UTF-8	Wohoo, the exit!
+fr_FR.UTF-8	Ourah la sortie !
+
+text		I can't find a door to open.
+en_US.UTF-8	I can't find a door to open.
+fr_FR.UTF-8	Je ne trouve pas de porte à ouvrir.
+
+text		I can't go out carrying a rock.
+en_US.UTF-8	I can't go out carrying a rock.
+fr_FR.UTF-8	Je ne peux pas sortir en portant un caillou.
+
+text		There's no rock to take here.
+en_US.UTF-8	There's no rock to take here.
+fr_FR.UTF-8	Il n'y a pas de caillou à prendre ici.
+
+text		I can't drop the rock here.
+en_US.UTF-8	I can't drop the rock here.
+fr_FR.UTF-8	Je ne peux pas poser le caillou ici.
+
+
+# ascii api names (no funny characters)
+
+text:ascii	Ant
+en_US.UTF-8	Ant
+fr_FR.UTF-8	Fourmi
+
+text:ascii	ant
+en_US.UTF-8	ant
+fr_FR.UTF-8	fourmi
+
+text:ascii	left
+en_US.UTF-8	left
+fr_FR.UTF-8	gauche
+
+text:ascii	right
+en_US.UTF-8	right
+fr_FR.UTF-8	droite
+
+text:ascii	forward
+en_US.UTF-8	forward
+fr_FR.UTF-8	avance
+
+text:ascii	look
+en_US.UTF-8	look
+fr_FR.UTF-8	regarde
+
+text:ascii	door_open
+en_US.UTF-8	door_open
+fr_FR.UTF-8	ouvre
+
+text:ascii	take
+en_US.UTF-8	take
+fr_FR.UTF-8	prend
+
+text:ascii	drop
+en_US.UTF-8	drop
+fr_FR.UTF-8	pose
+
+text:ascii	Void
+en_US.UTF-8	Void
+fr_FR.UTF-8	Vide
+
+text:ascii	Wall
+en_US.UTF-8	Wall
+fr_FR.UTF-8	Mur
+
+text:ascii	Rock
+en_US.UTF-8	Rock
+fr_FR.UTF-8	Caillou
+
+text:ascii	Web
+en_US.UTF-8	Web
+fr_FR.UTF-8	Toile
+
+text:ascii	Exit
+en_US.UTF-8	Exit
+fr_FR.UTF-8	Sortie
+
+
+# gfx.ml
+
+text		Language:
+en_US.UTF-8	Language:
+fr_FR.UTF-8	Langage :
+
+text		Level:
+en_US.UTF-8	Level:
+fr_FR.UTF-8	Niveau :
+
+text		Program:
+en_US.UTF-8	Program:
+fr_FR.UTF-8	Programme :
+
+text		Messages:
+en_US.UTF-8	Messages:
+fr_FR.UTF-8	Messages :
+
+text		Help:
+en_US.UTF-8	Help:
+fr_FR.UTF-8	Aide :
+
+text		graphic interface configuration
+en_US.UTF-8	graphic interface configuration
+fr_FR.UTF-8	configuration de l'interface graphique
+
+
+text		cannot load language file
+en_US.UTF-8	cannot load language file
+fr_FR.UTF-8	impossible de charger le fichier langage
+
+text		size of tiles in pixels
+en_US.UTF-8	size of tiles in pixels
+fr_FR.UTF-8	taille des cases en pixels
+
+
+# sound.ml
+
+text		sound configuration
+en_US.UTF-8	sound configuration
+fr_FR.UTF-8	configuration du son
+
+text		enable or disable sounds
+en_US.UTF-8	enable or disable sounds
+fr_FR.UTF-8	activer ou désactiver le son
+
+
+# level.ml
+
+text		unknown tile
+en_US.UTF-8	unknown tile
+fr_FR.UTF-8	case inconnue
+
+text		mismatching line length
+en_US.UTF-8	mismatching line length
+fr_FR.UTF-8	longueur de ligne non concordante
+
+text		bad level format: <file>
+en_US.UTF-8	bad level format: <file>
+fr_FR.UTF-8	format de fichier erroné: <file>
+
+text		missing level section <name> in: <file>
+en_US.UTF-8	missing level section <name> in: <file>
+fr_FR.UTF-8	section <name> manquante dans le niveau: <file>
+
+
+# laby.ml
+
+text		programming languages
+en_US.UTF-8	programming languages
+fr_FR.UTF-8	langages de programmation
+
+
+# bot.ml
+
+text		execution of interpreter failed
+en_US.UTF-8	execution of interpreter failed
+fr_FR.UTF-8	échec lors de l'exécution de l'interprète
+
+
+# misc
+
+text		display failed
+en_US.UTF-8	display failed
+fr_FR.UTF-8	impossible d'ouvrir une fenêtre
+
+text		gtk error: <error>
+en_US.UTF-8	gtk error: <error>
+fr_FR.UTF-8	erreur gtk: <error>
+
+
 # dtools
 
 text		file <f>, line <l>: <error>
@@ -78,11 +275,11 @@ fr_FR.UTF-8	valeur de type <type> attendue
 
 text		the given configuration key has type <type>
 en_US.UTF-8	the given configuration key has type <type>
-fr_FR.UTF-8	la clé de configuration donnée à le type <type>
+fr_FR.UTF-8	la clé de configuration donnée a le type <type>
 
 text		the given configuration key cannot be assigned a value
 en_US.UTF-8	the given configuration key cannot be assigned a value
-fr_FR.UTF-8	la clé de configuration donnée ne peut être modifiée
+fr_FR.UTF-8	la clé de configuration donnée ne peut recevoir une valeur
 
 text		assignation syntax is <syntax>
 en_US.UTF-8	assignation syntax is <syntax>
@@ -113,17 +310,6 @@ en_US.UTF-8	subordinate log level
 fr_FR.UTF-8	niveau de ‘log’ subordonné
 
 
-# misc
-
-text		display failed
-en_US.UTF-8	display failed
-fr_FR.UTF-8	impossible d'ouvrir une fenêtre
-
-text		gtk error: <error>
-en_US.UTF-8	gtk error: <error>
-fr_FR.UTF-8	erreur gtk: <error>
-
-
 # opt.ml
 
 text		invalid options: <errors>
@@ -146,13 +332,18 @@ text		multiple exclusive actions specified
 en_US.UTF-8	multiple exclusive actions specified
 fr_FR.UTF-8	plusieurs actions exclusives ont été spécifiées
 
-text		invalid argument to <opt>: <arg>
-en_US.UTF-8	invalid argument to <opt>: <arg>
-fr_FR.UTF-8	argument invalide pour <opt> : <arg>
+text		invalid argument in <exp>: <error>
+en_US.UTF-8	invalid argument in <exp>: <error>
+fr_FR.UTF-8	argument invalide dans <exp> : <error>
+
+text		this key cannot be assigned a value
+en_US.UTF-8	this key cannot be assigned a value
+fr_FR.UTF-8	impossible d'assigner une valeur à cette clé
+
+text		expected type for this key is <type>
+en_US.UTF-8	expected type for this key is <type>
+fr_FR.UTF-8	le type attendu pour cette clé est <type>
 
-text		option <opt> conflicts with a previous option
-en_US.UTF-8	option <opt> conflicts with a previous option
-fr_FR.UTF-8	l'option <opt> est en conflit avec une option précédente
 
 text		display help message
 en_US.UTF-8	display help message
@@ -176,6 +367,10 @@ text		show versioning information
 en_US.UTF-8	show versioning information
 fr_FR.UTF-8	affiche les indications de version
 
+text		this option accepts the following arguments: <list>
+en_US.UTF-8	this option accepts the following arguments: <list>
+fr_FR.UTF-8	cette option accepte les arguments suivants : <list>
+
 
 # data.ml
 
@@ -189,162 +384,11 @@ fr_FR.UTF-8	impossible d'accéder à <path>
 
 text		cannot find resource <resource> in: <list>
 en_US.UTF-8	cannot find resource <resource> in: <list>
-fr_FR.UTF-8	ressource <resource> introuvable dans: <list>
-
+fr_FR.UTF-8	ressource <resource> introuvable dans : <list>
 
-# level.ml
 
-text		unknown tile
-en_US.UTF-8	unknown tile
-fr_FR.UTF-8	case inconnue
-
-text		mismatching line length
-en_US.UTF-8	mismatching line length
-fr_FR.UTF-8	longueur de ligne non concordante
-
-
-# bot.ml
-
-text		execution of interpreter failed
-en_US.UTF-8	execution of interpreter failed
-fr_FR.UTF-8	échec lors de l'exécution de l'interprète
-
-
-# gfx.ml
-
-text		Language:
-en_US.UTF-8	Language:
-fr_FR.UTF-8	Langage :
-
-text		Level:
-en_US.UTF-8	Level:
-fr_FR.UTF-8	Niveau :
-
-text		Program:
-en_US.UTF-8	Program:
-fr_FR.UTF-8	Programme :
-
-text		Messages:
-en_US.UTF-8	Messages:
-fr_FR.UTF-8	Messages :
-
-text		Help:
-en_US.UTF-8	Help:
-fr_FR.UTF-8	Aide :
-
-text		cannot load language file
-en_US.UTF-8	cannot load language file
-fr_FR.UTF-8	impossible de charger le fichier langage
-
-# laby.ml
-
-text		language
-en_US.UTF-8	language
-fr_FR.UTF-8	langage
-
-
-# say.ml
-
-text		I'm ready.
-en_US.UTF-8	I'm ready.
-fr_FR.UTF-8	Je suis prêt.
-
-text		I can't go through the wall.
-en_US.UTF-8	I can't go through the wall.
-fr_FR.UTF-8	Je ne peux pas avancer dans le mur.
-
-text		I can't go through this rock.
-en_US.UTF-8	I can't go through this rock.
-fr_FR.UTF-8	Je ne peux pas passer sur ce caillou.
-
-text		I can't go through the door.
-en_US.UTF-8	I can't go through the door.
-fr_FR.UTF-8	Je ne peux pas passer à travers la porte.
-
-text		Oops, a spider web.
-en_US.UTF-8	Oops, a spider web.
-fr_FR.UTF-8	Oups, une toile d'araignée.
-
-text		I can't move anymore.
-en_US.UTF-8	I can't move anymore.
-fr_FR.UTF-8	Je ne peux plus bouger.
-
-text		Wohoo, the exit!
-en_US.UTF-8	Wohoo, the exit!
-fr_FR.UTF-8	Ourah la sortie !
-
-text		I can't find a door to open.
-en_US.UTF-8	I can't find a door to open.
-fr_FR.UTF-8	Je ne trouve pas de porte à ouvrir.
-
-text		I can't go out carrying a rock.
-en_US.UTF-8	I can't go out carrying a rock.
-fr_FR.UTF-8	Je ne peux pas sortir en portant un caillou.
-
-text		There's no rock to take here.
-en_US.UTF-8	There's no rock to take here.
-fr_FR.UTF-8	Il n'y a pas de caillou à prendre ici.
-
-text		I can't drop the rock here.
-en_US.UTF-8	I can't drop the rock here.
-fr_FR.UTF-8	Je ne peux pas poser le caillou ici.
-
-
-# ascii api names
-
-text:ascii	Ant
-en_US.UTF-8	Ant
-fr_FR.UTF-8	Fourmi
-
-text:ascii	ant
-en_US.UTF-8	ant
-fr_FR.UTF-8	fourmi
-
-text:ascii	left
-en_US.UTF-8	left
-fr_FR.UTF-8	gauche
-
-text:ascii	right
-en_US.UTF-8	right
-fr_FR.UTF-8	droite
-
-text:ascii	forward
-en_US.UTF-8	forward
-fr_FR.UTF-8	avance
-
-text:ascii	look
-en_US.UTF-8	look
-fr_FR.UTF-8	regarde
-
-text:ascii	door_open
-en_US.UTF-8	door_open
-fr_FR.UTF-8	ouvre
-
-text:ascii	take
-en_US.UTF-8	take
-fr_FR.UTF-8	prend
-
-text:ascii	drop
-en_US.UTF-8	drop
-fr_FR.UTF-8	pose
-
-text:ascii	Void
-en_US.UTF-8	Void
-fr_FR.UTF-8	Vide
-
-text:ascii	Wall
-en_US.UTF-8	Wall
-fr_FR.UTF-8	Mur
-
-text:ascii	Rock
-en_US.UTF-8	Rock
-fr_FR.UTF-8	Caillou
-
-text:ascii	Web
-en_US.UTF-8	Web
-fr_FR.UTF-8	Toile
-
-text:ascii	Exit
-en_US.UTF-8	Exit
-fr_FR.UTF-8	Sortie
+# run.ml
 
+text		activate debug mode
+en_US.UTF-8	activate debug mode
+fr_FR.UTF-8	activer le mode ‘debug’
diff --git a/project.conf b/project.conf
index d5ffbb1..94cd27a 100644
--- a/project.conf
+++ b/project.conf
@@ -1,2 +1,2 @@
 PROJECT_NAME=laby
-PROJECT_VERSION=0.5.0
+PROJECT_VERSION=0.5.1
diff --git a/src/dtools/opt.ml b/src/dtools/opt.ml
index 51a1be7..90893a7 100644
--- a/src/dtools/opt.ml
+++ b/src/dtools/opt.ml
@@ -231,8 +231,8 @@ let cmd ?(argv=Sys.argv) opts =
 	  )
       | Invalid m ->
 	  set_err (
-	    F.x "invalid argument to <opt>: <error>" [
-	      "opt", f ?arg:value opt;
+	    F.x "invalid argument in <exp>: <error>" [
+	      "exp", f ?arg:value opt;
 	      "error", F.q m;
 	    ]
 	  )
diff --git a/src/gfx.ml b/src/gfx.ml
index 724f286..3335394 100644
--- a/src/gfx.ml
+++ b/src/gfx.ml
@@ -370,7 +370,7 @@ let display_gtk ?language_list () =
     then c.levels#entry#set_text "0.laby";
     newinterpret ();
     newlevel ();
-    c.window#set_default_size 980 745;
+    c.window#set_default_size 980 750;
     c.window#show ();
     (* bg color has to be retrieved after c.window#show *)
     bg := `COLOR (c.px#misc#style#light `NORMAL);
diff --git a/src/laby.ml b/src/laby.ml
index 25df3fd..8945e82 100644
--- a/src/laby.ml
+++ b/src/laby.ml
@@ -10,6 +10,7 @@ let conf =
     ~l:[
       "log", Log.conf#ut;
       "ui", Ui.conf#ut;
+      "gfx", Gfx.conf#ut;
       "res", Res.conf#ut;
       "sound", Sound.conf#ut;
     ]
diff --git a/src/state.ml b/src/state.ml
index d6bd776..26d2db9 100644
--- a/src/state.ml
+++ b/src/state.ml
@@ -167,5 +167,5 @@ let run action state =
   end
 
 let size state =
-  Array.length state.map.(0),
+  Array.fold_left (fun m e -> max m (Array.length e)) 0 state.map,
   Array.length state.map
diff --git a/src/version.ml b/src/version.ml
index ace0e60..a052fab 100644
--- a/src/version.ml
+++ b/src/version.ml
@@ -55,8 +55,8 @@ let opt =
 	      [ "full"; "id"; "protocols"; "build"; "status" ]
 	    in
  	    Opt.Invalid (
-	      F.x "version allows arguments: <arguments>" [
-		"arguments", F.h ~sep:(F.s ", ") (List.map F.s argl)
+	      F.x "this option accepts the following arguments: <list>" [
+		"list", F.q (F.h ~sep:(F.s ", ") (List.map F.string argl))
 	      ]
 	    )
 	end

-- 
laby packaging



More information about the Pkg-ocaml-maint-commits mailing list