Localizable string in Foundation.framework not found
Asked Answered
R

6

24

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.

Rockefeller answered 21/10, 2014 at 12:35 Comment(2)
Is that a system message or is your app trying to show that message? What code triggers that log message?Adscititious
This is a system message. I can't point you to a specific piece code but in the app this happens it is triggered on scrolling a table view. Images are loaded via SDWebImage and might not been saved completely. I heard of a related message when user prefs aren't saved correctly. However, this message is not shown on every device and sticks to a certain device even after reinstalling. This makes me think it's system- (or installation-)related.Rockefeller
B
32

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.

Imgur

Backup answered 28/11, 2014 at 12:27 Comment(4)
Maybe I should bring that issue directly to Apple... :) Unfortunately disabling TF and CL (I also use both) didn't help. I checked the local files and made some changes in the past. However, this didn't changed the behaviour. Luckily the app doesn't crash because of this - as you pointed out. Thanks anyways!Rockefeller
@CarstenWitzke - solved my issue, not sure if your is the same mind!Backup
BAM! Paul, that was it! I assume the checkbox was added in Xcode 6, because I put it in as argument. Anyways, that turned off the output. Thank you.Rockefeller
I found this also occurs, even when the Localization debugging checkbox is not checked, if you are manually passing the -NSShowNonLocalizedStrings YES argument in your build scheme.Tambratamburlaine
G
4

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.

Galleass answered 17/12, 2014 at 12:16 Comment(1)
I agree, turning off warnings is in most cases not the right way. Here however, I can't touch the native iOS code. Btw, I'm using Phraseapp for translations and included their sync into my build process. I've checked the language files for anomalies like yours and luckily had none. Thanks anyways for that good comment.Rockefeller
M
2

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

Merri answered 10/11, 2014 at 21:10 Comment(2)
I don't think Carsten is producing this warning with his own code, so adding some Document.strings probably won't help. I get the warning too and I know for sure it's not produced by my own code. So the question would rather be: which external library is producing this warning and is it sth one should be concerned about or can we ignore it.Franza
Hi, correct, this is not directly triggered by my code. As stated out above I have a table view including SDWebImage for asynchronous image loading. I'm not sure, but I think I've also seen this issue with another library before and have checked the SD issue tracker. No success so far.Rockefeller
P
2

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

Penetrate answered 4/1, 2017 at 12:13 Comment(1)
I kept getting the error for storyboard strings not found during testing in the base language - this finally solved that. The device was in English. Changed it to English (U.S.) and they went away.Petitioner
N
0

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):

  1. Open your file "Localizable.strings" in Xcode
  2. Delete the lower half of the table (for a start)
  3. 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.

Naoma answered 19/9, 2019 at 12:54 Comment(0)
C
0

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

Concordia answered 11/1, 2020 at 21:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.