Skip to content

Commit

Permalink
Translation (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
MelleD authored Jan 31, 2024
1 parent 8162604 commit 7b3dad0
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 32 deletions.
48 changes: 23 additions & 25 deletions src/localize/languages/de.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
{
"common": {
"version": "Version",
"invalid_configuration": "Ungültige Konfiguration",
"show_warning": "Warnung anzeigen",
"show_error": "Fehler anzeigen",
"pm_index": "PM-Index",
"pm_risk_level": "Risikostufe",
"pm_risk": "Risiko"
},
"pm_levels": {
"low": "Niedrig",
"moderate": "Mäßig",
"high": "Hoch",
"very_high": "Sehr hoch",
"extreme": "Extrem"
},
"pm_risk": {
"low": "Kein Risiko",
"moderate": "Mäßig für Atemproblem",
"high": "Hoch für Atemprobleme",
"very_high": "Hoch für Lunge und Kopf",
"extreme": "Extrem für Lunge und Kopf"
}
"common": {
"version": "Version",
"invalid_configuration": "Ungültige Konfiguration",
"show_warning": "Warnung anzeigen",
"show_error": "Fehler anzeigen",
"pm_index": "PM-Index",
"pm_risk_level": "Risikostufe",
"pm_risk": "Risiko"
},
"pm_levels": {
"low": "Niedrig",
"moderate": "Mäßig",
"high": "Hoch",
"very_high": "Sehr hoch",
"extreme": "Extrem"
},
"pm_risk": {
"low": "Kein Risiko",
"moderate": "Mäßig für Atemproblem",
"high": "Hoch für Atemprobleme",
"very_high": "Hoch für Lunge und Kopf",
"extreme": "Extrem für Lunge und Kopf"
}


}
2 changes: 1 addition & 1 deletion src/localize/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"very_high": "High for lungs and head",
"extreme": "Extreme for lungs and head"
}
}
}
12 changes: 6 additions & 6 deletions src/pm-index-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class PMIndexCard extends LitElement {
// const showRecommendation = this.config.show_recommendation;

let colorTriangleValue = 1;
let pmRiskStr = 'pm_levels.low'
let pmRiskLevel = 'pm_levels.low'
let pmRisk = 'pm_risk.low'

if (this.config.pm_10) {
Expand All @@ -107,7 +107,7 @@ export class PMIndexCard extends LitElement {
}

if (stateValue >= 12 && stateValue < 35) {
pmRiskStr = 'pm_levels.moderate'
pmRiskLevel = 'pm_levels.moderate'
pmRisk = 'pm_risk.moderate'
colorTriangleValue = 3;

Expand All @@ -122,7 +122,7 @@ export class PMIndexCard extends LitElement {
}

if (stateValue >= 35 && stateValue < 55) {
pmRiskStr = 'pm_levels.high'
pmRiskLevel = 'pm_levels.high'
pmRisk = 'pm_risk.high'
colorTriangleValue = 6;

Expand All @@ -133,7 +133,7 @@ export class PMIndexCard extends LitElement {
}

if (stateValue >= 55 && stateValue < 150) {
pmRiskStr = 'pm_levels.very_high'
pmRiskLevel = 'pm_levels.very_high'
pmRisk = 'pm_risk.very_high'

colorTriangleValue = 8;
Expand All @@ -148,7 +148,7 @@ export class PMIndexCard extends LitElement {
}

if (stateValue >= 150) {
pmRiskStr = 'pm_levels.extreme'
pmRiskLevel = 'pm_levels.extreme'
pmRisk = 'pm_risk.extreme'
colorTriangleValue = 11;

Expand Down Expand Up @@ -207,7 +207,7 @@ export class PMIndexCard extends LitElement {
<div>
<p>
<span style="font-weight: bold;">${localize('common.pm_risk_level', '', '', this.config.language)}</span><br/>
${localize(pmRiskStr, '', '', this.config.language)}
${localize(pmRiskLevel, '', '', this.config.language)}
</p>
</div>
<div>
Expand Down

0 comments on commit 7b3dad0

Please sign in to comment.