Translation: How to handle different position of object in sentences?

Asked by 982c80311320c1b on 2012-01-28

Example:

"BeatBox could not find songs similar to" + " <b>" + lm.media_info.media.title.replace("&", "&amp;") + "</b> by <b>" + lm.media_info.media.artist.replace("&", "&amp;") + "</b>.\n"

In German, it would need to be:

"BeatBox konnte keine Titel finden, die" + " <b>" + lm.media_info.media.title.replace("&", "&amp;") + "</b> von <b>" + lm.media_info.media.artist.replace("&", "&amp;") + "ähnlich sind</b>.\n"

Is it possible to translate the whole sentence using placeholders?

Question information

Language:
English Edit question
Status:
Solved
For:
BeatBox Edit question
Assignee:
No assignee Edit question
Solved by:
982c80311320c1b
Solved:
2012-02-05
Last query:
2012-02-05
Last reply:

Thanks, but I still do not know how I would need to change the code, since this was about printf. Or is somthing similar possible for errorBox.setWarning etc?

I managed to use placeholders:

    if(medias.size < 10) { // say we could not find similar medias
     errorBox.show_icon = true;
                     string satzii = _("BeatBox (konnte) could not find songs similar to %1$s by %2$s.\n").printf ("<b>" + lm.media_info.media.title.replace("&", "&amp;") + "</b>", "<b>" + lm.media_info.media.artist.replace("&", "&amp;") + "</b>");
     errorBox.setWarning("<span weight=\"bold\" size=\"larger\">" + _("No similar songs found") + "\n</span>\n" + satzii + _("Make sure all song info is correct and you are connected to the Internet.\nSome songs may not have matches."), Justification.LEFT);
     errorBox.show_all();
     list.hide();
     albumView.hide();
     stdout.printf("2\n");

     in_update = false;
     return;
    }
But the translation doesn't show up in BeatBox.
I already had such an issue with the SmartPlaylistEditor, but maybe could tell me what would need to be done.