Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 116

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
03/03/17 04:01 PM (7 years ago)

BT 4 Localization Question

I was playing with localisation for an ios app idea today. I was following this document http://whitebuffalomobile.com/Localization/content-localization-ios.pdf, which summarises the youtube video https://www.youtube.com/watch?v=BcZ485Wp80s by David. All went well until the very last line, which is configurationFileName = languageFileName - it seems configurationFileName no longer exists! I think this is tied into the new database approach and I can't figure out how to change the configuration file for BT4. So it made me start thinking. Having to create a new app for every language translation eats into the allowed maximum and perhaps that is not necessary, if I can build all the screens into the one app. So I was wondering, instead of changing the configuration text file, would there be a way to just swap over the theme and the first screen to be loaded instead? If so, how? Or alternatively, how does one swap the config text files over these days?
 
MacApple
Apple Fan
Profile
Posts: 4674
Reg: Oct 25, 2010
USA
61,140
like
03/06/17 03:13 AM (7 years ago)
Hey Alan. Smug isn't around right now and asked me to tell you he is unable to reply to messages. Just an FYI.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
03/06/17 04:10 AM (7 years ago)
Thanks Keith.
 
MacApple
Apple Fan
Profile
Posts: 4674
Reg: Oct 25, 2010
USA
61,140
like
03/06/17 04:18 AM (7 years ago)
NP good sir.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
03/06/17 05:09 AM (7 years ago)
Well, I did some more digging and I found out that David has actually built in support for switching config files based on the device language already - doh! As per the video's etc, the two letter language code is at the heart of the logic - eg. de for German, fr for French, etc etc. The default language for Buzztouch is English (en) and accordingly, the default json file is called BT_config_en.txt. I created a german language config file - it has to be called called BT_config_de.txt. On first load, the app always tries to pick up the config file to match the language of the device. So if I start my app first time round on my german iPhone it loads up BT_config_de.txt. If I use my english iPhone it uses BT_config_en.txt. One thing to bear in mind - a BT app is designed to do it's first load of its config file from the project local bundle and then afterwards, it refreshes from the internet. So if you are updating an app, make sure you remove the app (and hence it's associated data) from your device memory first. Then, as long as the language specific config files are in the xCode project, it just works and picks up its updates correctly.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
03/06/17 06:03 AM (7 years ago)
One other thing, does anyone know if, when using buztouch, can one have multiple Localizable strings and auto-switch between them? The project keeps these in a folder called Base.lproj.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.