Skip to content

Commit

Permalink
Merge pull request #2 from wilbersl/multilanguage
Browse files Browse the repository at this point in the history
Multilanguage
  • Loading branch information
ck-c8y authored Mar 28, 2024
2 parents 118301a + 7f7dda5 commit 5f2b5e9
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 15 deletions.
1 change: 1 addition & 0 deletions app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { DataCaptureWidgetModule } from './widget/widget-datacapture.module';

// Translations
import './locales/de.po'; // <- adding additional strings to the german translation.
import './locales/nl.po';

@NgModule({
imports: [
Expand Down
38 changes: 37 additions & 1 deletion locales/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,40 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

msgid "Data capture widget"
msgstr "Data capture widget"
msgstr "Manuelle Messwert eingabe"

msgid "Select datapoint to enter value:"
msgstr "Datenpunkt für Werteingabe auswählen:"

msgid "Add audit information to measurements"
msgstr "Audit Log für eingaben führen"

msgid "Select data points"
msgstr "Datenpunkte auswählen"

msgid "Create Measurement"
msgstr "Messwert erstellen"

msgid "Action"
msgstr "Aktion"

msgid "Value"
msgstr "Wert"

msgid "Date"
msgstr "Datum"

msgid "Datapoint"
msgstr "Datenpunkt"

msgid "Name Device"
msgstr "Gerätename"

msgid "Enter values for datapoints"
msgstr "Messwerte für Datenpunkte eingeben"

msgid "ID"
msgstr "ID"

msgid "measurement value, e.g.10.25"
msgstr "Messwert, z.B. 10.25"
48 changes: 48 additions & 0 deletions locales/nl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Translation by Chat GPT 3.5
#
msgid ""
msgstr ""
"Project-Id-Version: c8y.plugin\n"
"Language: nl\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

msgid "Data capture widget"
msgstr "Gegevensinvoegwidget"

msgid "Select datapoint to enter value:"
msgstr "Selecteer gegevenspunt om waarde in te voeren:"

msgid "Add audit information to measurements"
msgstr "Auditinformatie toevoegen aan metingen"

msgid "Select data points"
msgstr "Selecteer gegevenspunten"

msgid "Create Measurement"
msgstr "Meting maken"

msgid "Action"
msgstr "Actie"

msgid "Value"
msgstr "Waarde"

msgid "Date"
msgstr "Datum"

msgid "Datapoint"
msgstr "Gegevenspunt"

msgid "Name Device"
msgstr "Apparaatnaam"

msgid "Enter values for datapoints"
msgstr "Voer waarden in voor gegevenspunten"

msgid "ID"
msgstr "ID"

msgid "measurement value, e.g.10.25"
msgstr "Meetwaarde, bijv.10.25"
8 changes: 4 additions & 4 deletions widget/widget-datacapture-config.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<div class="p-16">
<h3>Data capture widget</h3>
<h3>{{ "Data capture widget" | translate}}</h3>

<div class="card">
<div class="card-header separator">
<h4 class="card-title">Select datapoint to enter value:</h4>
<h4 class="card-title">{{ "Select datapoint to enter value:" | translate}}</h4>
</div>

<div class="card-block">
<c8y-form-group class="m-b-0">
<label class="c8y-checkbox">
<input type="checkbox" name ="addAudit" [(ngModel)]="config.addAudit"/>
<span></span>
<span>Add audit information to measurements</span>
<span>{{ "Add audit information to measurements" | translate }}</span>
</label>
</c8y-form-group>
</div>
<div class="card-block">
<button class="btn btn-primary" (click)="addDatapoints()">
Select data points
{{ "Select data points" | translate}}
</button>
</div>
</div>
Expand Down
20 changes: 10 additions & 10 deletions widget/widget-datacapture.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<div class="p-16">
<div class="card">
<div class="card-header separator">
<h4 class="card-title">Enter values for datapoints</h4>
<h4 class="card-title">{{ "Enter values for datapoints" | translate }}</h4>
</div>

<div class="card-block">
<table class="table table-condensed table-striped">
<thead>
<tr>
<th>ID</th>
<th>Name Device</th>
<th>Datapoint</th>
<th>Date</th>
<th>Value</th>
<th>Action</th>
<th>{{ "ID" | translate }}</th>
<th>{{ "Name Device" | translate }}</th>
<th>{{ "Datapoint" | translate }}</th>
<th>{{ "Date" | translate }}</th>
<th>{{ "Value" | translate }}</th>
<th>{{ "Action" | translate }}</th>
</tr>
</thead>
<tbody>
Expand All @@ -27,15 +27,15 @@ <h4 class="card-title">Enter values for datapoints</h4>
class="form-control"
bsDatepicker [bsConfig]="{ customTodayClass: 'today' , withTimepicker: true, initCurrentTime: true, keepDatepickerOpened: true, dateInputFormat: 'DD:MM:YYYY, HH:mm:ss.SSS' }"
[name]="'dates_' + i"
placeholder="Date"
placeholder="{{ 'Date' | translate }}"
[(ngModel)]="dates[i]"
style="width: 100%"
/>
</td>
<td>
<input
class="form-control"
placeholder="measurement value, e.g.10.25"
placeholder="{{ 'measurement value, e.g.10.25' | translate }}"
type="number"
[name]="'values_' + i"
pattern="[0-9]*[.,]?[0-9]*"
Expand All @@ -49,7 +49,7 @@ <h4 class="card-title">Enter values for datapoints</h4>
type="button"
(click)="onSubmit(i)"
>
Create Measurement
{{ "Create Measurement" | translate }}
</button>
</td>
<!-- </form> -->
Expand Down
2 changes: 2 additions & 0 deletions widget/widget-datacapture.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ContextWidgetConfig } from "@c8y/ngx-components/context-dashboard";
import { BsDatepickerConfig } from "ngx-bootstrap/datepicker";
import { BsDatepickerModule } from "ngx-bootstrap/datepicker";
import { TimepickerModule } from "ngx-bootstrap/timepicker";
import { TranslateModule } from "@ngx-translate/core";

@NgModule({
declarations: [DataCaptureWidgetComponent, DataCaptureWidgetConfig],
Expand All @@ -18,6 +19,7 @@ import { TimepickerModule } from "ngx-bootstrap/timepicker";
FormsModule,
BsDatepickerModule.forRoot(),
TimepickerModule.forRoot(),
TranslateModule
],
exports: [],
providers: [
Expand Down

0 comments on commit 5f2b5e9

Please sign in to comment.