Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 9    Views: 69

benedettoapp
Lost but trying
Profile
Posts: 139
Reg: Jun 22, 2013
Italy
6,340
02/25/16 05:51 PM (8 years ago)

Translate and remove menu?

How would i go translate this menu: http://goo.gl/lYgNFN and remove the "Refresh all data" button? Not self hosted, android, home screen,(1st screen) I found on forums that by eliminating the "Configuration Data URL" and the "Report to Cloud URL" it wouldn't show up, but it still does. I found on BT_fragment.java by commenting out line 1025 and 1029 i can remove the close and the quit app buttons, but i really want to just translate those 2. On the same file i found on line 995: menuItem = menu.add(Menu.NONE, -1, 0, getString(R.string.refreshAppData)); but if i comment this out, i get errors in android studio and cannot start the app. any suggestions? line 1025: menuItem = menu.add(Menu.NONE, -3, 0, getString(R.string.close)); line 1029: menuItem = menu.add(Menu.NONE, -4, 0, getString(R.string.quitApp));
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/25/16 06:12 PM (8 years ago)
Inside your project is a file called 'BT_config.txt'. If you remove the configuration data URL from that, it will eliminate the 'refresh all data' capability. Keep in mind everything boils down to what it 'first' finds in the app. Make sure the app is as close to the way you want it before release. With respect to 'translation', the multilingual apps I've done were accomplished by modifying the 'strings.xml' file for each language 'project'. Cheers! -- Smug PS: Mark (aka GoNorthWest) has a slew of training videos on his YouTube channel, and also wrote a pretty nice writeup on 'offline' apps, which would cover the 'app refresh' issue. It seems to be gone from the 'how to' section, but I keep a copy on my server: https://www.marianasgps.com/public/Understanding_App_Refresh_and_Offline_Apps_v1.0.pdf also, Susan Mextoxen keeps a cache of translation related materials on her website: http://whitebuffalomobile.com/Localization/localization.html
 
benedettoapp
Lost but trying
Profile
Posts: 139
Reg: Jun 22, 2013
Italy
6,340
like
02/25/16 06:19 PM (8 years ago)
In my bt config it's already not there: "dataURL":"", "reportToCloudURL":"", As for the strings.xml thanks, i haven't tried it yet, but i'm confident it will work.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/25/16 06:24 PM (8 years ago)
It sure works for me :) I'd say try removing the app from your device... just delete it. Also 'clean' your project. Once you're sure you've removed any existence of the 'old' stuff, try it again. I know it works, so it 'should' work for you. But again, be sure that your project 'BT_config.txt' has all that removed, so it doesn't slip into the cache again. Cheers! -- Smug
 
benedettoapp
Lost but trying
Profile
Posts: 139
Reg: Jun 22, 2013
Italy
6,340
like
02/26/16 06:23 PM (8 years ago)
@Smug Ok the translations worked, the 3 menu items are now translated. But as for the refresh all data, even if i started from scratch rebuild everything and made sure there is no configuration data URL in the BT_config.txt file, it still shows up, i did clear the app and uninstalled it, I also installed the app in a new device, but it's still there. Do you know a workaround or another way to disable it?
 
benedettoapp
Lost but trying
Profile
Posts: 139
Reg: Jun 22, 2013
Italy
6,340
like
03/01/16 05:32 AM (8 years ago)
About the translations, would it be possible to have both the english and others so depending on system language the app would automatically take the corresponding one?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/01/16 01:06 PM (8 years ago)
That's exactly how it works. You will include resources for each language in your app bundle, and the device language is the language the app should display in. You set a default language, so if the user device is a language not 'covered', it will display in a default language. Cheers! -- Smug
 
benedettoapp
Lost but trying
Profile
Posts: 139
Reg: Jun 22, 2013
Italy
6,340
like
03/02/16 09:04 AM (8 years ago)
I've searched a bit but didn't find an answer, all the files i found are named different and/or all named strings.xml, how would i name the default one and the other languages?. And they will all go in the res/values folder? Thanks
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/02/16 02:30 PM (8 years ago)
 
benedettoapp
Lost but trying
Profile
Posts: 139
Reg: Jun 22, 2013
Italy
6,340
like
03/02/16 02:42 PM (8 years ago)
Thanks
 

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.