में तर्कों को छोड़ने के साथ उन्नत स्थानीयकरण मेरे पास इस स्वरूपित स्ट्रिंग है कि मेरे पास अनुवादक काम कर रहा है।एक्सकोड
//////////////////////////////////////
// Share Over Twitter
NSString *frmt = NSLocalizedString(@"Check out the %[email protected] %[email protected] in %[email protected]: %[email protected]", @"The default tweet for sharing sounds. Use %[email protected] for where the sound type (Sound, mix, playlist) will be, %[email protected] for where the audio name will be, %[email protected] for the app name, and %[email protected] for where the sound link will be.");
NSString *urlString = [NSString stringWithFormat:@"sounds/%@", SoundSoundID(audio)];
NSString *url = ([audio audioType] == UAAudioTypeSound ? UrlFor(urlString) : APP_SHORTLINK);
NSString *msg = [NSString stringWithFormat:
frmt,
[[Audio titleForAudioType:[audio audioType]] lowercaseString],
[NSString stringWithFormat:@"\"%@\"", AudioName(audio)],
APP_NAME,
url];
returnString = msg;
की वास्तविक और इच्छित परिणाम के साथ
:
अंग्रेजी
"Check out the %[email protected] %[email protected] in %[email protected]: %[email protected]" = "Check out the %[email protected] %[email protected] in %[email protected]: %[email protected]"
जर्मन अनुवाद
"Check out the %[email protected] %[email protected] in %[email protected]: %[email protected]" = "Hör Dir mal %[email protected] in %[email protected] an: %[email protected]";
ये एक [NSString stringWithFormat:]
कॉल करने के लिए पारित कर रहे हैं
अंग्रेजी
desired: "Check out the sound "This Sound Name" in My App Name: link_to_sound" actual: "Check out the sound "This Sound Name" in My App Name: link_to_sound"
जर्मन
desired: "Hör Dir mal "This Sound Name" in My App Name an: link_to_sound" actual: "Hör Dir mal sound in "This Sound Name" an: My App Name"
समस्या समस्या यह है कि मैं इस धारणा के तहत किया गया है कि -[NSString stringWithFormat:]
में गिने चर का उपयोग करके, मैं थाई कर सकता था इस तरह ngs, जहां %[email protected]
चर पूरी तरह से छोड़ा गया है। यदि आप ध्यान देते हैं, प्रारूप स्ट्रिंग का जर्मन अनुवाद पहले तर्क (%[email protected]
) का उपयोग नहीं करता है लेकिन यह ("ध्वनि") अभी भी आउटपुट स्ट्रिंग में दिखाई देता है।
मैं क्या गलत कर रहा हूं?
ऐसा प्रतीत होता है कि मैं गलत क्या कर रहा था, संख्याबद्ध चर के विसर्जन के बारे में एक धारणा बना रहा है। – coneybeare
यह दिलचस्प है कि यह एंड्रॉइड/जावा में ठीक काम करता है; उनके (अमान्य?) कार्यान्वयन होना चाहिए – Opus1217