Skip to content

Commit ca49d99

Browse files
committed
INTLV-28: Implement translation component for the app
Signed-off-by: wthrajat <[email protected]>
1 parent 5fb1eb2 commit ca49d99

File tree

5 files changed

+114
-14
lines changed

5 files changed

+114
-14
lines changed

PROGRESS.md

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
- [X] Fixed: JSX Editor gets console error of document returned as null & object not loading properly ([INTLV-21 commit](https://github.com/xwiki-contrib/application-interactive-link-visualizer/commit/1e355b465492c230b2ac64a5ddfe189f9355579f))
104104
- [X] Fixed: Visualisation is initialised twice when there in another DOM updated event ([INTLV-22 commit](https://github.com/xwiki-contrib/application-interactive-link-visualizer/commit/eddf9c12f7744e040d99330b1c1039b01f002121))
105105
- [X] Fixed: Add a label to the `max number of pages to display` element
106+
- [X] Fixed: Added support for translations of application pages
106107

107108
<!--
108109
## Week 11 (14 August - 20 August 2023)

application-interactive-link-visualizer-ui/src/main/resources/XWiki/InteractiveLinkVisualizer/Code/LinkVisualizerPanel.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
</property>
178178
<property>
179179
<content>{{velocity}}
180-
#panelheader('Linked Pages Graph')
180+
#panelheader("$services.localization.render('intlv.panel.header')")
181181
#set ($discard = $xwiki.jsx.use('XWiki.InteractiveLinkVisualizer.Code.LinkVisualizerPanel'))
182182
{{html}}
183183
&lt;div id="sigma-container-panel"

application-interactive-link-visualizer-ui/src/main/resources/XWiki/InteractiveLinkVisualizer/Code/MainVisualisation.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@
331331
<property>
332332
<code>#sigma-container {
333333
width: 100%;
334-
height: 100vh;
334+
height: 700px;
335335
border: 1px solid @breadcrumb-bg;
336336
border-radius: 5px;
337337
box-shadow: rgba(red(@text-color), green(@text-color), blue(@text-color), 0.2) 0px 2px 6px;
@@ -713,7 +713,7 @@ icon=icon:world</parameters>
713713
<property>
714714
<parameters>id=visualisationAPI
715715
path=$services.webjars.url('org.xwiki.contrib:application-interactive-link-visualizer-webjar', 'visualisationAPI.js')
716-
</parameters>
716+
</parameters>
717717
</property>
718718
<property>
719719
<scope>wiki</scope>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.1" encoding="UTF-8"?>
2+
3+
<!--
4+
* See the NOTICE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This is free software; you can redistribute it and/or modify it
8+
* under the terms of the GNU Lesser General Public License as
9+
* published by the Free Software Foundation; either version 2.1 of
10+
* the License, or (at your option) any later version.
11+
*
12+
* This software is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this software; if not, write to the Free
19+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21+
-->
22+
23+
<xwikidoc version="1.5" reference="XWiki.InteractiveLinkVisualizer.Code.Translations" locale="">
24+
<web>XWiki.InteractiveLinkVisualizer.Code</web>
25+
<name>Translations</name>
26+
<language/>
27+
<defaultLanguage>en</defaultLanguage>
28+
<translation>0</translation>
29+
<creator>xwiki:XWiki.Admin</creator>
30+
<parent>XWiki.InteractiveLinkVisualizer.WebHome</parent>
31+
<author>xwiki:XWiki.Admin</author>
32+
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
33+
<version>1.1</version>
34+
<title>Translations</title>
35+
<comment/>
36+
<minorEdit>false</minorEdit>
37+
<syntaxId>plain/1.0</syntaxId>
38+
<hidden>true</hidden>
39+
<content>## Top info bar
40+
intlv.topbar.search.placeholder=Find pages in graph…
41+
intlv.topbar.search.title=Find pages from the visualized graph
42+
intlv.topbar.graphinfo.hint=Displays information about graph
43+
44+
## Main graph area
45+
intlv.sigmacontainer.buttons.title.zoomin=Zoom In
46+
intlv.sigmacontainer.buttons.title.zoomout=Zoom Out
47+
intlv.sigmacontainer.buttons.title.iterations=Increase Graph Iterations: If graph is not layouted properly &amp; need more iterations
48+
intlv.sigmacontainer.buttons.title.zoomdefault=Default Zoom
49+
intlv.sigmacontainer.buttons.title.fullscreen=Fullscreen
50+
intlv.sigmacontainer.buttons.title.killgraph=Kill Graph Instance
51+
intlv.sigmacontainer.form.title.documentfilter=Number of documents to display in graph
52+
intlv.sigmacontainer.form.label.documentfilter=No. of pages to visualize:
53+
54+
## Local graph panel
55+
intlv.panel.header=Linked Pages Graph</content>
56+
<object>
57+
<name>XWiki.InteractiveLinkVisualizer.Code.Translations</name>
58+
<number>0</number>
59+
<className>XWiki.TranslationDocumentClass</className>
60+
<guid>c3d09a4d-5723-4b2d-9677-63e7659bfd83</guid>
61+
<class>
62+
<name>XWiki.TranslationDocumentClass</name>
63+
<customClass/>
64+
<customMapping/>
65+
<defaultViewSheet/>
66+
<defaultEditSheet/>
67+
<defaultWeb/>
68+
<nameField/>
69+
<validationScript/>
70+
<scope>
71+
<cache>0</cache>
72+
<disabled>0</disabled>
73+
<displayType>select</displayType>
74+
<freeText>forbidden</freeText>
75+
<largeStorage>0</largeStorage>
76+
<multiSelect>0</multiSelect>
77+
<name>scope</name>
78+
<number>1</number>
79+
<prettyName>Scope</prettyName>
80+
<relationalStorage>0</relationalStorage>
81+
<separator> </separator>
82+
<separators>|, </separators>
83+
<size>1</size>
84+
<unmodifiable>0</unmodifiable>
85+
<values>GLOBAL|WIKI|USER|ON_DEMAND</values>
86+
<classType>com.xpn.xwiki.objects.classes.StaticListClass</classType>
87+
</scope>
88+
</class>
89+
<property>
90+
<scope>WIKI</scope>
91+
</property>
92+
</object>
93+
</xwikidoc>

application-interactive-link-visualizer-ui/src/main/resources/XWiki/InteractiveLinkVisualizer/WebHome.xml

+17-11
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,29 @@
5959
type="search"
6060
id="search-input"
6161
list="suggestions"
62-
placeholder="Find pages in graph…"
63-
title="Find pages from the visualized graph"&gt;
62+
placeholder="$services.localization.render('intlv.topbar.search.placeholder')"
63+
title="$services.localization.render('intlv.topbar.search.title')"&gt;
6464
&lt;/input&gt;
6565
&lt;datalist id="suggestions"&gt;&lt;/datalist&gt;
6666
&lt;/div&gt;
67-
&lt;div title="Displays information about graph" id="graph-info"&gt;
67+
&lt;div title="$services.localization.render('intlv.topbar.graphinfo.hint')" id="graph-info"&gt;
6868
&lt;span id="node-count"&gt;&lt;/span&gt;
6969
&lt;span id="edge-count"&gt;&lt;/span&gt;
7070
&lt;/div&gt;
7171
&lt;/div&gt;
7272
&lt;div id="sigma-container" data-results="$escapetool.xml($jsontool.serialize($searchResponse.results))"&gt;
7373
&lt;div class="buttonwrapper" id="graph-buttons"&gt;
74-
&lt;button class="icon-button" title="Zoom In" id="zoom-in"&gt;$services.icon.renderHTML('search-plus')&lt;/button&gt;
75-
&lt;button class="icon-button" title="Zoom Out" id="zoom-out"&gt;$services.icon.renderHTML('search-minus')&lt;/button&gt;
76-
&lt;button class="icon-button" title="Increase Graph Iterations: If graph is not layouted properly &amp; need more iterations" id="iteration-button"&gt;$services.icon.renderHTML('refresh')&lt;/button&gt;
77-
&lt;button class="icon-button" title="Default Zoom" id="zoom-reset"&gt;$services.icon.renderHTML('world')&lt;/button&gt;
78-
&lt;button class="icon-button" title="Fullscreen" id="view-fullscreen"&gt;$services.icon.renderHTML('arrows')&lt;/button&gt;
79-
&lt;button class="icon-button hidden" title="Kill Graph" id="kill-graph-button"&gt;$services.icon.renderHTML('delete')&lt;/button&gt;
74+
&lt;button class="icon-button" title="$services.localization.render('intlv.sigmacontainer.buttons.title.zoomin')
75+
" id="zoom-in"&gt;$services.icon.renderHTML('search-plus')&lt;/button&gt;
76+
&lt;button class="icon-button" title="$services.localization.render('intlv.sigmacontainer.buttons.title.zoomout')
77+
" id="zoom-out"&gt;$services.icon.renderHTML('search-minus')&lt;/button&gt;
78+
&lt;button class="icon-button" title="$services.localization.render('intlv.sigmacontainer.buttons.title.iterations')
79+
" id="iteration-button"&gt;$services.icon.renderHTML('refresh')&lt;/button&gt;
80+
&lt;button class="icon-button" title="$services.localization.render('intlv.sigmacontainer.buttons.title.zoomdefault')
81+
" id="zoom-reset"&gt;$services.icon.renderHTML('world')&lt;/button&gt;
82+
&lt;button class="icon-button" title="$services.localization.render('intlv.sigmacontainer.buttons.title.fullscreen')
83+
" id="view-fullscreen"&gt;$services.icon.renderHTML('arrows')&lt;/button&gt;
84+
&lt;button class="icon-button hidden" title="$services.localization.render('intlv.sigmacontainer.buttons.title.killgraph')" id="kill-graph-button"&gt;$services.icon.renderHTML('delete')&lt;/button&gt;
8085
&lt;/div&gt;
8186
&lt;/div&gt;
8287
{{/html}}
@@ -129,8 +134,9 @@
129134
&lt;/span&gt;
130135
&lt;/div&gt;
131136
&lt;div&gt;
132-
&lt;label for="rows" style="margin-right: 2%;"&gt;No. of pages to visualize:&lt;/label&gt;
133-
&lt;input id="rows" type="number" name="rows" title="Number of documents to display in graph"
137+
&lt;label for="rows" style="margin-right: 2%;"&gt;$services.localization.render('intlv.sigmacontainer.form.label.documentfilter')
138+
&lt;/label&gt;
139+
&lt;input id="rows" type="number" name="rows" title="$services.localization.render('intlv.sigmacontainer.form.title.documentfilter')"
134140
placeholder="1000" value="$!escapetool.xml($request.rows)"/&gt;
135141
&lt;span&gt;
136142
&lt;button type="submit" id="refresh-button" class="btn btn-primary"&gt;

0 commit comments

Comments
 (0)