Skip to content

Commit

Permalink
Improve risk description (#23)
Browse files Browse the repository at this point in the history
Improve risk description
  • Loading branch information
MelleD authored Jan 31, 2024
1 parent 3d4b911 commit 2d41afd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions src/localize/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"show_warning": "Warnung anzeigen",
"show_error": "Fehler anzeigen",
"pm_index": "PM-Index",
"pm_risk": "Risikostufe",
"pm_recommendation": "Empfehlung"
"pm_risk_level": "Risikostufe",
"pm_risk": "Risiko"
},
"pm_levels": {
"low": "Niedrig",
Expand All @@ -15,12 +15,12 @@
"very_high": "Sehr hoch",
"extreme": "Extrem"
},
"pm_recommendation_levels": {
"low": "Luftqualität birgt kein Risiko",
"moderate": "Bei Atemproblem Aktivitäten im Freien vermeiden",
"high": "Risiko für Reizungen und Atemprobleme",
"very_high": "Hohes Risiko für Kopf und Lunge",
"extreme": "Aufenthalt im Freien sollte vermieden werden"
"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"
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/localize/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"show_warning": "Show Warning",
"show_error": "Show Error",
"pm_index": "PM Index",
"pm_risk": "PM Risk",
"pm_recommendation": "Recommendation"
"pm_risk_level": "PM Risk level",
"pm_risk": "Risk"
},
"pm_levels": {
"low": "Low",
Expand All @@ -16,10 +16,10 @@
"extreme": "Extreme"
},
"pm_recommendation_levels": {
"low": "Air quality poses no risk",
"moderate": "If you have known respiratory problems, avoid outdoor activities",
"high": "Risk of irritation and breathing problems",
"very_high": "High risk to head and lungs",
"extreme": "Staying outdoors should be avoided"
"low": "No risk",
"moderate": "Moderate for breathing problems",
"high": "High for breathing problems",
"very_high": "High for the lungs and head",
"extreme": "Extreme for the lungs and head"
}
}
18 changes: 9 additions & 9 deletions src/pm-index-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class PMIndexCard extends LitElement {

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

if (this.config.pm_10) {
// ADD Scala index for pm 10
Expand All @@ -108,7 +108,7 @@ export class PMIndexCard extends LitElement {

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

if (stateValue >= 21) {
Expand All @@ -123,7 +123,7 @@ export class PMIndexCard extends LitElement {

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

if (stateValue >= 45) {
Expand All @@ -134,7 +134,7 @@ export class PMIndexCard extends LitElement {

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

colorTriangleValue = 8;

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

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

if (stateValue >= 250) {
Expand Down Expand Up @@ -203,19 +203,19 @@ export class PMIndexCard extends LitElement {
<div>
<p>
<span style="font-weight: bold;">${localize('common.pm_index', '', '', this.config.language)}</span><br/>
${stateValue}
${stateValue} µg/m³
</p>
</div>
<div>
<p>
<span style="font-weight: bold;">${localize('common.pm_risk', '', '', this.config.language)}</span><br/>
<span style="font-weight: bold;">${localize('common.pm_risk_level', '', '', this.config.language)}</span><br/>
${localize(pmRiskStr, '', '', this.config.language)}
</p>
</div>
<div>
<p>
<span style="font-weight: bold;">${localize('common.pm_recommendation', '', '', this.config.language)}</span><br/>
<SMALL>${localize(pmRecomenndation, '', '', this.config.language)}</SMALL>
<span style="font-weight: bold;">${localize('common.pm_risk', '', '', this.config.language)}</span><br/>
<SMALL>${localize(pmRisk, '', '', this.config.language)}</SMALL>
</p>
</div>
</div>
Expand Down

0 comments on commit 2d41afd

Please sign in to comment.