Welcome to mirror list, hosted at ThFree Co, Russian Federation.

translations.js « client « Overlay « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9665b920a91730611f8eea3c45bd726bccbcb794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var Piwik_Overlay_Translations = (function () {

    /** Translations strings */
    var translations = [];

    return {

        /**
         * Initialize translations module.
         * Callback is triggered when data is available.
         */
        initialize: function (callback) {
            // Load translation data
            Piwik_Overlay_Client.api('getTranslations', function (data) {
                translations = data[0];
                callback();
            });
        },

        /** Get translation string */
        get: function (identifier) {
            if (typeof translations[identifier] == 'undefined') {
                return identifier;
            }
            return translations[identifier];
        }

    };

})();