0

I want to change language and locale of my application alone to a language different than user's default that is set on the system. Say my application should use resources of french even though the system default is set to English.

I found few examples for iOS (How to force NSLocalizedString to use a specific language) but even this is only for language, but nothing for OSX. I have the french resource in my bundle. I just want to override the defaults for my application alone. Without changing the entire OS locale from system preferences.

Community
  • 1
  • 1
deepak r
  • 1
  • 2

1 Answers1

0

There are nice apps for this problem: Language Switcher and App Language Chooser to name a few.

To do it programmatically, you can use the defaults command to change the app's AppleLanguages property to (fr) or (en, ko), as the following shell script:

bundleId=BUNDLE_ID_OF_YOUR_APP  # such as, com.apple.Finder
# change AppleLanguages
defaults write $bundleId AppleLanguages "(fr)"
# open your app
open -b $bundleId
# then restore the language
defaults delete $bundleId AppleLanguages

See the answer to this similar question at superuser for more detail: Can I change the default language of a application / program in Snow Leopard?.

Community
  • 1
  • 1
netj
  • 111
  • 4
  • 4