OSX: how to localize the name appearing when the mouse flies over the app icon in the dock?
Asked Answered
R

3

5

When the user's mouse flies over the app icon in the dock, the name of the app appears on the app icon.

According to the tests I just performed, it seams that the name which appears corresponds to the "Product Name" defined in the project target (in "Build Settings" menu).

The question is: how can I localize this target product name in order to have my app name in the correct language when the user puts its mouse over my app icon ?

Or is there any other method to localize the app name which appears when the user puts its mouse over my app icon ?

Thanks !

Rotary answered 29/12, 2012 at 18:1 Comment(0)
R
6

have an info InfoPlist.strings file in which you have localized CFBundleDisplayName, you can also localize the NSHumanReadableCopyrigh et al.

It is indeed required to follow strictly the steps mentioned in this article: http://kb.applingua.com/2011/10/how-to-localize-app-names/

Rosalba answered 29/12, 2012 at 18:3 Comment(3)
Thanks for your answer but except if I really missed something (I didn't forget to make a clean :)) it doesn't work !Rotary
CFBundleDisplayName -- see kb.applingua.com/2011/10/how-to-localize-app-namesRosalba
Thanks !! It is indeed required to follow strictly the steps mentioned in this article and especially: 1) not forget to remove any "Bundle display name" in the info.plist file (otherwise, it doesn't work...) 2) Add the key "Application has localized display name" and set it to yes in the info.plist 3) localize the "Bundle display name" in string files... Crazy Apple !!!Rotary
L
10

After so many years this problem still troubled me (and likely thousands of other programmers) for more than an hour.

Given that the link in the accepted answer above by Daij-Djan is already dead (Updated link is now at https://kb.applingua.com/2015/10/how-to-localize-app-names/), I'm writing yet another answer with my added cases.

Make sure you have done the following:

  1. Info.plist is not ticked for your target
  2. Info.plist has "Application has localized display name" set to YES
  3. Info.plist has "Bundle name" (CFBundleName) and its value is "$(PRODUCT_NAME)" (Don't ask me why. If I set this to some other value, it doesn't work.)
  4. Info.plist has no entry of "Bundle display name" (CFBundleDisplayName)
  5. InfoPlist.strings is ticked for your target
  6. InfoPlist.strings is ticked for all languages (in my case, Base and English only.) at least the Base language.
  7. InfoPlist.strings has both "CFBundleDisplayName" and "CFBundleName" entries

The above worked for me. I was primarily missing the "$(PRODUCT_NAME)" value part for the past hour.

If that still doesn't work, you should try creating a brand new XCode project and try to name the app into something else by following the above guides. Then, compare the Info.plist and your real project's Info.plist and see what's the difference. That's exactly how I find out about the "$(PRODUCT_NAME)" requirement.

Lisp answered 19/8, 2016 at 10:53 Comment(1)
Just wanted to add that if you do not include CFBundleName, the application name in the main menu will not be localized. If you want that to be localized, you need CFBundleName, see: #19654349Pimp
R
6

have an info InfoPlist.strings file in which you have localized CFBundleDisplayName, you can also localize the NSHumanReadableCopyrigh et al.

It is indeed required to follow strictly the steps mentioned in this article: http://kb.applingua.com/2011/10/how-to-localize-app-names/

Rosalba answered 29/12, 2012 at 18:3 Comment(3)
Thanks for your answer but except if I really missed something (I didn't forget to make a clean :)) it doesn't work !Rotary
CFBundleDisplayName -- see kb.applingua.com/2011/10/how-to-localize-app-namesRosalba
Thanks !! It is indeed required to follow strictly the steps mentioned in this article and especially: 1) not forget to remove any "Bundle display name" in the info.plist file (otherwise, it doesn't work...) 2) Add the key "Application has localized display name" and set it to yes in the info.plist 3) localize the "Bundle display name" in string files... Crazy Apple !!!Rotary
C
0

With a new project created by Xcode 14 I needed to do two things explained below. Note that this is the only way I have found to have special characters (non ascii, accents, utf-8, äåö, è etc) in the app name as well. Also note that this name is also shown in other places in the app such as when asking for location permission.

  1. Set Application has localized display name to YES in the target Info settings (this will automatically create an Info.plist file if one does not exist and set the LSHasLocalizedDisplayName key to true).

Xcode 14 localized display name flag

  1. Add a new InfoPlist.strings file to the target with a CFBundleDisplayName key with the wanted app name. You would then create a InfoPlist.strings file for each language supported and change the CFBundleDisplayName appropriately.

    /* InfoPlist.strings */
    CFBundleDisplayName = "Localized App Name";
    

Result

Result with localized app name

Choking answered 19/9, 2022 at 17:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.