mrossen Active Member Licensed User Longtime User Oct 8, 2011 #1 Hi there, I have made a project where all the text are in english. I would like to add different language for the project. I have tried to make a code module for the job. My problem is that I can not access the variables for the labels I have made with the designer. I would like to ex write lang.dk and then all text in my project is in danish. I have made a small ex. what I am trying to do. But I dont know how to declare the variables. Mogens Code: Copy 'Code module 'Subs in this code module will be accessible from all modules. Sub Process_Globals End Sub Sub dk LabellOutputTextCircuitOne.Text = "Kredsløb 1" End Sub Sub en LabellOutputTextCircuitOne.Text = "Circuit 1" End Sub Last edited: Oct 8, 2011
Hi there, I have made a project where all the text are in english. I would like to add different language for the project. I have tried to make a code module for the job. My problem is that I can not access the variables for the labels I have made with the designer. I would like to ex write lang.dk and then all text in my project is in danish. I have made a small ex. what I am trying to do. But I dont know how to declare the variables. Mogens Code: Copy 'Code module 'Subs in this code module will be accessible from all modules. Sub Process_Globals End Sub Sub dk LabellOutputTextCircuitOne.Text = "Kredsløb 1" End Sub Sub en LabellOutputTextCircuitOne.Text = "Circuit 1" End Sub
agraham Expert Licensed User Longtime User Oct 8, 2011 #2 The only way to access the Views of an Activity in a Code module is to pass them as parameters of Subs. Or you could return the country specific text from a Sub in a Code module and do the assignment to the View property in the Activity that owns the View. Upvote 0
The only way to access the Views of an Activity in a Code module is to pass them as parameters of Subs. Or you could return the country specific text from a Sub in a Code module and do the assignment to the View property in the Activity that owns the View.
K Kimmowich Member Licensed User Longtime User Oct 8, 2011 #3 Hey Had the same problem.. made this module: http://www.b4x.com/forum/basic4android-getting-started-tutorials/10543-activity-translation.html#post58672 Could be this is what you are looking for. Upvote 0
Hey Had the same problem.. made this module: http://www.b4x.com/forum/basic4android-getting-started-tutorials/10543-activity-translation.html#post58672 Could be this is what you are looking for.