diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-09-18 14:08:05 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-09-18 14:08:05 +0000 |
commit | 505eca76e661df673ae3ff77863936e6a533f663 (patch) | |
tree | c09f07ca4eaf5c4433af9a4365ccb136e02f3d5a /apps/recorder/wormlet.c | |
parent | a24bd9a894c1d8594e99f95e470cbd8296e5b3d2 (diff) | |
download | rockbox-505eca76e661df673ae3ff77863936e6a533f663.tar.gz rockbox-505eca76e661df673ae3ff77863936e6a533f663.zip |
New language/string handling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2327 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder/wormlet.c')
-rw-r--r-- | apps/recorder/wormlet.c | 63 |
1 files changed, 17 insertions, 46 deletions
diff --git a/apps/recorder/wormlet.c b/apps/recorder/wormlet.c index 71a356134f..acebbad8bf 100644 --- a/apps/recorder/wormlet.c +++ b/apps/recorder/wormlet.c | |||
@@ -33,36 +33,7 @@ | |||
33 | #include "kernel.h" | 33 | #include "kernel.h" |
34 | #include "menu.h" | 34 | #include "menu.h" |
35 | #include "rtc.h" | 35 | #include "rtc.h" |
36 | 36 | #include "lang.h" | |
37 | /* I extracted string constants for output to | ||
38 | simplify inernationalization - once we have | ||
39 | decided how to do that exactly. Even though | ||
40 | there are other strings in the code they don't | ||
41 | have to be internationalized because they are | ||
42 | only for debugging purposes and are only included | ||
43 | if DEBUG_WORMLET is defined anyway.*/ | ||
44 | |||
45 | /* Length restriction for score board strings (LANG_SB_XXX): | ||
46 | LCD_PROPFONTS: max 43 pixel | ||
47 | fix font: max 7 characters*/ | ||
48 | #define LANG_SB_LENGTH "Len:%d" | ||
49 | #define LANG_SB_GROWING "Growing" | ||
50 | #define LANG_SB_HUNGRY "Hungry" | ||
51 | #define LANG_SB_WORMED "Wormed" | ||
52 | #define LANG_SB_ARGH "Argh" | ||
53 | #define LANG_SB_CRASHED "Crashed" | ||
54 | #define LANG_SB_HIGHSCORE "Hs: %d" | ||
55 | |||
56 | /* Length restriction for config screen strings (LANG_CS_XXX): | ||
57 | The must fit on the entire screen - preferably | ||
58 | with the key names aligned right. */ | ||
59 | #define LANG_CS_PLAYERS "%d Players up/dn" | ||
60 | #define LANG_CS_WORMS "%d Worms l/r" | ||
61 | #define LANG_CS_REMOTE_CTRL "Remote control F1" | ||
62 | #define LANG_CS_NO_REM_CTRL "No rem. control F1" | ||
63 | #define LANG_CS_2_KEY_CTRL "2 key control F1" | ||
64 | #define LANG_CS_4_KEY_CTRL "4 key control F1" | ||
65 | #define LANG_CS_NO_CONTROL "Out of control" | ||
66 | 37 | ||
67 | /* size of the field the worm lives in */ | 38 | /* size of the field the worm lives in */ |
68 | #define FIELD_RECT_X 1 | 39 | #define FIELD_RECT_X 1 |
@@ -1208,37 +1179,37 @@ static void score_board(void) | |||
1208 | } | 1179 | } |
1209 | 1180 | ||
1210 | /* length */ | 1181 | /* length */ |
1211 | snprintf(buf, sizeof (buf), LANG_SB_LENGTH, score); | 1182 | snprintf(buf, sizeof (buf),str(LANG_WORMLET_LENGTH), score); |
1212 | 1183 | ||
1213 | /* worm state */ | 1184 | /* worm state */ |
1214 | switch (check_collision(&worms[i])) { | 1185 | switch (check_collision(&worms[i])) { |
1215 | case COLLISION_NONE: | 1186 | case COLLISION_NONE: |
1216 | if (worms[i].growing > 0){ | 1187 | if (worms[i].growing > 0){ |
1217 | snprintf(buf2, sizeof(buf2), LANG_SB_GROWING); | 1188 | snprintf(buf2, sizeof(buf2), str(LANG_WORMLET_GROWING)); |
1218 | } | 1189 | } |
1219 | else { | 1190 | else { |
1220 | if (worms[i].alive) { | 1191 | if (worms[i].alive) { |
1221 | snprintf(buf2, sizeof(buf2), LANG_SB_HUNGRY); | 1192 | snprintf(buf2, sizeof(buf2), str(LANG_WORMLET_HUNGRY)); |
1222 | } else { | 1193 | } else { |
1223 | snprintf(buf2, sizeof(buf2), LANG_SB_WORMED); | 1194 | snprintf(buf2, sizeof(buf2), str(LANG_WORMLET_WORMED)); |
1224 | } | 1195 | } |
1225 | } | 1196 | } |
1226 | break; | 1197 | break; |
1227 | 1198 | ||
1228 | case COLLISION_WORM: | 1199 | case COLLISION_WORM: |
1229 | snprintf(buf2, sizeof(buf2), LANG_SB_WORMED); | 1200 | snprintf(buf2, sizeof(buf2), str(LANG_WORMLET_WORMED)); |
1230 | break; | 1201 | break; |
1231 | 1202 | ||
1232 | case COLLISION_FOOD: | 1203 | case COLLISION_FOOD: |
1233 | snprintf(buf2, sizeof(buf2), LANG_SB_GROWING); | 1204 | snprintf(buf2, sizeof(buf2), str(LANG_WORMLET_GROWING)); |
1234 | break; | 1205 | break; |
1235 | 1206 | ||
1236 | case COLLISION_ARGH: | 1207 | case COLLISION_ARGH: |
1237 | snprintf(buf2, sizeof(buf2), LANG_SB_ARGH); | 1208 | snprintf(buf2, sizeof(buf2), str(LANG_WORMLET_ARGH)); |
1238 | break; | 1209 | break; |
1239 | 1210 | ||
1240 | case COLLISION_FIELD: | 1211 | case COLLISION_FIELD: |
1241 | snprintf(buf2, sizeof(buf2), LANG_SB_CRASHED); | 1212 | snprintf(buf2, sizeof(buf2), str(LANG_WORMLET_CRASHED)); |
1242 | break; | 1213 | break; |
1243 | } | 1214 | } |
1244 | lcd_putsxy(FIELD_RECT_WIDTH + 3, y , buf, 0); | 1215 | lcd_putsxy(FIELD_RECT_WIDTH + 3, y , buf, 0); |
@@ -1250,7 +1221,7 @@ static void score_board(void) | |||
1250 | } | 1221 | } |
1251 | y += 19; | 1222 | y += 19; |
1252 | } | 1223 | } |
1253 | snprintf(buf , sizeof(buf), LANG_SB_HIGHSCORE, highscore); | 1224 | snprintf(buf , sizeof(buf), str(LANG_WORMLET_HIGHSCORE), highscore); |
1254 | #ifndef DEBUG_WORMLET | 1225 | #ifndef DEBUG_WORMLET |
1255 | lcd_putsxy(FIELD_RECT_WIDTH + 3, LCD_HEIGHT - 8, buf, 0); | 1226 | lcd_putsxy(FIELD_RECT_WIDTH + 3, LCD_HEIGHT - 8, buf, 0); |
1256 | #else | 1227 | #else |
@@ -1937,29 +1908,29 @@ Menu wormlet(void) | |||
1937 | lcd_clear_display(); | 1908 | lcd_clear_display(); |
1938 | 1909 | ||
1939 | /* first line players */ | 1910 | /* first line players */ |
1940 | snprintf(buf, sizeof buf, LANG_CS_PLAYERS, players); | 1911 | snprintf(buf, sizeof buf, str(LANG_WORMLET_PLAYERS), players); |
1941 | lcd_puts(0, 0, buf); | 1912 | lcd_puts(0, 0, buf); |
1942 | 1913 | ||
1943 | /* second line worms */ | 1914 | /* second line worms */ |
1944 | snprintf(buf, sizeof buf, LANG_CS_WORMS, worm_count); | 1915 | snprintf(buf, sizeof buf, str(LANG_WORMLET_WORMS), worm_count); |
1945 | lcd_puts(0, 1, buf); | 1916 | lcd_puts(0, 1, buf); |
1946 | 1917 | ||
1947 | /* third line control */ | 1918 | /* third line control */ |
1948 | if (players > 1) { | 1919 | if (players > 1) { |
1949 | if (use_remote) { | 1920 | if (use_remote) { |
1950 | snprintf(buf, sizeof buf, LANG_CS_REMOTE_CTRL); | 1921 | snprintf(buf, sizeof buf, str(LANG_WORMLET_REMOTE_CTRL)); |
1951 | } else { | 1922 | } else { |
1952 | snprintf(buf, sizeof buf, LANG_CS_NO_REM_CTRL); | 1923 | snprintf(buf, sizeof buf, str(LANG_WORMLET_NO_REM_CTRL)); |
1953 | } | 1924 | } |
1954 | } else { | 1925 | } else { |
1955 | if (players > 0) { | 1926 | if (players > 0) { |
1956 | if (use_remote) { | 1927 | if (use_remote) { |
1957 | snprintf(buf, sizeof buf, LANG_CS_2_KEY_CTRL); | 1928 | snprintf(buf, sizeof buf, str(LANG_WORMLET_2_KEY_CTRL)); |
1958 | } else { | 1929 | } else { |
1959 | snprintf(buf, sizeof buf, LANG_CS_4_KEY_CTRL); | 1930 | snprintf(buf, sizeof buf, str(LANG_WORMLET_4_KEY_CTRL)); |
1960 | } | 1931 | } |
1961 | } else { | 1932 | } else { |
1962 | snprintf(buf, sizeof buf, LANG_CS_NO_CONTROL); | 1933 | snprintf(buf, sizeof buf, str(LANG_WORMLET_NO_CONTROL)); |
1963 | } | 1934 | } |
1964 | } | 1935 | } |
1965 | lcd_puts(0, 2, buf); | 1936 | lcd_puts(0, 2, buf); |