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

  • SEARCH
  • Home
  • 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 8156985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:07:38+00:00 2026-06-06T17:07:38+00:00

I have a localized NSString that is something like You win. It was Chuck

  • 0

I have a localized NSString that is something like “You win. It was Chuck Norris.”. The French translation of this is “Gagne. il s’agissait bien de Chuck Norris”. But when the name starts with a vowel it should say “Gagné. il s’agissait bien d’Alfred Hitchcock”.

Does NSString offer support for these situations or do I need to manually translate each possibility?

  • 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-06-06T17:07:40+00:00Added an answer on June 6, 2026 at 5:07 pm

    If you’re trying to do localization using tools like NSLocalizedString(), variations like this are going to occur in a lot of languages (especially those with grammatical genders) and are a lot of trouble to deal with. There’s no inbuilt change-strings-if-starting-with-a-vowel method, but something like this would be necessary (pseudo-code):

    if (language == LANG_FRENCH) {
        if (myName.startsWith(ANY_VOWEL)) {
            result = format(@"Gagné ... d'%@", myName);
        } else {
            result = format(@"Gagné ... de %@", myName);
        }
    }
    

    Why did I give you pseudo-code instead of real code? Because this is the wrong way to do this work. It’s messy, it’s ugly, and there are a lot of edge cases. For instance, the letter “H” in French can be “aspirated” or “non-aspirated”, and one takes “l’/d'” while the other takes “le/la/de” (compare “l’hôtel” and “le hockey”.) The distinction is arbitrary and cannot be determined solely by examining the spelling of the word.

    Rather than attempting to match your format string to the name, try to change the format string to be neutral. Instead of "Il s'agissait bien d'%@.", try "Le nom? C'est %@!" so that the gender and spelling of the name do not affect the localization. Different languages will have different options here.

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

Sidebar

Related Questions

I have some static resources (images and HTML files) that will be localized. One
I have a second .nib file that is a localized version of the main
I have text to localize like this <p>Please enter your user name and password.
I have a template for an email that I've put in a localized strings
I have the localized strings file that is used in the Iphone app that
We have a growing collection of .NET Web applications that have been localized in
I have to print a localized string passing it a parameter. I use: NSString
I have a Localized.strings (UTF-16) file that contains some strings that I use to
I posted this question previously and now have the localized strings loaded (the ones
I have an Android app that is localized for English and Spanish. When you

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.