Change the order of formatted strings in objective-C

Source: Internet
Author: User

From cocoa programming for Mac OS X 3rd

Mark the token order with a formatted string

When a text is converted from one language to another, Words and Phrases change accordingly due to word order changes. For example, the statement"Ted wants a scooter.", In another language, the word order may be"A scooter is what Ted wants". If you try a string in a localized format like this:

Nsstring * theformat = nslocalizedstring (@ "wants", @ "% @ wants a % @"); X = [nsstring stringwithformat: theformat, @ "Ted ", @ "Scooter"];

In the first language, this can work well:

"Wants" = "% @ wants a % @";

But in the second language, you need to display the marked insert Token Location,Token Include 1 Numbers and 1 Items$Symbol:"Wants" = "A % 2 $ @ is what % 1 $ @ wants ".

Mac
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.