@c8y/tutorial 1023.61.2 → 1023.62.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@c8y/tutorial",
3
- "version": "1023.61.2",
3
+ "version": "1023.62.2",
4
4
  "description": "This package is used to scaffold a tutorial for Cumulocity IoT Web SDK which explains a lot of concepts.",
5
5
  "dependencies": {
6
- "@c8y/style": "1023.61.2",
7
- "@c8y/ngx-components": "1023.61.2",
8
- "@c8y/client": "1023.61.2",
9
- "@c8y/bootstrap": "1023.61.2",
6
+ "@c8y/style": "1023.62.2",
7
+ "@c8y/ngx-components": "1023.62.2",
8
+ "@c8y/client": "1023.62.2",
9
+ "@c8y/bootstrap": "1023.62.2",
10
10
  "@angular/cdk": "^20.2.14",
11
11
  "monaco-editor": "~0.53.0",
12
12
  "ngx-bootstrap": "20.0.2",
@@ -14,8 +14,8 @@
14
14
  "rxjs": "7.8.2"
15
15
  },
16
16
  "devDependencies": {
17
- "@c8y/options": "1023.61.2",
18
- "@c8y/devkit": "1023.61.2"
17
+ "@c8y/options": "1023.62.2",
18
+ "@c8y/devkit": "1023.62.2"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "@angular/common": ">=20 <21"
@@ -5,19 +5,42 @@ import { CoreModule } from '@c8y/ngx-components';
5
5
  @Component({
6
6
  selector: 'text-translation-gettext',
7
7
  template: `<c8y-title>Text translation by gettext</c8y-title>
8
+ <div class="d-flex a-i-center m-b-16">
9
+ <label class="c8y-switch m-r-8">
10
+ <input type="checkbox" [(ngModel)]="enabled" />
11
+ <span></span>
12
+ </label>
13
+ Toggle state
14
+ </div>
8
15
  <div class="card">
9
16
  <div class="card-header separator">
10
- <h4 class="card-title">Gettext example (mark string for translation)</h4>
17
+ <h4 class="card-title">Use labels annotated for translation in the component class</h4>
11
18
  </div>
12
19
  <div class="card-block">
13
- <p class="m-b-8">
20
+ <p>
14
21
  This word will be translated: {{ (enabled ? enabledLabel : disabledLabel) | translate }}.
15
22
  </p>
16
- <label class="c8y-switch">
17
- <input type="checkbox" [(ngModel)]="enabled" />
18
- <span></span>
19
- Toggle state
20
- </label>
23
+ </div>
24
+ </div>
25
+ <div class="card">
26
+ <div class="card-header separator">
27
+ <h4 class="card-title">Use labels translated in template variables</h4>
28
+ </div>
29
+ <div class="card-block">
30
+ @let activeLabel = 'Active' | translate;
31
+ @let inactiveLabel = 'Inactive' | translate;
32
+ <p>This word will be translated: {{ enabled ? activeLabel : inactiveLabel }}.</p>
33
+ </div>
34
+ </div>
35
+ <div class="card">
36
+ <div class="card-header separator">
37
+ <h4 class="card-title">Use gettext() in a template expression</h4>
38
+ </div>
39
+ <div class="card-block">
40
+ <p>
41
+ This word will be translated:
42
+ {{ (enabled ? gettext('Running') : gettext('Stopped')) | translate }}.
43
+ </p>
21
44
  </div>
22
45
  </div>`,
23
46
  standalone: true,
@@ -27,4 +50,5 @@ export class TextTranslationGettextComponent {
27
50
  enabled = true;
28
51
  enabledLabel = gettext('Enabled');
29
52
  disabledLabel = gettext('Disabled');
53
+ readonly gettext = gettext;
30
54
  }