<?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 How to extend nuxeo.war/ui/i18n/messages.json? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-extend-nuxeo-war-ui-i18n-messages-json/m-p/319871#M6872</link>
    <description>&lt;P&gt;&lt;A href="https://connect.nuxeo.com/nuxeo/site/marketplace/package/nuxeo-wopi"&gt;nuxeo-wopi addon&lt;/A&gt; does not declare any package dependencies. However, it obviously depends on nuxeo-web-ui, since the latter includes the strings used for tooltips: &lt;CODE&gt;wopiLink.*&lt;/CODE&gt; in &lt;A href="https://github.com/nuxeo/nuxeo-web-ui/blob/3244dee759152a00a4a43daa4f75733d3210da62/i18n/messages.json"&gt;i18n/messages.json&lt;/A&gt;, that ends up in nuxeo.war/ui. These tooltips are generated also in that package: see &lt;A href="https://github.com/nuxeo/nuxeo-web-ui/blob/c7e67299e9c35803d8c25104324ba37e54787f4d/addons/nuxeo-wopi/elements/nuxeo-wopi-link.js#L66"&gt;_wopiTooltip&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This raises the question, when I want to prepare a simple addon atop of the nuxeo-wopi (so my addon depends on it), how do I provide more strings to the &lt;CODE&gt;nuxeo.war/ui/i18n/messages.json&lt;/CODE&gt;? My package does not include any jar packages, and only adds some icons to &lt;CODE&gt;${env.home}/nuxeo.war/ui/images&lt;/CODE&gt;, and a config to &lt;CODE&gt;${env.config}&lt;/CODE&gt;, using &lt;CODE&gt;copy&lt;/CODE&gt; &lt;A href="https://doc.nuxeo.com/nxdoc/scripting-commands/"&gt;scripting command&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;But there seems to be no scripting command to extend existing json files; adding another json file to that directory is ignored by nuxeo; and manually editing the json gets overwritten on server restart.&lt;/P&gt;
&lt;P&gt;What is the correct way to add some strings to &lt;CODE&gt;nuxeo.war/ui/i18n/messages.json&lt;/CODE&gt; when installing a simple addon?&lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2020 09:45:08 GMT</pubDate>
    <dc:creator>Mike_Kaganski</dc:creator>
    <dc:date>2020-10-28T09:45:08Z</dc:date>
    <item>
      <title>How to extend nuxeo.war/ui/i18n/messages.json?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-extend-nuxeo-war-ui-i18n-messages-json/m-p/319871#M6872</link>
      <description>&lt;P&gt;&lt;A href="https://connect.nuxeo.com/nuxeo/site/marketplace/package/nuxeo-wopi"&gt;nuxeo-wopi addon&lt;/A&gt; does not declare any package dependencies. However, it obviously depends on nuxeo-web-ui, since the latter includes the strings used for tooltips: &lt;CODE&gt;wopiLink.*&lt;/CODE&gt; in &lt;A href="https://github.com/nuxeo/nuxeo-web-ui/blob/3244dee759152a00a4a43daa4f75733d3210da62/i18n/messages.json"&gt;i18n/messages.json&lt;/A&gt;, that ends up in nuxeo.war/ui. These tooltips are generated also in that package: see &lt;A href="https://github.com/nuxeo/nuxeo-web-ui/blob/c7e67299e9c35803d8c25104324ba37e54787f4d/addons/nuxeo-wopi/elements/nuxeo-wopi-link.js#L66"&gt;_wopiTooltip&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This raises the question, when I want to prepare a simple addon atop of the nuxeo-wopi (so my addon depends on it), how do I provide more strings to the &lt;CODE&gt;nuxeo.war/ui/i18n/messages.json&lt;/CODE&gt;? My package does not include any jar packages, and only adds some icons to &lt;CODE&gt;${env.home}/nuxeo.war/ui/images&lt;/CODE&gt;, and a config to &lt;CODE&gt;${env.config}&lt;/CODE&gt;, using &lt;CODE&gt;copy&lt;/CODE&gt; &lt;A href="https://doc.nuxeo.com/nxdoc/scripting-commands/"&gt;scripting command&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;But there seems to be no scripting command to extend existing json files; adding another json file to that directory is ignored by nuxeo; and manually editing the json gets overwritten on server restart.&lt;/P&gt;
