Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Dynamic language change working correctly

  • Loading branch information...
commit ac48d56f47da950b41661d9b8ba20786b5d189ec 1 parent 0190a3a
Sébastien Bourdeauducq authored June 11, 2011

Showing 1 changed file with 12 additions and 2 deletions. Show diff stats Hide diff stats

  1. 14  lib/i18n.c
14  lib/i18n.c
@@ -22,8 +22,9 @@
22 22
 #include "appman.h"
23 23
 #include "scope.h"
24 24
 #include "widman.h"
25  
-#include "label.h"
26 25
 #include "button.h"
  26
+#include "label.h"
  27
+#include "window.h"
27 28
 
28 29
 #include <mtki18n.h>
29 30
 
@@ -39,12 +40,21 @@ static void ec(char *name, char *type, WIDGET *w, void *user)
39 40
 		
40 41
 		s = strdup(b->but->get_text(b));
41 42
 		b->but->set_text(b, s);
  43
+		b->gen->update((WIDGET *)b);
42 44
 		free(s);
43 45
 	} else if(strcmp(type, "Label") == 0) {
44 46
 		LABEL *l = (LABEL *)w;
45 47
 		
46 48
 		s = strdup(l->lab->get_text(l));
47 49
 		l->lab->set_text(l, s);
  50
+		l->gen->update((WIDGET *)l);
  51
+		free(s);
  52
+	} else if(strcmp(type, "Window") == 0) {
  53
+		WINDOW *win = (WINDOW *)w;
  54
+		
  55
+		s = strdup(win->win->get_title(win));
  56
+		win->win->set_title(win, s);
  57
+		win->gen->update((WIDGET *)win);
48 58
 		free(s);
49 59
 	}
50 60
 }
@@ -59,7 +69,7 @@ void mtk_set_language(struct mtk_i18n_entry *table)
59 69
 	for(i=1;i<64;i++) {
60 70
 		s = appman->get_rootscope(i);
61 71
 		if(s != NULL)
62  
-			s->scope->enumerate(s, ec, NULL);
  72
+			s->scope->enumerate(s, ec, (void *)i);
63 73
 	}
64 74
 }
65 75
 

0 notes on commit ac48d56

Please sign in to comment.
Something went wrong with that request. Please try again.