Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6072871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:12:28+00:00 2026-05-23T10:12:28+00:00

I’m having problem to change a textfield input language source through codes ! All

  • 0

I’m having problem to change a textfield input language source through codes !
All I want is to change the keyboard language to specific language when ever I enter a textfield.

I’m already searched here and just found some small guidance for Iphone but I’m working on OSx App.

Thank you guys helping me again !

EDIT:
well ! new approaches :
If I change my system preferences to appropriate language then most of the problems solved !
Date formatter become true and if I use this code snippet I can achieve correct language name ( before I just got en):

NSLocale * locale = [NSLocale currentLocale];        
NSString * localLanguage = [locale objectForKey:NSLocaleLanguageCode] ;
NSLog (@"Language : %@", localLanguage);    

BUT, I want to change the keyboard input language without changing the whole system preference. In fact, I want to change the Text Input service language to other installed language ( I have 2 ) when I enter into a special textfield ! ( is it clear ? )

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:12:29+00:00Added an answer on May 23, 2026 at 10:12 am

    Well, I answered my own question AGAIN !

    for whom that may visit this question :
    to get reached the user’s keyboard language Input sources you have to follow this instructions :

    1. TIS ( Text Input Service ) is related to Carbon framework. So, first of all you have to import carbon.h to your implementation file:

      #import <Carbon/Carbon.h>

    2. Add carbon framework to your framework resource. To do this you have to navigate to Mac OSx Application Target -> Linked Frameworks and Libraries -> add carbon frame work.

    3. to change the keyboard input source, you can use for example controlTextDidBeginEditing delegate to detect user’s textfield selection.Then you can select the proper language from installed language sources. for example I have two language installed, en and fa so I have 2 keyboard layout in language bar. Then you can select the language by selecting it’s index.

    4. to find your desired language index you can use this :
      NSArray *langs=[NSLocale preferredLanguages];
      langs included by languages that you can reached by it’s indexes.

    5. Now, it’s time to change text input source programmatically using this codes :
      NSArray*langsArray=(NSArray*)TISCreateInputSourceList(NULL,FALSE); //make a list of installed languages
      TISInputSourceRef faSource=(TISInputSourceRef)[langsArray objectAtIndex:1]; //my second language is farsi (persian)
      TISSelectInputSource(faSource); // now second language selected for keyboard input resource

    Hope it helps you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I am trying to loop through a bunch of documents I have to put
I need to clean up various Word 'smart' characters in user input, including but
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.