Localizable.strings files.. in xcode4
In xcode4, (I have used v4.0.1 until now and downloaded v4.0.2 yesterday.) I made Localizable.string files and compiled my project. (As you know, my source code uses NSLocalizedString macro function.)
But my project doesn't compile with Localizable.string file. If I change all code in this file to comments( like this -> // ), my project is compiled completely.
As result, the problem is Localizable.string files. I searched about it on Google, I found that UTF-8 files (Localizable.string) is changed to UTF-16. And though I tried this... this way didn't work, too.
On this moment, many people are trying to use Localizable.string files. But they might solve this problem that I can't do. Because there aren't the questions about this problem so many.
In Localizable.string file,
"LOCAL_APP_GRADE" = "Basic"
"LOCAL_APP_LAST_UPDATED_DATE" = "2011/04/20"
"LOCAL_MAIN_MENU_TITLE" = "Main Menu"
In my source code,
NSLocalizedString( @"LOCAL_MAIN_MENU_TITLE", @"" );
Copy .strings file Error Validation failed: The data couldn't be read because it has been corrupted.
I'm assuming Xcode 4 here. Double check what it shows for the encoding on each of the Localization.string files in the file inspector. When I was having that error it was due to one of the files being read as Mac Roman instead of UTF-16. Once I changed the encoding the warning went away. What was driving me nuts at first was that the warning was only happening in Xcode 4. Xcode 3 did not give it.
You also have an issue with the formatting of your .string file. All of the lines should end in a semicolon.
"LOCAL_APP_GRADE" = "Basic"; "LOCAL_APP_LAST_UPDATED_DATE" = "2011/04/20"; "LOCAL_MAIN_MENU_TITLE" = "Main Menu";
I don't think this is the cause of the warning though. At least I've never seen a warning for it. It usually only manifests itself at runtime when LOCAL_MAIN_MENU_TITLE shows up in app instead of Main Menu. It would be nice if the build process did check for semicolons though. It's easy to miss adding one when editing the files.
Localization, strings file · xcode localization xcode4.4. I have found this post about how to add localization to an app. The answer is very Note: If Xcode warns you that the Localizable.strings file appears to be Unicode (UtF-16), you can convert it to Unicode (UTF-8) using the File inspector. To convert a file to UTF-8, select the file in the project navigator and open the File inspector.
If you run into problems during testing and find that the functions and macros for retrieving strings are always returning the same key (as opposed to the translated value), run the /usr/bin/plutil tool on your strings file. A strings file is essentially a property-list file formatted in a special way. Running plutil with the -lint option can uncover hidden characters or other errors that are preventing strings from being retrieved correctly.
Fire up a console window, go into your project folder, and do:
/usr/bin/plutil -lint ja.lproj/Localizable.strings
(obviously replace the correct language folder name). This will tell you exactly where the problem is!
Internationalization and localization - Help, Extract values to strings file. In the editor, place the caret at a string literal that you want to localize. Further differing from .strings, XLIFF files aren’t bundled in your app. XLIFF’s an interchange format — Xcode can generate the files when it’s time to request your translations, then ingest the updated files you get back from your translator. What makes XLIFF support so interesting to me as a developer is how the files are generated.
All of the lines in .strings file should end with a semicolon. It worked for me.
How to Use Localized Strings in Xcode 4, In Xcode 4, using localized strings is a piece of cake. To start, create a new strings file to store your default localization. Select "New File. This is my whole file: "Test locale" = "Test locale" And when I try run my application I get this error: Localizable.strings:0: error: validation failed: The data couldn’t be read because it has been corrupted. I've tried changing the "Text Encoding" to UTF-16 but nothing resolved. Any ideia? Thanks in advance.
I had the same issue today after importing the localisations from Apple Notes and the cause was really subtle. The standard double quotes had been swapped with slanting double quotes.
Slanting double quote: "
Standard double quote: "
iphone Localizable.strings files.. in xcode4?, (As you know, my source code uses NSLocalizedString macro function.) But my project doesn't compile with Localizable.string file. If I change all The concept of base internationalization was first introduced in Xcode 4.5. An app has just one set of storyboards that is localized to the default language. These storyboards is known as the base internationalization. Later when we create a localization, Xcode automatically generates a strings file containing all the text in the base storyboard.
I've been struggling with this same error, and ended up having a couple similar issues, but with different details. First off, even though it appears that Xcode's internal "builtin-copyStrings" tool should be able to handle either little-endian or big-endian UTF-16 files, it really only handles big endian. My theory is it's running some extra validation step (perhaps using the plutil command line utility) that didn't used to happen in Xcode 3, and that tool barfs on anything but big-endian UTF-16. Not entirely sure though.
The second trick is that you need to make sure your strings files are saved with no BOM (Byte Order Marker). I did some editing of my .strings files in BBEdit, which ended up saving a BOM to the file, and that also appears to make Xcode 4 have a conniption fit. Xcode itself doesn't appear to have any way to remove the BOM from the file, so this has to be done in a text editor such as BBEdit or TextWrangler which can do that for you.
Xcode 4 Unleashed, First off, even though it appears that Xcode's internal "builtin-copyStrings" tool should be able to handle either little-endian or big-endian UTF-16 files, it really The simple fix: select the XIB file(s) in Xcode, change the file type to something else, and then change it back to the Default type. After doing this, clean and rebuild. As documented by the Stack Overflow thread, the bug was present in April 2011 (Xcode 4.0), and I confirmed it is still there in Xcode 4.6.1.
Step Into Xcode: Mac OS X Development, (Localizable.strings). Second, the genstrings commandline utility can scan source code for these macros and generate .strings files automatically. The simplest For the file type Localizable Strings, Xcode creates a strings file for that resource. If you prefer to maintain a separate .storyboard or .xib file for the language, choose the type of resource file from the File Types pop-up menu instead—for example, choose Interface Builder Cocoa Touch Storyboard for a Mac storyboard file.
Migrating to iPhone and iPad for .NET Developers, This turns GraphWindow.nib in the Groups & Files list into a localized group, with the So what we want to do is localize and extend the InfoPlist.strings file. Localizable.strings – How to load translation files dynamically from a web server and use them it inside your iPhone App 4 January, 2013 admin Localization 19 We all know we can use “Localizable.strings” to translate our Apps into different languages like this in our code:
Localizable.strings, This allows your string values to be configured for the locale in which you're deploying Store the values in your Localizable.string file in the following format: Add a new File to the project of type Strings and provide a name as Localizable.strings. Select Localizable.Strings in Project Navigator and click Localize button available under File Inspector. Then Select English in the Localize drop down and make sure to mark German in the Localization section under File Inspector.
- Could you post the compile error and the strings file if it isn't large? My guess is that you have a formatting error in the strings file, but it's hard to give a fix without more info.
- @McCygnus I have appended my code. Thank you for your comments.
- Your strings file needs a semicolon at the end of each line.
- oh!!! my god!! Thank you very very very really really much. I was fool. You have made me awake. I already changed to UTF-16, but I missed ';'. This made the error happen. (Copy .string file Error Validation failed). And this made me confused. I never thought this made the issue happen.
- You told me to append my code on this board, it made me know that what the issue was. I can't use NSLocalizedString function since I start to use xcode4. But I can do this now. Thank you!
- I appreciate all your answer and your trying. I am very happy.
- This is especially confusing in Swift because you don't need semicolons in the Swift code, so you're in the habit of leaving them off the end of the lines, but it turns out you still need them in the *.strings files.
- it tells me my comments are invalid, but they are not.
- @jimpic - So far when I've used this, about 95% of the time it works, but sometimes I've noticed, like if you have stray text in the file, then that will screw it up and it won't give a valid response (for me it kept saying that the first character in the file was invalid when it wasn't). Try it again next time and it may help you.
- This tool worked for me. I was running into the mysterious "Copy .strings file Error" and plutil identified several places with extraneous and unescaped quote marks in a very large Localizable.strings file. It finds one bad quote at a time so you have to run it repeatedly. Thanks!
- This is huge - thanks so much for that tool. I had some translated files and there were unescaped double quote characters in the middle of a string. The original used single quotes.
- In my case in turned out to be incorrectly escaped "