HotShoe Well-Known Member Licensed User Longtime User Jun 28, 2012 #1 I'd like the ability to use language files in B4a apps. So I can translate strings in my layouts to different languages using the res directory structure. I have had requests from customers, but I see no way to do this in b4a yet. --- Jem
I'd like the ability to use language files in B4a apps. So I can translate strings in my layouts to different languages using the res directory structure. I have had requests from customers, but I see no way to do this in b4a yet. --- Jem
Erel B4X founder Staff member Licensed User Longtime User Jun 29, 2012 #2 It is already possible with the help of the Reflection library: Is the standard Android-Localisation - Feature possible?
It is already possible with the help of the Reflection library: Is the standard Android-Localisation - Feature possible?
warwound Expert Licensed User Longtime User Jun 29, 2012 #3 I've just updated my AndroidResources library with a method which can do the same as the code posted by Erel but not require the Reflection library. If you have an app where you want to define many Strings and use them in your app my new method will work but is not optimised. I could create a new method where you pass an array of String resource names and the method returns a Map containing resource name keys and resource values as Map values. That'd be more efficient - post in this thread or the AndroidResources thread if you'd like me to create such a method. Martin.
I've just updated my AndroidResources library with a method which can do the same as the code posted by Erel but not require the Reflection library. If you have an app where you want to define many Strings and use them in your app my new method will work but is not optimised. I could create a new method where you pass an array of String resource names and the method returns a Map containing resource name keys and resource values as Map values. That'd be more efficient - post in this thread or the AndroidResources thread if you'd like me to create such a method. Martin.
warwound Expert Licensed User Longtime User Jun 29, 2012 #4 http://www.b4x.com/forum/additional...pdates/16847-androidresources.html#post110026 Check out the new GetApplicationStrings method! Martin.
http://www.b4x.com/forum/additional...pdates/16847-androidresources.html#post110026 Check out the new GetApplicationStrings method! Martin.
HotShoe Well-Known Member Licensed User Longtime User Jun 29, 2012 #5 Thanks Martin, I just got your lib and it looks great. All kinds of wishes are answered there. Thanks! --- Jem
Thanks Martin, I just got your lib and it looks great. All kinds of wishes are answered there. Thanks! --- Jem