<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to translate things written in JavaScript (buttons, texts)? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-translate-things-written-in-JavaScript-buttons-texts/m-p/554074#M38471</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/157390"&gt;@JMichaelis&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;just like you mentioned, I have successfully translated things written in javascript to japanese language. But I am stuck where I need to translate token values to japanese. I have a token in the dashboard that has value “validation error” and this token is used to display a warning message on input text.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Below is snippet of token in xml, $vuln_input_error$ is the token that I set elsewhere in same xml.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;————&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;row id=“row1”&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;html depends=“$vuln_input_error$” id=“vuln_error_msg”&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;div id=“vuln_error_container”&amp;gt;&amp;lt;code&amp;gt;$vuln_input_error$&amp;lt;/code&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/html&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;———-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the same approach that you have described, I have tried with i18n in js, but token value does not get translated as expected. Do you have an idea on how to translate token values in splunk?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jun 2021 09:14:17 GMT</pubDate>
    <dc:creator>vaneetsin</dc:creator>
    <dc:date>2021-06-02T09:14:17Z</dc:date>
    <item>
      <title>How to translate things written in JavaScript (buttons, texts)?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-translate-things-written-in-JavaScript-buttons-texts/m-p/203274#M12754</link>
      <description>&lt;P&gt;hey there!&lt;BR /&gt;
I need your help.&lt;BR /&gt;
I want to translate an application.  Already followed this guideline &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.1/AdvancedDev/TranslateSplunk"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.1/AdvancedDev/TranslateSplunk&lt;/A&gt; , but this does not help me to translate buttons or texts written in JS.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 18:44:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-translate-things-written-in-JavaScript-buttons-texts/m-p/203274#M12754</guid>
      <dc:creator>SJanasek</dc:creator>
      <dc:date>2016-12-20T18:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to translate things written in JavaScript (buttons, texts)?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-translate-things-written-in-JavaScript-buttons-texts/m-p/203275#M12755</link>
      <description>&lt;P&gt;Hi SJanasek, &lt;/P&gt;

&lt;P&gt;the TranslateSplunk i18n-functionality does indeed not extract/translate site content in JS. I've found a way to use it either way:&lt;/P&gt;

&lt;P&gt;You have to add the entries in your messages.mo / po by hand and have to follow the guidelines you've linked regarding file placement.&lt;/P&gt;

&lt;P&gt;You then have to add the following to your js:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
...
'splunk.i18n',
...
], function(..., i18n) {
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you are able to use &lt;CODE&gt;i18n._("variable_name")&lt;/CODE&gt;in your code when naming buttons/labels and so on. The function will return the value defined by the used language and the variable_name in your .po.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
Jens&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 15:09:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-translate-things-written-in-JavaScript-buttons-texts/m-p/203275#M12755</guid>
      <dc:creator>JMichaelis</dc:creator>
      <dc:date>2016-12-21T15:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to translate things written in JavaScript (buttons, texts)?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-translate-things-written-in-JavaScript-buttons-texts/m-p/203276#M12756</link>
      <description>&lt;P&gt;can you give me a more detailed description please?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 11:48:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-translate-things-written-in-JavaScript-buttons-texts/m-p/203276#M12756</guid>
      <dc:creator>SJanasek</dc:creator>
      <dc:date>2017-02-02T11:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to translate things written in JavaScript (buttons, texts)?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-translate-things-written-in-JavaScript-buttons-texts/m-p/554074#M38471</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/157390"&gt;@JMichaelis&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;just like you mentioned, I have successfully translated things written in javascript to japanese language. But I am stuck where I need to translate token values to japanese. I have a token in the dashboard that has value “validation error” and this token is used to display a warning message on input text.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Below is snippet of token in xml, $vuln_input_error$ is the token that I set elsewhere in same xml.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;————&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;row id=“row1”&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;html depends=“$vuln_input_error$” id=“vuln_error_msg”&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;div id=“vuln_error_container”&amp;gt;&amp;lt;code&amp;gt;$vuln_input_error$&amp;lt;/code&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/html&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;———-&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the same approach that you have described, I have tried with i18n in js, but token value does not get translated as expected. Do you have an idea on how to translate token values in splunk?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 09:14:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-translate-things-written-in-JavaScript-buttons-texts/m-p/554074#M38471</guid>
      <dc:creator>vaneetsin</dc:creator>
      <dc:date>2021-06-02T09:14:17Z</dc:date>
    </item>
  </channel>
</rss>

