Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
_jespers_
Partner - Creator II
Partner - Creator II

Translation keys inside template?

Is it possible to access the translation keys inside the template without using the q-title-translation attribute?

Something like this:

<span>

    {{example.of.translation.key}}

</span>

1 Solution

Accepted Solutions
_jespers_
Partner - Creator II
Partner - Creator II
Author

Found a way to achieve this:

define( [

        'qlik',

        'jquery',

        'text!./template.html',

        'translator'

    ],

    function ( qlik, $, template, translator ) {

        'use strict';

        return {

            support: {

                snapshot: false,

                export: false,

                exportData: false

            },

            template: template,

            paint: function ($element, layout) {

                return qlik.Promise.resolve();

            },

            controller: ['$scope', function($scope){

                var translatedSheet = translator.get("Common.Sheet");

                console.log("translatedSheet", translatedSheet);

            }]

        };

    });

View solution in original post

2 Replies
_jespers_
Partner - Creator II
Partner - Creator II
Author

Found a way to achieve this:

define( [

        'qlik',

        'jquery',

        'text!./template.html',

        'translator'

    ],

    function ( qlik, $, template, translator ) {

        'use strict';

        return {

            support: {

                snapshot: false,

                export: false,

                exportData: false

            },

            template: template,

            paint: function ($element, layout) {

                return qlik.Promise.resolve();

            },

            controller: ['$scope', function($scope){

                var translatedSheet = translator.get("Common.Sheet");

                console.log("translatedSheet", translatedSheet);

            }]

        };

    });

gischy
Contributor
Contributor

is it possible to translate the propertie labels as well?