Dashboards & Visualizations

Why is the single value visualization's "underLabel" option not able to be localized?

simpkins1958
Contributor

Using the instructions from https://docs.splunk.com/Documentation/SplunkCloud/6.6.0/AdvancedDev/TranslateSplunk when I extract strings from my app and create a messages.pot file there is an entry for:

<option name="underLabel">Last hour</option>

#: default/data/ui/views/m_app_flow_status.xml:76
msgid "Last hour"
msgstr "最終時間"

But when displaying the dashboard it is not showing the Japanese string. Is this a know issue/bug?
alt text

0 Karma

tomaszwrona
Explorer

Hi,

if you are still interested in solving this try something like this:

  • define a token within dashboard with:

    Last hour

  • replace option value with that token:

    $last_hour_tok$

  • enhance your dashboard with a Javascript:

  • change token value in tokenInternational.js:

    require([
    'jquery',
    'underscore',
    'splunk.i18n',
    'splunkjs/mvc',
    'splunkjs/mvc/simplexml/ready!'
    ], function ($, , i18n, mvc) {
    var defaultTokens = mvc.Components.getInstance("default"); // get token model
    var lastHour = defaultTokens.get("last_hour_tok"); // get the value of last_hour_tok
    lastHour = lastHour.replace("Last hour", i18n.
    ("Last hour")); // replace text "Last hour" with msgstr for msgid "Last hour"
    defaultTokens.set("last_hour_tok", lastHour); // set token value
    });

Hope this helps.

Best regards
Tomasz

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...