Comment 6 for bug 1327419

Revision history for this message
Pete Woods (pete-woods) wrote :

I've attached a branch that allows the infographics to read translations from click packages in addition to the standard language packs.

I've confirmed that this works.

However, the translations for the music app infographics need updating. In its codebase it actually pre-translates the strings before it sends them to the infographics server. What it *should* be doing is tagging the strings from translation, but not translating them itself. Usually you can do this with a dummy pass-through function as below:

    function translateMe(s) {
        return s;
    }

    Metric {
        id: songsMetric
        name: "music-metrics"
        format: translateMe("Songs played today: <b>%1</b>")
        emptyFormat: translateMe("No songs played today")
        domain: "com.ubuntu.music"
    }

and then configure gettext to extract this function.