翻訳者に作業を依頼しているこのフォーマットされた文字列があります。
英語
"%3$@ の %1$@ %2$@ をチェック: %4$@" = "%3$@ の %1$@ %2$@ をチェック: %4$@"
ドイツ語翻訳
"%3$@ の %1$@ %2$@ をチェックしてください: %4$@" = "Hör Dir mal %2$@ in %3$@ an: %4$@";
[NSString stringWithFormat:]
これらは呼び出しに渡されます。
//////////////////////////////////////
// Share Over Twitter
NSString *frmt = NSLocalizedString(@"Check out the %1$@ %2$@ in %3$@: %4$@", @"The default tweet for sharing sounds. Use %1$@ for where the sound type (Sound, mix, playlist) will be, %2$@ for where the audio name will be, %3$@ for the app name, and %3$@ 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;
望ましい結果と実際の結果:
英語
望ましい: "私のアプリ名: link_to_sound でサウンド "このサウンド名" をチェックしてください" actual: "My App Name: link_to_sound でサウンド "This Sound Name" を確認してください"
ドイツ人
望ましい: "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:]
ているこのようなことができる
という仮定の下にあったことです。%1$@
お気付きかもしれませんが、フォーマット文字列のドイツ語翻訳では、最初の引数 ( %1$@
) はまったく使用されていませんが、出力文字列にはそれ (「サウンド」) が表示されます。
私は何を間違っていますか?