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 :(
Related
I want to add chinese, simplified to localization file and a message shows:
“Localizable.strings” couldn’t be copied to “zh-Hans.lproj” because an item with the same name already exists. To save the file, either provide a different name, or move aside or delete the existing file, and try again.
There is not chinese, simplified in the list and I just can't add it. By the way, other languages works fine when I try to add them.Anyone know how to deal with it?
I find the reason at last. Maybe my colleague add the chinese, simplified before and he didn't delete the file in the project but just delete the cell in the list. After I delete the chinese, simplified file in the project, it works fine.
We're currently at the stage of looking at localising our app in to multiple languages now that the general concepts of the app have been decided. This is something I want to ensure is done correct from the start to lower the risk of headaches in the future.
The app targets iOS 7 and above, uses storyboards, and is written in Swift.
Storyboards
When working with a storyboard (or a xib), what's the best way to mark a UI element as "not to be translated"? For example, I have a placeholder string for a user's display name (Display Name), which will be replaced by a users display name at run time. This display name will not be localised, but neither should the string "Display Name". Is there a method of not having a UI element's value automatically put in to the strings file? If not, is going in to that file and manually removing strings I don't want localising a sustainable option?
Strings In Code
I'm using the Swift function NSLocalizedString with the key and comment parameters. Some places I've seen say to set the key to be a unique id based on the context (e.g., intro.login-button-text), while others seem to just put the full string in the default language (e.g., Login). I like the idea of the unique ids for the key, but would this not go against the idea of the "base" language?
Exporting
Xcode 6's "Export For Localization" option seems very useful for getting the correct format of file to be sent to translators. However, as mentioned previously, placeholder text does not need to be translated. Should these placeholders be removed from the exported xliff or the strings file prior to export?
Looking for the the same questions myself. Hope this will help you and others. Also I would recommend to have some kind of tool to organize the xliff/string files
Storyboards:
I've seen developers putting non translating texts in storyboard with extra parentheses. i.e. {Display name}.
By using this you can see by the translation itself if it needs to be translated or not. We use oneskyapp.com and can select to hide those translations and they will be hidden for each import of that key.
Strings in Code
By following this thread they suggest to use keywords.
Best practice for key values in translation files
Exporting
I cannot find a way to have some translations automatically removed when exporting. Off course you can put the views which has dynamic fields in different XIB/storyboards and decide not to translate those.
Again a tool like onskyapp.com can help you with this.
Formats
As of context with the field is important and a translation can be different when it is followed by i.e. a users name I would go for "%1$# is online!"
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 can't get my app to work with localization.
I have created a Localizable.strings file and ticked the languages that I am localizing. (For now I have base, english and spanish.)
Localized storyboard with three languages.
In Project settings > Info I checked Use Base internationalization and all languages are correctly added. (Moreover, beside the language it shows 2 Files Localized, which I guess they must be the storyboard and .strings file.
I am using this example for testing:
self.loginLabel.text = NSLocalizedString(#"login", #"Login text info");
This is how the Localizable.strings (Base) file is looking like:
"login" = "Log in";
However, it is not working and instead it is showing login. Have I forgotten a key step?
BTW: I have tried already changing the login text just it case something was overriding the label.
Those are the steps indeed, I don't think you've left anything out. I usually set the comment to nil instead of another NSString though - not sure if that makes a difference.
However, rather than in only base, make sure you're adding the same line also to the English and Spanish files (obviously translated as appropriate).
Next, for the language to show up, set the device to said language. Close your app and start it again. Strings should now show up in the other language.
Note that the Simulator often has trouble with new translations, especially when they've been added to an already deployed app. In that case, remove the app from the Simulator, click on Product - Clean, and re-deploy.
In my case, it didn't work because the UILabel text was set as "Attributed" instead of "Plain" in the Attributes Inspector.
Localization with a .strings file doesn't seem to work on Attributed strings.
I even had a storyboard with mixed Plain and Attributed string labels, and the localization only worked on the Plain ones.
For anyone having a similar issue in the future:
Check if your *.strings file has any non-printed characters.
I used JavaScript for a simple task and didn't realize it included some whitespace characters.
An easy way to check is to put the translation at the top of the file and see if it works. If it does, there might be some whitespace characters. The next steps are... binary search and remove the whitespace characters.
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...