I am trying to change text in FBLoginView button but I have no luck so far. I've tried to read README from FacebookSDK and look at internet. I added 2 languages in project Localizations sections it creates 2 files in Supporting files for each language but I tried to change strings in there with example content of README (with changed string values) but even if I changed english file I always get default login string.
Then I tried to add some Bundle settings and change some files in there but with no luck too. Can someone tell me how can I achieve change facebook strings step by step? Thanks
Update:
The method described here is no longer applicable for the latest Facebook SDKs. So please refer to the answers given by #Erik van der Neut or #Ted, and use the bundle FacebookSDKStrings.bundle that ships with the SDK for string overrides.
The only way I found so far to localize/change the Facebook strings is described in their FAQ: https://developers.facebook.com/docs/ios/troubleshooting/
What I did was to copy the file FacebookSDKOverrides.bundle from the Scrumptious sample project that ships with the Facebook SDK. This is basically just a package that contains (can contain) different localization folders. If you want to add German strings, create a folder de.lproj within the bundle. This folder should contain a file Localizable.strings.
You can find a list of all overrideable strings in the file FacebookSDKResources.bundle.README. You can find it in the FacebookSDK folder:
FacebookSDK.framework/Resources/
or here: https://github.com/facebook/facebook-ios-sdk/blob/master/src/FacebookSDKResources.bundle.README
To add a German translation of the text of the login button, for example, you have to add the following to the file Localizable.strings in de.lproj:
"FBLV:LogInButton" = "Einloggen";
As a last step, you have to make sure that Facebook knows about the bundle. Therefore, you can add the following to your Info.plist:
<key>FacebookBundleName</key>
<string>FacebookSDKOverrides</string>
Alternatively, you can also specify this in code if you want to:
[FBSettings setResourceBundleName:#"FacebookSDKOverrides"];
This worked for me, although I would like to use my main bundle for overrides and just specify them in my normal app translations. This would come in more handy for the connection to translation tools as you don't need to translate multiple files per language.
As of Facebook SDK 4.9
If you have downloaded the Facebook SDK, theres a bundle named "FacebookSDKStrings.bundle"
add FacebookSDKStrings.bundle to your project
make sure you enable Base Internalization as described in Apple's documentation.
As an update to the accepted answer here from Flo:
For the latest Facebook SDK, the set of Facebook messages (and their identifying keys) has completely changed. For example, the "FBLV:LogInButton" key is no longer valid in the latest Fb SDK.
Because of this my Facebook strings were no longer getting localized, until I realized this and replaced all my Facebook messages with the latest FacebookSDKStrings.bundle (v4.2) from https://github.com/facebook/facebook-ios-sdk -- I simply removed my original FacebookSDKOverrides.bundle and included this whole bundle FacebookSDKStrings.bundle as is in my project (including the Resources sub folder in there), updated my project .plist files to point to it, and with that all the Facebook strings got localized again.
For example, the message for the default Login button label now looks like this:
/* The long label for the FBSDKLoginButton when the user is currently logged out */
"LoginButton.LogInLong" = "Log in with Facebook";
Luckily, Facebook's GitHub page now includes translations for these messages for lots of languages already (which in my case meant I no longer needed to run these past my translators).
I just copied all string from "FacebookSDK.strings" from folder of langauge you want like fr.lproj to my poject Localizable.strings (French) ...This way worked for me...
Related
I want to be able to update localized strings by code from the app. What I actually want to do is to make changes to the localization on a server and then let the iPhone application fetch updated localization strings from a server and then save them to the localizable.strings file.
You can't ! Those files are part of the bundle and can't be updated. You will have to setup the whole translation framework by yourself (which is not that much work) and implement caching using either core data or serialized dictionaries (one for each language I suppose).
You won't be able to modify the Localizable.strings file in your app bundle because the app bundle is read-only on iOS devices. To grab localized strings from a strings file in your app's Library directory, you could programmatically create a bundle at that location, put a Localizable.strings file in it and then grab the localized strings with NSLocalizedStringFromTableInBundle(). (I haven't tried this but it should work.)
There's service (Get Localization) that allows you to upload those .strings files to server and fetch them via API. However there's no client for iPhone yet but it would be quite simple to do. You can contribute one or then wait that there's official available.
I want to internationalise the comment used to give more details about a required authorisation.
My whole project already use a Localizable.strings and everything works fine.
But I can't get to make it works with these sentences located here:
Am I missing something here? I already tried to add a simple word, that is translated in the Localizable.strings but no effects on it so far :(
I am using Parse SDK as a backend and when application loading data from server i see label "Loading". But my app using another language and i wanna translate it. How can i fix it?
Image here
I am tried to change simulator language and and changing value of Localization native development region key in plist.
Anyone had this problem? I think there is very simple answer, but i cannot find it. :)
Thank you for help!
So after a long search, i discovered that you should create a file named "ParseUI.strings" in order to change UI elements like "Loading.." as you mentioned. You can see the file in the image below. You should use at least ParseUI framework 1.1.6 for this method.
After you create a file and named it as "ParseUI.strings" you can change UI elements which parse provides us. You can see which strings are editable here.
In your example you want to change "Loading..." string, so all you have to do is enter the code in your ParseUI.strings file.
"Loading..." = "Whatever thing you want to say...";
Thats it, it worked for me.
I'm relatively new to iOS development. My question is quite simple but there seems to be a lot of un-complete answers out there.
For example, I have a few pictures that are used in my app and I don't want the users to have access to these pictures at all (due to copyright). I've included these into the "Bundle Resources" along with the "Image.cxassets" and other .xib files.
Will the user ever be able to access the pictures? (I understand that the user can't access the Library folder but it seems to be a pain to copy the pictures into the Library folder at app first launch.)
thanks ahead for answering.
I didn't understand what exactly you're asking, but for users to access your app bundle contents the file sharing for iTunes option should be set in .plist. See in the reference
Although you may put dot before file ".image.jpg" to make it hidden but it sounds like temporary solution.
I understand the basic of Document Interaction Programming and UIDocumentInteractionController and I've got it working in my app. However I'm having trouble with specific details of using custom file types. I can't find this addressed in the Apple docs anywhere.
My app uses it's own file types with unique extensions. The files themselves are just plists (xml), but I want the device to treat the files as only openable in my app. Originally I implemented the Document Interaction stuff to treat them as XML while I got it working, but now I want it to treat them as binary files that it needs to hand off to my app.
At the moment, if you have one of my files in an email attachment, iOS first shows the QuickLook (which just spews all the text content of the xml out) before you can choose to Open In. Similarly if one of my files is opened with Safari, Safari just shows the XML and doesn't give you the option to show it in my app at all.
So how do I get iOS to not treat my files as XML? I've changed the "Conforms to UTI" value and "public.mime-type" value in the info.plist, but it seems to have no effect.
Any tips greatly appreciated.
As far as i understand the UIT concept of Apple you cannot just change the file extension to change a potential UIT of the file. If the file contains XML-Data, other apps as well as internal apps might recognize your content and show it internally as XML.
Try to store your Plists with NSPropertyListSerialization NSPropertyListBinaryFormat_v1_0 (then you readble XML)
When you did that without success, why not trying this:
use zlib to compress the XML plists afterwards to a zipped file.
make a "unique" file extensions (<file>.myappname)
this should "hide" other apps and quick view.
Tell me if one of the ways did work for you.