muskut
- 8th June 2007, 13:24
Hi All,
I am on a new project. I am using a 2x16 LCD. I have to make multi language support. I have a lot of way that goes to the solving. But I am searching more powerful and stable an algorithm. I can use ALGORITHM1, there is no problem. But I am using all codes again again that how much I am using language selection. So If I am using 3 lang. supports that means the size of code 3x(1 lang. code size). So Its not efficient. For example
;---------- ALGORITHM 1---------------
;for English
if lang=0 then
lcdout 254, 0, "English Menu"
....
....
.... (All program codes)
endif
;For German
if lang=1 then
lcdout 254, 0, "German Menu"
....
....
.... (All program codes again)
endif
;For Italian
if lang=3 then
lcdout 254, 0, "Italian Menu"
....
....
.... (All program codes again)
endif
;-------------------------
But I want to develop ALGORITHM 2. But I have some problem. I want to use variables for the LCD's menus. So the user when the select the language I will change the variables's value to the suitable language value and I will stamp to the lcd's menu. But I didn't find how I can I do that. I mean:
;---------- ALGORITHM 2---------------
; LCD menu's items.
; we are adjusting LCD menu's language
if lang=0 then
Var1 = "Eng. Menu 1"
Var2 = "Eng. Menu 2"
endif
if lang=1 then
Var1 = "Ger. Menu 1"
Var2 = "Ger. Menu 2"
endif
if lang=3 then
Var1 = "Ita. Menu 1"
Var2 = "Ita. Menu 2"
endif
lcdout 254, 0, Var1
lcdout 254, 40, Var2
....
....
.... (All program codes, only one)
;-------------------------
I hope I could describe my problems. what should I do? I need your valued ideas. Thank you so much.
best regards
I am on a new project. I am using a 2x16 LCD. I have to make multi language support. I have a lot of way that goes to the solving. But I am searching more powerful and stable an algorithm. I can use ALGORITHM1, there is no problem. But I am using all codes again again that how much I am using language selection. So If I am using 3 lang. supports that means the size of code 3x(1 lang. code size). So Its not efficient. For example
;---------- ALGORITHM 1---------------
;for English
if lang=0 then
lcdout 254, 0, "English Menu"
....
....
.... (All program codes)
endif
;For German
if lang=1 then
lcdout 254, 0, "German Menu"
....
....
.... (All program codes again)
endif
;For Italian
if lang=3 then
lcdout 254, 0, "Italian Menu"
....
....
.... (All program codes again)
endif
;-------------------------
But I want to develop ALGORITHM 2. But I have some problem. I want to use variables for the LCD's menus. So the user when the select the language I will change the variables's value to the suitable language value and I will stamp to the lcd's menu. But I didn't find how I can I do that. I mean:
;---------- ALGORITHM 2---------------
; LCD menu's items.
; we are adjusting LCD menu's language
if lang=0 then
Var1 = "Eng. Menu 1"
Var2 = "Eng. Menu 2"
endif
if lang=1 then
Var1 = "Ger. Menu 1"
Var2 = "Ger. Menu 2"
endif
if lang=3 then
Var1 = "Ita. Menu 1"
Var2 = "Ita. Menu 2"
endif
lcdout 254, 0, Var1
lcdout 254, 40, Var2
....
....
.... (All program codes, only one)
;-------------------------
I hope I could describe my problems. what should I do? I need your valued ideas. Thank you so much.
best regards