summaryrefslogtreecommitdiff
path: root/riscos/configure/con_language.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2006-06-20 21:35:33 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2006-06-20 21:35:33 +0000
commit5adef63ac5099ff12c8fed4872f8df4331072d7e (patch)
treec2e879a435b4430fbbd4b0133b92eaf790c9350f /riscos/configure/con_language.c
parent5f10c6277ae20474392df402670123ac17c55bcf (diff)
downloadnetsurf-5adef63ac5099ff12c8fed4872f8df4331072d7e.tar.gz
netsurf-5adef63ac5099ff12c8fed4872f8df4331072d7e.tar.bz2
Localise configure icon strings when appropriate.
Fix gright menu handling - now writes into display field without attempting to localise the selection string - it's already localised. Update German Messages file appropriately. svn path=/trunk/netsurf/; revision=2638
Diffstat (limited to 'riscos/configure/con_language.c')
-rw-r--r--riscos/configure/con_language.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/riscos/configure/con_language.c b/riscos/configure/con_language.c
index 8725452a4..07b7422da 100644
--- a/riscos/configure/con_language.c
+++ b/riscos/configure/con_language.c
@@ -32,8 +32,8 @@ static void ro_gui_options_language_default(wimp_pointer *pointer);
static bool ro_gui_options_language_ok(wimp_w w);
static const char *ro_gui_options_language_name(const char *code);
-bool ro_gui_options_language_initialise(wimp_w w) {
-
+bool ro_gui_options_language_initialise(wimp_w w)
+{
/* set the current values */
ro_gui_set_icon_string(w, LANGUAGE_INTERFACE_FIELD,
ro_gui_options_language_name(option_language ?
@@ -58,9 +58,10 @@ bool ro_gui_options_language_initialise(wimp_w w) {
}
-void ro_gui_options_language_default(wimp_pointer *pointer) {
+void ro_gui_options_language_default(wimp_pointer *pointer)
+{
const char *code;
-
+
code = ro_gui_default_language();
ro_gui_set_icon_string(pointer->w, LANGUAGE_INTERFACE_FIELD,
ro_gui_options_language_name(code ?
@@ -70,21 +71,22 @@ void ro_gui_options_language_default(wimp_pointer *pointer) {
code : "en"));
}
-bool ro_gui_options_language_ok(wimp_w w) {
+bool ro_gui_options_language_ok(wimp_w w)
+{
const char *code;
char *temp;
-
+
code = ro_gui_menu_find_menu_entry_key(languages_menu,
ro_gui_get_icon_string(w, LANGUAGE_INTERFACE_FIELD));
if (code) {
- code += 5; /* skip 'lang_' */
+ code += 5; /* skip 'lang_' */
if ((!option_language) || (strcmp(option_language, code))) {
temp = strdup(code);
if (temp) {
- free(option_language);
- option_language = temp;
+ free(option_language);
+ option_language = temp;
} else {
- LOG(("No memory to duplicate language code"));
+ LOG(("No memory to duplicate language code"));
warn_user("NoMemory", 0);
}
}
@@ -92,21 +94,21 @@ bool ro_gui_options_language_ok(wimp_w w) {
code = ro_gui_menu_find_menu_entry_key(languages_menu,
ro_gui_get_icon_string(w, LANGUAGE_WEB_PAGES_FIELD));
if (code) {
- code += 5; /* skip 'lang_' */
+ code += 5; /* skip 'lang_' */
if ((!option_accept_language) ||
(strcmp(option_accept_language, code))) {
temp = strdup(code);
if (temp) {
- free(option_accept_language);
- option_accept_language = temp;
+ free(option_accept_language);
+ option_accept_language = temp;
} else {
- LOG(("No memory to duplicate language code"));
+ LOG(("No memory to duplicate language code"));
warn_user("NoMemory", 0);
}
}
}
ro_gui_save_options();
- return true;
+ return true;
}
@@ -116,9 +118,11 @@ bool ro_gui_options_language_ok(wimp_w w) {
* \param code 2-letter ISO language code
* \return language name, or code if unknown
*/
-const char *ro_gui_options_language_name(const char *code) {
+const char *ro_gui_options_language_name(const char *code)
+{
char key[] = "lang_xx";
key[5] = code[0];
key[6] = code[1];
+
return messages_get(key);
}