When I give Bundle display name with space as "A B C D", I get the app name as "ABCD". This happens only on the iOS 11.I tried override name"CFBundleDisplayName" in my InfoPlist.string and use special unicode character \U00A0 (No-break space) and it doesn't help me.
This is because of a change Apple made in iOS 11 for truncating for longer app names. If the name is longer than 12 characters, the spaces will be removed. Otherwise, they'll still exist.
For example, Guide book app will become Guidebookapp, but Gui boo app will stay as Gui boo app.
Using unicode (FIGURE SPACE) works because it isn't an ascii space. I would be hesitant to use this as a solution because it seems reasonable that Apple would "fix" this bug and remove for apps with names longer than 12 characters.
https://forums.developer.apple.com/thread/77832
I have the same issue. Only on iOS 11. On lower iOS version this issue isn't appeared.
I resolved this with:
Open info.plist as Source code(right click, open as...)
Find CFBundleDisplayName
Replace normal space with unicode
That's all. After that display name shows with space.
UPDATED:
works only when typed in *.plist. Can't be inserted in Display name in Xcode project settings;
It works for me when I replace space with FIGURE SPACE in InfoPlist.strings manually or with a script.
Edit info.plist as source code but use instead of .
looks like 2 spaces.
In my case this value was missing from info.plist file so I just add the following to it:
<key>CFBundleDisplayName</key>
<string>$(PRODUCT_NAME)</string>
Give More Space in Bundle Display Name
like
abc def abcdef
Related
I'm using HexaPDF to read a file with an AcroForm and fill in this form's fields using the following code:
#acro_form.field_by_name(fieldname).field_value = value
Up until version 0.20.1 this worked fine. As of version 0.20.2, I get this error: HexaPDF::Error (Glyph for "2" missing) on trying to generate the document. The glyphs for all numbers, and for all lower case letters except a, b, and c cause this respective error.
This problem only occurs in my dev setup on Windows 11, not on Linux.
#gettalong or anyone else who might be able to help: Thx in advance!
With the help of #gettalong I figured out the problem:
Some of the text in data/hexapdf/encoding/glyphlist.txt appears to be automatically processed by Windows, inserting line and page breaks in this file which should not be there, and causing other changes to the file's encodings.
I resolved it by editing the above file as follows:
Remove extra paragraph and line breaks and potential invisible characters on entries for controlFF, controlVT and controlSO
Set codes (the part after the semicolon) for controlSUB to blank
Remove blank space on "controlBEL; ", changing this line to "controlBEL;"
Ensure there is a blank space on space, i.e. the line must be "space; ", not "space;" and ensure there is no additional invisible character there.
Save the file and restart server.
I'm bringing in images with names that contain spaces, English names and Chinese names, and using those filenames to create strings that are presented beneath their images.
This worked fine until I started putting Chinese into the image file names.
Now, unfortunately all spaces are coming in as
%20
and an example of Chinese looks like this:
%E7%99%BE%E9%A6%99
I have Chinese Simplified installed, and setup in internalisation settings of the project in Xcode... but somehow I'm missing something. Which isn't the first time, and won't be the last.
What do I need to do to make Unicode work?
The path is urlencoded if you urldecode the path spaces should turn out fine
For Swift 3:
substring.removingPercentEncoding
For Swift 2.3:
substring.stringByRemovingPercentEncoding
I want to localize my application; I am using Swift 2. I followed this tutorial but I experience 2 issues.
1. Localized image disappears for both languages
I localized multiple images the same way for German and English. One set of images (the en and de versions of an image) disappear for both languages. I added them, they are in the project's folder and I can not spot any difference to other images I localized.
I tried
cleaning and running the project (no errors)
removed the images and added them again
removed and added the localization
…nothing helped. Any idea?
2. Error w/ NSLocalizedString & Localizable.strings
I created a Localizable.strings for localizing my app's strings. Here is how I make them localizable:
button.setTitle(NSLocalizedString("buttonTitle", comment: "MyButton"), forState: .Normal)
In the Localizable.strings for English I added:
"buttonTitle" = "MyButton"
…and for German:
"buttonTitle" = "MeinButton"
Now, Xcode does not show any errors in code but it says
Read failed:
The data couldn't be read because it isn't in the correct format.
Any ideas?
Thank you in advance :)
Edit
Issue #2 was resolved, I missed a ; there. Thanks to codingVoldemort!
I think you have missed the semi-colon on the Localizable.strings after each key-value pair.
In the Localizable.strings for English and German you have missed the semi-colon at the end of statement.
It should be like :
"buttonTitle" = "MyButton"; and
"buttonTitle" = "MeinButton";
You can refer Apple docs for this.
I'm a bit late, but if you're still searching for a solution for task #1:
You could use the solutions presented in that tutorial; there's a Internationalization of Images section.
"After selecting [your image] in Project navigator, click Localize button under File Inspector. This should provide you with the option to Localize the file in English and German."
That being said, I'm unsure whether this would work on Swift 2 (if you're still on there); but that should be possible with an up-to-date Xcode/IDE.
Xcode 6.3.2 introduced a new bug in the "Export for Localization" parser: Newline characters (e.g. "\n") included in source language strings, are cancelled out in their corresponding target language strings (e.g. "\n"). This causes the symbol for new line characters to appear in the compiled app, instead of an actual new line.
Fortunately, a previous major bug in the parser is fixed in this release: Error while "Export For Localization.." Xcode 6.3
Anyone have suggestions for a work around, aside from manually altering the strings file for each instance of this bug?
Performing a "find, replace all" works for now.
Open the effected strings file.
Search for "\n"
Select replace and add "\n" to the field.
Click the "All" button.
While this works, its a bit tedious to do every time translations are updated.
NOTE: You may notice that the source string in the .strings file is broken up on multiple lines, as opposed to showing the newline symbol "\n" explicitly in the string on one line. This is also a new bug, but it doesn't seem to effect strings at runtime.
Also, I cannot think of a reason why anyone would want the string "\n" to actually appear in their app, but if you are unsure, you should review each change using git.
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.