generated from custom-cards/boilerplate-card
-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Validate localization files | ||
on: | ||
pull_request: | ||
paths: | ||
- 'src/localize/languages/*.json' | ||
jobs: | ||
find-new-languages: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
languages: ${{ steps.get-languages.outputs.result }} | ||
steps: | ||
- name: Get new language(s) being added | ||
id: get-languages | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const pullInfo = context.issue; | ||
pullInfo.pull_number = pullInfo.number; | ||
delete pullInfo.number; | ||
const files = await github.rest.pulls.listFiles(pullInfo); | ||
const newLanguages = files.data.filter(file => { | ||
if (!file.filename.startsWith('src/localize/languages/')) { | ||
return false; | ||
} | ||
if (file.status !== 'added') { | ||
return false; | ||
} | ||
return true; | ||
}); | ||
const langCodes = newLanguages.map(l => l.filename.replace('src/localize/languages/', '').replace('.json', '')); | ||
console.log('New languages added:', langCodes.join(', ')); | ||
return langCodes; | ||
validate-added-languages: | ||
needs: find-new-languages | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
language: ${{ fromJSON(needs.find-new-languages.outputs.languages) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Ensure src/localize/localize.ts imports new language | ||
env: | ||
LANGUAGE: ${{ matrix.language }} | ||
run: | | ||
grep "^import \* as $LANGUAGE from './languages/$LANGUAGE.json';" src/localize/localize.ts || \ | ||
(echo "src/localize/localize.ts does not import $LANGUAGE.json" && exit 1) | ||
- name: Ensure src/localize/localize.ts consumes new language | ||
env: | ||
LANGUAGE: ${{ matrix.language }} | ||
run: | | ||
grep "^\s*$LANGUAGE," src/localize/localize.ts || \ | ||
(echo "src/localize/localize.ts does not consume $LANGUAGE in languages variable" && exit 1) | ||
- name: Ensure .github/workflows/translate.yml updated | ||
env: | ||
LANGUAGE: ${{ matrix.language }} | ||
run: | | ||
grep "to: '.*$LANGUAGE" .github/workflows/translate.yml || \ | ||
(echo ".github/workflows/translate.yml missing entry for $LANGUAGE" && exit 1) | ||
- name: Ensure cypress/e2e/localization.cy.ts updated | ||
env: | ||
LANGUAGE: ${{ matrix.language }} | ||
run: | | ||
grep "^\s*$LANGUAGE: '" cypress/e2e/localization.cy.ts || \ | ||
(echo "cypress/e2e/localization.cy.ts expectedTranslations missing entry for $LANGUAGE" && exit 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"common": { | ||
"version": "Versie", | ||
"title": "Weer per uur", | ||
"title_card": "Weerkaart per uur", | ||
"description": "Een kaart om de weersomstandigheden per uur weer te geven als een bar.", | ||
"invalid_configuration": "Ongeldige configuratie" | ||
}, | ||
"editor": { | ||
"entity": "Entiteit (Verplicht)", | ||
"name": "Naam: (Optioneel)", | ||
"segments_to_show": "Aantal weer te geven prognosesegmenten (Optioneel)", | ||
"offset": "Aantal prognosesegmenten om mee te compenseren (Optioneel)", | ||
"icons": "Pictogrammen weergeven in plaats van tekstlabels", | ||
"label_spacing": "Aantal prognosesegmenten naar ruimtetijd- en temperatuurlabels per (Optioneel)" | ||
}, | ||
"errors": { | ||
"missing_entity": "entity ontbreekt in configuratie", | ||
"too_many_segments_requested": "Te veel prognosesegmenten aangevraagd in num_segments. Moet <= aantal segmenten in prognose-entiteit zijn.", | ||
"daily_forecasts": "De geselecteerde weereenheid lijkt dagelijkse voorspellingen te geven. Overweeg om over te stappen naar een uurtarief.", | ||
"must_be_int": "Moet een even geheel getal zijn groter dan of gelijk aan 2", | ||
"invalid_colors": "De volgende kleuren in uw configuratie zijn ongeldig:", | ||
"must_be_positive_int": "Moet een positief geheel getal zijn", | ||
"label_spacing_positive_even_int": "label_spacing moet een even geheel getal zijn groter dan of gelijk aan 2", | ||
"offset_must_be_positive_int": "offset moet een positief geheel getal zijn" | ||
}, | ||
"conditions": { | ||
"clear": "Duidelijk", | ||
"cloudy": "Bewolkt", | ||
"fog": "Mist", | ||
"hail": "Hagel", | ||
"thunderstorm": "Onweersbui", | ||
"partlyCloudy": "Half bewolkt", | ||
"heavyRain": "Zware regen", | ||
"rain": "Regenen", | ||
"snow": "Sneeuw", | ||
"mixedPrecip": "Gemengde neerslag", | ||
"sunny": "Zonnig", | ||
"windy": "Winderig" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters