Skip to content

Commit

Permalink
Merge pull request #2 from SiriosDev/master
Browse files Browse the repository at this point in the history
Added Italian, fixed German, edited readme and localize.ts
  • Loading branch information
t1gr0u authored May 8, 2023
2 parents 1c5554f + 80f01cb commit e3cbfd7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ entity: sensor.weather_station_uv

The following languages are supported:

| Language | Yaml value | Supported | Translated by |
| --------- | ---------- | --------- | ----------------------------------------------------------------------------------- |
| English | `en` | v1.0.0 | [@t1gr0u](https://github.com/t1gr0u) |
| French | `fr` | v1.0.0 | [@t1gr0u](https://github.com/t1gr0u) |
| German | `de` | v1.0.0 | [@t1gr0u](https://github.com/t1gr0u) |
| Language | Yaml Value | Supported Since | Translated by |
| --------- | ---------- | --------------- | ----------------------------------------------------------------------------------- |
| English | `en` | v1.0.0 | [@t1gr0u](https://github.com/t1gr0u) |
| French | `fr` | v1.0.0 | [@t1gr0u](https://github.com/t1gr0u) |
| German | `de` | v1.0.0 | [@t1gr0u](https://github.com/t1gr0u) |
| Italian | `it` | v?.?.? | [@SiriosDev](https://github.com/SiriosDev) |


## Thanks to
Expand Down
6 changes: 3 additions & 3 deletions src/localize/languages/de.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"common": {
"version": "Version",
"invalid_configuration": "Invalid configuration",
"show_warning": "Show Warning",
"show_error": "Show Error",
"invalid_configuration": "Ungültige Konfiguration",
"show_warning": "Warnung anzeigen",
"show_error": "Fehler anzeigen",
"uv_index": "UV-Index",
"uv_risk": "Risikostufe"
},
Expand Down
17 changes: 17 additions & 0 deletions src/localize/languages/it.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"common": {
"version": "Versione",
"invalid_configuration": "Configurazione non valida",
"show_warning": "Mostra Avviso",
"show_error": "Mostra Errore",
"uv_index": "Indice UV",
"uv_risk": "Rischio UV"
},
"uv_levels": {
"low": "Basso",
"moderate": "Moderato",
"high": "Alto",
"very_high": "Altissimo",
"extreme": "Estremo"
}
}
4 changes: 3 additions & 1 deletion src/localize/localize.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import * as de from './languages/de.json';
import * as en from './languages/en.json';
import * as fr from './languages/fr.json';
import * as fr from "./languages/fr.json";
import * as it from "./languages/it.json";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const languages: any = {
de: de,
en: en,
fr: fr,
it: it
};

export function localize(string: string, search = '', replace = ''): string {
Expand Down

0 comments on commit e3cbfd7

Please sign in to comment.