File: lstrings.ml

package info (click to toggle)
planets 0.1.13-19
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 512 kB
  • sloc: ml: 4,541; makefile: 207; ansic: 38
file content (225 lines) | stat: -rw-r--r-- 8,127 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
(*  Planets:  A simple 2-d celestial simulator
    Copyright (C) 2001-2003  Yaron M. Minsky

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *)

open StdLabels
open MoreLabels

(* Some ad-hoc localization *)

let english word = match word with
  | `paused -> "Paused"
  | `tracing -> "Tracing"
  | `true_bounce -> "Bouncing (experimental)"
  | `trace_length -> "Trace Length"
  | `disp_period -> "Disp. Period (ms)"
  | `g -> "G"
  | `grav_exp -> "G exp."
  | `diam_mult -> "Average diameter"
  | `rand_vel_mult -> "Average velocity"
  | `log_k_energy -> "Log k energy"
  | `log_p_energy -> "Log p energy"
  | `log_energy -> "Log energy"
  | `num_planets -> "Number of planets"
  | `add_planet -> "Add Planet"
  | `zoom_in -> "Zoom In"
  | `zoom_out -> "Zoom Out"
  | `iter_display -> "iter/display"
  | `time_step -> "Time step"
  | `toggle_true_bounce -> "Toggle true bounce"
  | `toggle_bounce -> "Toggle bounce"
  | `center -> "Center"
  | `option_dialog -> "Display option dialog"
  | `change_all_colors -> "Change all colors"
  | `quit -> "Quit"
  | `reset -> "Reset to empty universe"
  | `save -> "Save Universe"
  | `load -> "Load Universe"
  | `undo -> "Undo (undoes last planet insertion)"
  | `goback -> "Go Back (goes back to last planet insertion)"
  | `toggle_pause -> "Toggle Pause"
  | `toggle_trace -> "Toggle Trace"
  | `double_trace -> "Double Trace Length"
  | `halve_trace -> "Halve Trace Length"
  | `place_random_orbital -> "Place random orbital planet"
  | `place_random_orbital_uni -> "Place random orbital planet (unidirectional)"
  | `place_random -> "Place random planet"
  | `cancel_com -> "Cancel C-O-M tracking"
  | `pan_up -> "Pan Up"
  | `pan_down -> "Pan Down"
  | `pan_left -> "Pan Left"
  | `pan_right -> "Pan Right"
  | `display_help -> "Display this help dialog"
  | `help -> "Help"
  | `dismiss -> "Dismiss"
  | `options -> "Options"
  | `at_startup -> "Display this screen at startup?"
  | `random_bodies -> "New random bodies:"
  | `prologue -> "Welcome to Planets!
Planets is a simple orbital planetary simulator.  A short 
introduction to planets can be found at:
   http://planets.homedns.org/getting_started.html

The following is a list of keybindings.  Note that a summary
of keybindings can be found in the KEYBINDINGS.txt file
distributed with this program.

"

