Çevirmen üzerinde çalıştığım bu formatlı dizgim var. istenen ve asıl sonuç ileXcode İçinde Argümanların Aktarılması ile Gelişmiş Lokalizasyon
//////////////////////////////////////
// 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;
:
İNGİLİZCE
"Check out the %[email protected] %[email protected] in %[email protected]: %[email protected]" = "Check out the %[email protected] %[email protected] in %[email protected]: %[email protected]"
Almanca çevirisi
"Check out the %[email protected] %[email protected] in %[email protected]: %[email protected]" = "Hör Dir mal %[email protected] in %[email protected] an: %[email protected]";
Bunlar [NSString stringWithFormat:]
çağrı geçirilir
İNGİLİZCE
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"
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"
Sorun varsayımı altında olmasıdır problem -[NSString stringWithFormat:]
numaralı değişken kullanarak, Ben yapabilirim ngs, %[email protected]
değişkeninin tamamen atlandığı yerdeki gibi. Eğer fark ederseniz, format dizgisinin Almanca çevirisi ilk argümanı (%[email protected]
) hiç kullanmaz, ama yine de ("ses") çıkış dizisinde görünür.
Neyi yanlış yapıyorum?
hatalı yaptığım gibi numaralandırılmış değişkenlerin ihmal edilmesiyle ilgili bir varsayımda bulunuyor. – coneybeare
Bu, Android/Java'da işe yarıyor; onların (geçersiz?) uygulanması olmalı – Opus1217