Localizable string in Foundation.framework not found - ios

I'm getting this log warning while using my app and I'm not sure how to deal with this message:
2014-10-21 12:57:54.472 App[7067:2540152] Localizable string "(A Document Being Saved By %#)" not found in strings table "Document" of bundle CFBundle 0x12e508f60 (not loaded).
It seems, the localization file within the framework is missing, which would be really weird. Re-adding the framework didn't help.
Any hints apprechiated.

I'm getting the same message. In my case it looks like both TestFlight and Crashlytics are generating them;
[TestFlight takeOff:#"xxxxxxxxxxx"]; // Generates 2 messages
[Crashlytics startWithAPIKey:#"xxxxxxxxxxx"]; // Generates 1 message
Not causing us any trouble, so leaving them alone for now.
Update
Ok, got to the bottom of it. If you've been doing localization, chances are you probably enabled 'Localization Debugging' in your scheme (Product > Scheme > Edit Scheme in Xcode). If you're wondering why you're getting these messages from the various libraries, it's probably because you still have it enabled.

I just had this problem too.
Since turning off the warning seems like a bad idea (Feels like high risk translations will not work as intended), I tracked down what actually caused the problem.
In my case, the problem was an empty string in the Localizable.strings file. (I used a non-standard way to generate it, the default genstrings tool will not add them)
That is, in one place I had this line:
/* No comment provided by engineer. */
"" = "";
If I removed it, the warning disappeared!
Seems like there is some problem in the string table implementation if you add empty strings, that makes all string tables mess up, not only the one where the problem is...
Maybe someone will find this information useful, so I leave it here.

If you don't specify "Document" then it will look in the file Localizable.strings. Otherwise make sure you have the file Document.strings in your project. Also, "(A Document Being Saved By %#)" looks pretty weird to me. You might want to check this is really what you want as a key for a localizable string.
Here is a link that may help you understand the process
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html

From what i found in my recent project, this error occured when you have the english language (just english with no region) defined in your device.
Since one or more framework will fail to find translation strings you will have this error in your console log.
Hope that helps

Another common mistake is the forgotten ";" at the end of any line in the file, that holds your Localizable.strings. This can easily happen after massive copy and paste. Unfortunately it is not easy to locate, because the compiler does not complain with a line number or any other helpful hint. This can be very painful and tedious, when you have big localizable tables.
The result of that mistake will be, that some translations are found, others not and its hard to find the reason.
My solution to make sure, all keys are proper defined (with the ";" at the end of the line):
Open your file "Localizable.strings" in Xcode
Delete the lower half of the table (for a start)
Press COMMAND + B (build)
If you don't get an error, the problem must be in the deleted lower half. Paste it back, delete now only the lower 25 % and repeat build. Repeat the process until you can better locate the problem.

Looked all over StackOverflow looking for a solution.
And found a mistake.
I just duplicated the localization, for example:
let str = "String".localized
After that, as well:
str.localized
And after that I claim
[strings] ERROR: String not found in table Localizable of bundle
CFBundle 0x14bd01fc0

Related

NslocalizedString return the key instead of the value

I create tow Localizable.strings files one for english and the second for arabic :
/* The number 1 */
"LABEL_ONE" = "label number one";
I am using this code to get the string value:
[self.Lable1 setText:NSLocalizedString(#"LABEL_ONE", #"The number 1")];
but the app show "LABEL_ONE" instead of "label number one" ?
What's the problem ?
Thanks
Your string files name have to be Localizable.strings.
In addition to the top answer, the localization file has to be named Localizable.strings and not anything else.
Your code is correct, so the problem is elsewhere.
Here are some possibilities:
The Localized.strings file is not copied into the application bundle. To verify this focus on the Localized.strings file using the 'Project Navigator' and make sure your target is checked on the right pane under 'Target Membership'
There is some syntax issues within the Localized.strings file, i.e. missing ;
The code you quoted does not get executed. To verify put a breakpoint and see if it's reached or use some debug logs...
The string appears in the Localized.strings for Arabic but is missing for English.
Your problem is very simple:
The app doesn't find the file with translations.
So you must be sure that you create the localizable files with the correct name (for example en for english) and also that in your device (or simulator) you have set 1 of the languages prepared from you in these files.
Otherwise, the file is not found and is returned the key instead of the value.
try this answer it is work for me
I was having problems with this on the iOS Simulator. I ended up deleting the Localization.strings file in the simulator directory
( /Users/(me)/Library/Application Support/iPhone Simulator/5.0/Applications/(etc)/(project)/(application.app)
copied from here
https://stackoverflow.com/a/11657945
In my case cleaning the project after initially introducing i18n to it solved it.
Check whether you added any text/character by mistake after the ; in Localizable.strings file.
It doesn't show the error while running the app but XCode ignore all the key-value pair after this character, which leads to returning the key instead of values.
I put a + by mistake in string file and wasted 2 hours for this.
Make sure that the Target Membership is set to include your App and any other places you may need it. In my case, the membership was only set to the test folder
[Answer from August, 2017. Compiler may have changed]
Search for a syntax error in your .strings File
I had the following line:
"Changed your mind?" = "¿Cambiaste de opinión?";,
And somehow that made the compilation succeed, even the command plutil -lint Localizable.strings said it was okay. After I took the same comma down from each file in that line, now the compiler is able to detect there are errors.
The problem before was the compilation succeeded, but because of the comma the .strings file was actually wrong so nothing after the comma was read. I don't know if the comma has any use in .strings files.
Note:
plutil -lint Localizable.strings is used on the Terminal tu debug .strings files as Xcode cannot tell where the .strings compilation wen wrong.

Xamarin ios - import library

I need help importing a library to Xamarin. I included the library and inserted it into a new folder named BarcodeScanner, and the name of the library is libBarcodeScanner.a.
gcc_flags "-L${ProjectDir} -lBarcodeScanner -force_load ${ProjectDir}/libBarcodeScanner.a”
But it shows an error:
Error: Could not parse additional mtouch arguments: No matching quote found.
What should i do ?
Do i need to create a binding project to use a library like BarcodeScanner ?
Error: Could not parse additional mtouch arguments: No matching quote found.
That does not look like a Xamarin.iOS (mtouch) error message. Those start with a MT prefix followed by 4 numbers, e.g. MT2001. Could it be Xamarin Studio giving you this error ?
What should i do ?
Review the flags: are they identical to what's pasted above ?
No matching quote found. makes is sound there's an extra quote in there. Maybe one of the " is wrong (e.g. a autocorrection giving you a smart quote) ?
Or maybe your project directory (replaced from ${ProjectDir} contains a quote character ?
Also can you edit your question to add which version of Xamarin Studio you're using ?
Do i need to create a binding project to use a library like BarcodeScanner ?
No, but it's the preferred ways to link static libraries. Using a binding project removed the need to add Additional mtouch arguments inside every projects and every build configuration (e.g. Debug, Release...) of your applications.
I will answer my own question, maybe it will help someone. I declared in my MainController that i needed:
using MonoTouch.CoreVideo;
using MonoTouch.CoreMedia;
using MonoTouch.CoreGraphics;
using MonoTouch.CoreFoundation;
And after that i referenced only the static library with:
-gcc_flags "-L${ProjectDir} -lBarcodeScanner -force_load ${ProjectDir}/libBarcodeScanner.a"
#poupou's "maybe" was spot on, but I'll be pedantic and explain exactly.
Look closely at this line I just quoted from your original question. I've marked it down using code (four spaces prefix per line), and broke it into two lines. Nothing else has been changed. Hopefully the error should be obvious now:
- gcc_flags "-L${ProjectDir} -lBarcodeScanner
-force_load ${ProjectDir}/libBarcodeScanner.a”
Essentially, you used different types of double quotes. The first double-quote character above is Unicode 0x0022, which is the regular Quotation Mark. The second double-quote character above is Unicode 0x8221, or Right Double Quotation Mark. It might be that you had copied & pasted all or part of the line above from a web page, rather than typing it in.
For command-line processing, mixing your styles of double quotes simply won't work. You'll need to use balanced regular quotation marks, as you wrote in your own answer just now (but might not have specifically noticed?) FWIW, the right- and left- variants of the quotation mark are usually used for word processing, web pages, etc. where the style aesthetic matters.
Since you didn't use code-markup when quoting that line originally (while I noticed you did, in your recently posted answer) it looks like Stack Overflow "helpfully" tried to render the quotes as similar in style, fooling us into looking elsewhere for the problem, when it was right in front of us.
Anyway, next time you get an error about mismatched quotes, I suggest you carefully check their type. If they look the least bit different, they may not be the right kind of quotes.

Attributes from MvxBindingAttributes are not added with MvvmCross

I have the MvxBindingAttributes.xml in my UI.Droid/Resources/Values but everytime I try to use the bindings in my layouts I get
Warning attribute is not declared.
No resource identifier found for attribute 'MvxBind' in package
'DroidUI'
so for some reason it cannot find those attributes. I have tried to close/reopen/clean/rebuild with no luck, tried removing the layouts and then building (Hoping it would add them at build) and then try to add them again, but nothing seems to work
Have you checked that the MvxBindingAttributes.xml file is marked in properties as an AndroidResource?
VisualStudio likes marking the xml files as content or none instead - especially if you've added the MvxBindingAttributes.xml file as a link.
As an update to this, you can also now use a special 'auto' xml scheme:
xmlns:local="http://schemas.android.com/apk/res-auto"
In the project properties, add a Android Manifest file and add a package name that contains at least two periods, for example:
com.DroidUI
In the axml file, type the package name instead of the namespace:
xmlns:local="http://schemas.android.com/apk/res/com.DroidUI
xmlns:local="http://schemas.android.com/apk/res-auto
Fixed it for me.
First, thanks for the answer. I had the same problem.
But in my case, attempting to use the suggestions above failed. or at least that is what i thought.
When i used local:MvxItemTemplate=#layout/My_Manifest while i had the My_Manifest.axml file correctly placed in Layout folder, and correct xml schemas, it still had problems.
But, when i changed My_Manifest to my_manifest while leaving the actual file name as My_Manifest.axml, everything was working.
just wanted to share
In my case for some reason the MvxBindingAttributes.xml file existed, but hadn't been included in the project. Right-clicking on MvxBindingAttributes.xml and choosing "Include in Project" sorted the problem for me.
Just in case: You might also have rubbish (in my case, it were dots) in some of your XML. But the error pointed "Maybe there's something wrong with the auto-generated XML lol" so it took me half an hour to notice it... Sigh!

Localizing strings from the Settings.bundle using InAppSettingsKit

I am attempting to use InAppSettingsKit to manage my settings. This uses the Settings.bundle with a .plist file and the .strings files for each of the languages being translated.
I can confirm that the translation of my strings is working properly outside of my application, using the Setting application. But when I am in my application, the translation is not occurring.
I think it comes down to code like this, from the InAppSettingsKit class IASKSettingsReader, with a couple logging statements that I thought my be helpful:
- (NSString*)titleForStringId:(NSString*)stringId {
NSLog(#"%#",[_bundle localizedStringForKey:stringId value:stringId table:self.localizationTable]);
NSLog(#"%#",[_bundle localizedInfoDictionary]);
return [_bundle localizedStringForKey:stringId value:stringId table:self.localizationTable];
}
If I understand correctly, this should be using a table with the name self.localizationTable as the source of the translation. This value is simply "Root". It's not a path to the Root.strings file in the selected language, so I am guessing that the method localizedStringForKey:value:table: must be using some global system reference that points to the correct path.
I have confirmed that the strings file name is "Root.strings" all around, with a capital R, including in the Root.plist file.
[_bundle localizedInfoDictionary] returns (null); It is doing this for two language settings of English and French.
I'm not sure how to debug this. Thanks for any help you can give.
I'm using InAppSettingsKit with localized text with no problems. Two things I can think of that you could check: are your Root.strings files located in the correct subdirectories of Settings.bundle (en.lproj and fr.lproj for English and French?
Is there a "Strings Filename" entry in your Root.plist? It should simply contain a string with value "Root"
It has been quite some time since I resolved this, and at the time, I didn't fully understand it. But, in the interest of closing out this question, I'll point to the following documentation for future reference:
NSBundle Class Reference
which refers to the following:
Resource Programming Guide
In the second document, refer to the section "String REsources -> Loading String Resources Into Your Code"
The solution contains a properly configured Root.strings file, which shows up in the file list like this:

How do I fix 'Setup project with custom action file not found' exception?

I am trying to create a setup project for a Windows Service. I've followed the directions at http://support.microsoft.com/kb/816169 to create the setup project with no trouble.
I want to be able to get a value during the installation in order to update the app.config with the user's desired settings. I added a Textboxes (A) dialog to retrieve the values. I set the Edit1Property property to "TIMETORUN", and in my Primary Output action's CustomActionData property I put in the following: /TimeToRun="[TIMETORUN]\". So far so good. Running the setup I can retrieve the TimeToRun value from the Context.Parameters collection without issue.
In order to locate the app.config I need to also pass in the value of the TARGETDIR Windows Installer Property to my custom action. This is where things begin to fall apart. In order to achieve this, the above CustomActionData must be altered like so: /TimeToRun="[TIMETORUN]\" /TargetDir="[TARGETDIR]\". Now when I run the setup I get the following error message:
Error 1001. Exception occurred while initializing the installation.
System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\SysWOW64\Files' or one of its dependencies. The system cannot
find the file specified.
If you google this problem you will inevitably find people having tremendous success by simply adding the trailing slash to the /TargetDir="[TARGETDIR]\" portion of the CustomActionData. This unfortunately does not solve my issue.
I tried so many different variations of the CustomActionData string and none of them worked. I tried logging to a file from my overridden Install method to determine where the breakage was, but no log file is created because it's not even getting that far. As the error indicates, the failure is during the Initialization step.
I have a hunch that it could be one of the dependencies that the setup project is trying to load. Perhaps somehow something is being appended to the CustomActionData string and isn't playing well with the TARGETDIR value (which contains spaces, i.e. "C:\Program Files\My Company\Project Name"). Again, this is another hunch that I cannot seem to confirm due to my inability to debug the setup process.
One further thing to mention, and yes it's another hunch, could this be an issue with Setup Projects on 64-bit version of Windows? I'm running Windows 7 Professional.
I'll provide names of the dependencies in case it helps:
Microsoft .NET Framework
Microsoft.SqlServer.DtsMsg.dll
Microsoft.SqlServer.DTSPipelineWrap.dll
Microsoft.SqlServer.DTSRuntimeWrap.dll
Microsoft.SQLServer.ManagedDTS.dll
Microsoft.SqlServer.msxml6_interop.dll
Microsoft.SqlServer.PipelineHost.dll
Microsoft.SqlServer.SqlTDiagM.dll
As you may glean from the dependencies, the Windows Service is scheduling a call to a DTSX package.
Sorry for the long rant. Thanks for any help you can provide.
The answer is so maddeningly simple. If the last argument in the CustomActionData is going to contain spaces and thus you have to surround it with quotes and a trailing slash, you must also have a space following the trailing slash, like this:
/TimeToRun="[TIMETORUN]\" /TargetDir="[TARGETDIR]\ "
The solution and explanation can be found here.
Had a similar issue. In my case, it was odd because my installer had ran successfully once, then I uninstalled my app via Add/Remove Programs successfully, did some coding (did NOT touch my CustomActionData string), and rebuilt my project and setup project. It was when I re-ran my MSI that I got this error.
The coding I had done was to bring in more values of more parameters I had been specifying in my CustomActionData string. That syntax for getting the parameter values (i.e. string filepath = Context.Paramenters["filepath"]), which was in my Installer class, was actually fine, but as I found out, the syntax of the later parameters I was now trying to get from my CustomActionData string had not been correct, from the very beginning. I had failed to add a second quote around one of those parameters, so nothing else could be obtained.
I was using the "Textboxes (A)" and "Textboxes (B)" windows in the User Interface section. A has 1 box, EDITA1, where I get the path to a file, and B has 2 boxes, EDITB1 and EDITB2, for some database parameters. My CustomActionData string looked like this:
/filepath="[EDITA1]" /host="[EDITB1] /port="[EDITB2]"
It should have been:
/filepath="[EDITA1]" /host="[EDITB1]" /port="[EDITB2]"
(closing quote on [EDITB1])

Resources