let danish word = match word with
  | `paused -> "Pause"
  | `tracing -> "Vis hale"
  | `true_bounce -> "�gte st�d"
  | `trace_length -> "Halel�ngde"
  | `disp_period -> "Opdateringstid (ms)"
  | `g -> "G (Tyngdeacceleration)"
  | `grav_exp -> "G exp."
  | `diam_mult -> "Diam. faktor"
  | `rand_vel_mult -> "Hastigheds-faktor"
  | `log_k_energy -> "Log k energi"
  | `log_p_energy -> "Log p energi"
  | `log_energy -> "Log energi"
  | `add_planet -> "Tilf�j planet"
  | `zoom_in -> "Zoom ind"
  | `zoom_out -> "Zoom ud"
  | `iter_display -> "Trin/opdatering"
  | `time_step -> "Tidsintervaller"
  | `toggle_true_bounce -> "�gte st�d til/fra"
  | `toggle_bounce -> "St�d til/fra"
  | `center -> "Centr�r"
  | `option_dialog -> "Vis dialogboksen indstillinger"
  | `change_all_colors -> "�ndr alle farver"
  | `quit -> "Afslut"
  | `reset -> "Genstart med tomt univers"
  | `save -> "Gem univers"
  | `load -> "Indl�s univers"
  | `undo -> "Fortryd (oprettelsen af sidste planet)"
  | `goback -> "G� tilbage (til oprettelsen af sidste planet)"
  | `toggle_pause -> "Pause/k�r"
  | `toggle_trace -> "Vis/skjul hale"
  | `double_trace -> "Fordobl halens l�ngde"
  | `halve_trace -> "Halv�r halens l�ngde"
  | `place_random_orbital -> "Opret planet i tilf�ldig bane"
  | `place_random -> "Opret tilf�ldig planet"
  | `cancel_com -> "Afbryd sporing af massemidtpunkt"
  | `pan_up -> "Op"
  | `pan_down -> "Ned"
  | `pan_left -> "Venstre"
  | `pan_right -> "H�jre"
  | `display_help -> "Vis denne hj�lpesk�rm"
  | `help -> "Hj�lp" (* "Help" *)
  | `dismiss -> "Anvend" (* "Dismiss" *)
  | `options -> "Indstillinger" (* "Options" *)
  | `at_startup -> "Vis denne hj�lpesk�rm hver gang Planets starter?"
      (* "Display this screen at startup?" *)  
  | `prologue -> "Velkommen til Planets!
  
Planets er en simpel planetbanesimulator.
Du kan finde en kort (engelsksproget) introduktion til Planets p�:
http://planets.homedns.org/getting_started.html

Det f�lgende er en liste over tastaturgenveje (de er vigtige i dette 
program!).
Bem�rk at du kan finde en oversigt over genvejstasterne (en.)
i filen KEYBINDINGS.txt som fulgte med dette program.

"
  | _ -> raise Not_found

let german word = match word with
  | `paused -> "Angehalten"
  | `tracing -> "Spurverfolgung"
  | `true_bounce -> "Bouncing (experimentell)"
  | `trace_length -> "Spurl�nge"
  | `disp_period -> "Bilddauer (ms)"
  | `g -> "G"
  | `grav_exp -> "exp. G"
  | `diam_mult -> "Mittlerer Durchmesser"
  | `rand_vel_mult -> "Durchschnittsgeschwindigkeit"
  | `log_k_energy -> "log k Energie"
  | `log_p_energy -> "log p Energie"
  | `log_energy -> "log. Energie"
  | `num_planets -> "Anzahl Planeten"
  | `add_planet -> "Planet hinzuf�gen"
  | `zoom_in -> "Hereinzoomen"
  | `zoom_out -> "Herauszoomen"
  | `iter_display -> "Iterationen/Bild"
  | `time_step -> "Zeitschritt"
  | `toggle_true_bounce -> "Echtes abprallen ein/aus"
  | `toggle_bounce -> "Abprallen ein/aus"
  | `center -> "Zentrieren"
  | `option_dialog -> "Optionsdialog anzeigen"
  | `change_all_colors -> "Alle Farben �ndern"
  | `quit -> "Beenden"
  | `reset -> "Auf leeres Universum zur�cksetzen"
  | `save -> "Universum speichern"
  | `load -> "Universum laden"
  | `undo -> "Letzen hinzugef�gten Planet l�schen"
  | `goback -> "Zuletzt hinzugef�gten Planeten l�schen"
  | `toggle_pause -> "Animation pausieren/weiter"
  | `toggle_trace -> "Spur ein/aus"
  | `double_trace -> "Spurl�nge verdoppeln"
  | `halve_trace -> "Spurl�nge halbieren"
  | `place_random_orbital -> "Zuf�lligen orbitalen Planeten hinzuf�gen"
  | `place_random_orbital_uni -> "Zuf�lligen orbitalen Planeten hinzuf�gen (unidirektional)"
  | `place_random -> "Zuf�lligen Planeten hinzuf�gen"
  | `cancel_com -> "Verfolgung des Massezentrums abschalten"
  | `pan_up -> "Aufw�rts scrollen"
  | `pan_down -> "Abw�rts scrollen"
  | `pan_left -> "Nach links scrollen"
  | `pan_right -> "Nach rechts scrollen"
  | `display_help -> "Dieses Hilfefenster anzeigen"
  | `help -> "Hilfe"
  | `dismiss -> "Schlie�en"
  | `options -> "Optionen"
  | `at_startup -> "Diese Hilfe beim Start anzeigen?"
  | `random_bodies -> "Neue zuf�llige Planeten:"
  | `prologue -> "Willkommen zu planets!
Planets ist ein einfacher Simulator f�r die orbitale Bewegung von
Planeten. Eine kurze Einf�hrung ist zu finden unter:
   http://planets.homedns.org/getting_started.html

Es folgt die Tastenbelegung. Eine Beschreibung der Tasten ist in der Datei
KEYBINDINGS.txt zu finden, die mit diesem Programm ausgeliefert wird.

"
  | _ -> raise Not_found

let maxsub string ~pos ~len =
  let len = min len (String.length string - pos) in
  String.sub string ~pos ~len

let rec list_find ~f list = match list with
  | [] -> raise Not_found
  | hd::tl -> 
      match (try Some (f hd) with Not_found -> None)
      with
	  Some x -> x
	| None -> list_find ~f tl

let get_locale () = 
  list_find ~f:Sys.getenv ["LC_ALL";"LC_MESSAGES";"LANG"]

let get word = 
  try (
    match maxsub ~pos:0 ~len:2 (Sys.getenv "LANG") with 
      | "en" -> english word
      | "da" -> danish word
      | "de" -> german word
      | _ -> english word
  ) with
      Not_found -> english word