&lt;P&gt;What is the correct way to add some strings to &lt;CODE&gt;nuxeo.war/ui/i18n/messages.json&lt;/CODE&gt; when installing a simple addon?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 09:45:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-extend-nuxeo-war-ui-i18n-messages-json/m-p/319871#M6872</guid>
      <dc:creator>Mike_Kaganski</dc:creator>
      <dc:date>2020-10-28T09:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to extend nuxeo.war/ui/i18n/messages.json?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-extend-nuxeo-war-ui-i18n-messages-json/m-p/319872#M6873</link>
      <description>&lt;P&gt;The i18n in nuxeo-web-ui is implemented in [nuxeo-elements/ui/nuxeo-i18n-behavior.js](https&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 18:41:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-extend-nuxeo-war-ui-i18n-messages-json/m-p/319872#M6873</guid>
      <dc:creator>Mike_Kaganski</dc:creator>
      <dc:date>2020-10-28T18:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to extend nuxeo.war/ui/i18n/messages.json?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-extend-nuxeo-war-ui-i18n-messages-json/m-p/319873#M6874</link>
      <description>&lt;P&gt;Seems &lt;CODE&gt;deployment-fragment.xml&lt;/CODE&gt;'s [append](https&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:56:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-extend-nuxeo-war-ui-i18n-messages-json/m-p/319873#M6874</guid>
      <dc:creator>Mike_Kaganski</dc:creator>
      <dc:date>2020-10-29T08:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to extend nuxeo.war/ui/i18n/messages.json?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-extend-nuxeo-war-ui-i18n-messages-json/m-p/319874#M6875</link>
      <description>&lt;P&gt;I solved this using following method:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;I put my strings in &lt;CODE&gt;web/nuxeo.war/ui/i18n/messages.json&lt;/CODE&gt; of the &lt;CODE&gt;jar&lt;/CODE&gt; bundle&lt;/LI&gt;
&lt;LI&gt;I use this &lt;CODE&gt;deployment-fragment.xml&lt;/CODE&gt; in &lt;CODE&gt;OSGI-INF&lt;/CODE&gt; of the &lt;CODE&gt;jar&lt;/CODE&gt;:&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;fragment version="1"&amp;gt;
  &amp;lt;require&amp;gt;org.nuxeo.web.ui&amp;lt;/require&amp;gt;
  &amp;lt;install&amp;gt;
    &amp;lt;delete path="${bundle.fileName}.tmp"/&amp;gt;
    &amp;lt;unzip from="${bundle.fileName}" to="${bundle.fileName}.tmp" prefix="web"&amp;gt;
      &amp;lt;include&amp;gt;web/nuxeo.war/**&amp;lt;/include&amp;gt;
    &amp;lt;/unzip&amp;gt;
    &amp;lt;append from="${bundle.fileName}.tmp/nuxeo.war/ui/i18n/messages.json" to="nuxeo.war/ui/i18n/messages.json"/&amp;gt;
    &amp;lt;delete path="${bundle.fileName}.tmp"/&amp;gt;
  &amp;lt;/install&amp;gt;
&amp;lt;/fragment&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;OL start="3"&gt;
&lt;LI&gt;The jar bundle is installed using the &lt;CODE&gt;update&lt;/CODE&gt; &lt;A href="https://doc.nuxeo.com/nxdoc/scripting-commands/"&gt;scripting command&lt;/A&gt; in &lt;CODE&gt;install.xml&lt;/CODE&gt; of the addon package:&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class="language-xml"&gt;&amp;lt;update file="${package.root}/install/bundles" todir="${env.bundles}" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When I have localized strings, I will add relevant &lt;CODE&gt;messages-lang.json&lt;/CODE&gt; to &lt;CODE&gt;web/nuxeo.war/ui/i18n/&lt;/CODE&gt;, and append more &lt;CODE&gt;append&lt;/CODE&gt; commands to the &lt;CODE&gt;deployment-fragment.xml&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:51:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-extend-nuxeo-war-ui-i18n-messages-json/m-p/319874#M6875</guid>
      <dc:creator>Mike_Kaganski</dc:creator>
      <dc:date>2020-10-29T09:51:12Z</dc:date>
    </item>
  </channel>
</rss>

