Skip to content

Commit

Permalink
inception-project#4068 - Ability to change interface language (i18n)
Browse files Browse the repository at this point in the history
 - Telemetry HTML pages translation with properties files
  • Loading branch information
awachatilf committed Jun 26, 2023
1 parent 64b73dc commit 570f455
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 167 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Licensed to the Technische Universität Darmstadt under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The Technische Universität Darmstadt
* licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.tudarmstadt.ukp.clarin.webanno.telemetry;

import java.io.Serializable;

import de.tudarmstadt.ukp.clarin.webanno.support.wicket.resource.Strings;

public class TelemetryIntro
implements Serializable
{
private final String productName;
private final String save;

public TelemetryIntro()
{
this(Strings.getString("product.name"), Strings.getString("save"));
}

public TelemetryIntro(String aProductName, String aSave)
{
super();
productName = aProductName;
save = aSave;
}

public String getProductName()
{
return productName;
}

public String getSave()
{
return save;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,28 @@
<wicket:panel>
<div class="col-sm-12">
<table class="table table-bordered table-sm table-hover">
<caption style="caption-side:top">Details</caption>
<caption style="caption-side:top">
<wicket:message key="details"></wicket:message>
</caption>
<thead>
<tr>
<th>Key</th>
<th>Value</th>
<th>Description</th>
</tr>
<tr>
<th>
<wicket:message key="keyTitle"></wicket:message>
</th>
<th>
<wicket:message key="valueTitle"></wicket:message>
</th>
<th>
<wicket:message key="descriptionTitle"></wicket:message>
</th>
</tr>
</thead>
<tbody>
<tr wicket:id="details" >
<td class="vert-aligned"><span wicket:id="key"/></td>
<td class="vert-aligned"><span wicket:id="value"/></td>
<td class="vert-aligned"><span wicket:id="description"/></td>
</tr>
<tr wicket:id="details">
<td class="vert-aligned"><span wicket:id="key"/></td>
<td class="vert-aligned"><span wicket:id="value"/></td>
<td class="vert-aligned"><span wicket:id="description"/></td>
</tr>
</tbody>
</table>
</div>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,7 @@
<form wicket:id="form">
<div class="flex-h-container flex-gutter">
<div class="flex-content">
<p>
In order to support the development of <wicket:message key="product.name"/>, it would
like to collect some data and send it home. Please review the settings below and
opt in or out of the respective data collections. Once you are done, use the
<b><wicket:message key="save"/></b> button on the right side to save your choices. If
there were any changes to the data collection process, this page will appear again
when an administrator logs in. You can always revise your choices by accessing this
page via the <i class="fa fa-heartbeat"></i> icon in the page footer.
</p>
<p wicket:id="intro"/>
</div>
<div>
<button wicket:id="save" class="btn btn-primary">
Expand All @@ -45,15 +37,14 @@
<div class="card-header">
<span wicket:id="name"/>
<div class="actions">
<button wicket:id="toggleDetails" class="btn btn-sm btn-secondary">
Toggle details...
</button>
<button wicket:id="toggleDetails" class="btn btn-sm btn-secondary">
<wicket:message key="toggleDetails"/>
</button>
</div>
</div>
<div class="card-body">
<div class="alert alert-warning" wicket:id="reviewRequiredMessage">
The behavior of this data collector has changed. Please review the description
and settings.
<wicket:message key="changeAlert"/>
</div>
<div wicket:id="traitsEditor"/>
<div wicket:id="details"/>
Expand All @@ -64,4 +55,4 @@
</div>
</wicket:extend>
</body>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.model.util.ListModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.wicketstuff.annotation.mount.MountPath;

import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxButton;
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxLink;
import de.tudarmstadt.ukp.clarin.webanno.telemetry.TelemetryDetail;
import de.tudarmstadt.ukp.clarin.webanno.telemetry.TelemetryIntro;
import de.tudarmstadt.ukp.clarin.webanno.telemetry.TelemetryService;
import de.tudarmstadt.ukp.clarin.webanno.telemetry.TelemetrySupport;
import de.tudarmstadt.ukp.clarin.webanno.telemetry.model.TelemetrySettings;
Expand Down Expand Up @@ -97,6 +100,11 @@ protected void populateItem(ListItem<TelemetrySettings> aItem)

form.add(new LambdaAjaxButton<Void>("save", this::actionSave).triggerAfterSubmit());

Label intro = new Label("intro",
new StringResourceModel("introText", Model.of(new TelemetryIntro())));
intro.setEscapeModelStrings(false);
form.add(intro);

add(form);
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Licensed to the Technische Universität Darmstadt under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The Technische Universität Darmstadt
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
details=Details
keyTitle=Key
valueTitle=Value
descriptionTitle=Description
introText=In order to support the development of ${productName}, it would \
like to collect some data and send it home. Please review the settings below and \
opt in or out of the respective data collections. Once you are done, use the \
<b>${save}</b> button on the right side to save your choices. If \
there were any changes to the data collection process, this page will appear again \
when an administrator logs in. You can always revise your choices by accessing this \
page via the <i class="fa fa-heartbeat"></i> icon in the page footer.
toggleDetails=Toggle details...
changeAlert=The behavior of this data collector has changed. Please review the description and settings.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Licensed to the Technische Universität Darmstadt under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The Technische Universität Darmstadt
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
details=Détails
keyTitle=Clé
valueTitle=Valeur
descriptionTitle=Description
introText=Afin de soutenir le développement de ${productName}\
, nous souhaiterions collecter quelques données et les envoyer chez nous. Veuillez consulter \
les paramètres ci-dessous et accepter ou refuser les collectes de données correspondantes. \
Une fois que vous aurez terminé, cliquez sur le bouton <b>${save}</b> \
sur le côté droit pour enregistrer vos choix. Si des modifications ont été apportées au \
processus de collecte des données, cette page apparaîtra à nouveau lorsqu'un administrateur \
se connectera. Vous pouvez toujours revoir vos choix en accédant à cette page par le biais \
de l'icone <i class="fa fa-heartbeat"></i> dans le pied de page.
toggleDetails=Basculer vers les détails...
changeAlert=Le comportement de ce collecteur de données a changé. Veuillez revoir la description et les paramètres.

0 comments on commit 570f455

Please sign in to comment.