Skip to content

Commit

Permalink
Add option to translate 'city' in next race card
Browse files Browse the repository at this point in the history
  • Loading branch information
marcokreeft87 committed Jan 3, 2023
1 parent b835c9d commit 11203bb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 25 deletions.
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,27 @@ The following texts can be translated or altered.
| Card type(s) | Key | Default value |
| ----------------------------------- | ------------- | ----------------------------------- |
| next_race, schedule | date' | 'Date' |
| next_race | practice1' | 'Practice 1' |
| next_race | practice2' | 'Practice 2' |
| next_race | practice3' | 'Practice 3' |
| next_race, schedule | date | 'Date' |
| next_race | practice1 | 'Practice 1' |
| next_race | practice2 | 'Practice 2' |
| next_race | practice3 | 'Practice 3' |
| next_race, schedule | race' | 'Race' |
| next_race | racename' | 'Race name' |
| next_race | circuitname' | 'Circuit name' |
| next_race | racename | 'Race name' |
| next_race | circuitname | 'Circuit name' |
| next_race, schedule | location' | 'Location' |
| next_race | racetime' | 'Race' |
| next_race | sprint' | 'Sprint' |
| next_race | qualifying' | 'Qualifying' |
| next_race, schedule | endofseason' | 'Season is over. See you next year!' |
| constructor_standings | 'constructor' | 'Constructor' |
| constructor_standings, driver_standings, last_result | 'points' | 'Pts' |
| constructor_standings, driver_standings | 'wins' | 'Wins' |
| driver_standings | 'team' | 'Team' |
| driver_standings, last_result | 'driver' | 'Driver' |
| last_result | 'grid' | 'Grid' |
| last_result | 'status' | 'Status' |
| schedule | 'time' | 'Time' |
| next_race | city | 'City' |
| next_race | racetime | 'Race' |
| next_race | sprint | 'Sprint' |
| next_race | qualifying | 'Qualifying' |
| next_race, schedule | endofseason | 'Season is over. See you next year!' |
| constructor_standings | constructor | 'Constructor' |
| constructor_standings, driver_standings, last_result | points | 'Pts' |
| constructor_standings, driver_standings | wins | 'Wins' |
| driver_standings | team | 'Team' |
| driver_standings, last_result | driver | 'Driver' |
| last_result | grid | 'Grid' |
| last_result | status | 'Status' |
| schedule | time | 'Time' |
Example:
Expand Down
6 changes: 3 additions & 3 deletions formulaone-card.js

Large diffs are not rendered by default.

Binary file modified formulaone-card.js.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formulaone-card",
"version": "0.2.3",
"version": "0.2.4",
"description": "Frontend card for hass-formulaoneapi",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/cards/next-race.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default class NextRace extends BaseCard {
'racename' : 'Race name',
'circuitname' : 'Circuit name',
'location' : 'Location',
'city': 'City',
'racetime' : 'Race',
'sprint' : 'Sprint',
'qualifying' : 'Qualifying',
Expand Down Expand Up @@ -87,7 +88,7 @@ export default class NextRace extends BaseCard {
<tr><td>${this.translation('racename')}</td><td>${this.next_race.raceName}</td><td>&nbsp;</td><td>${this.translation('practice3')}</td><td align="right">${freePractice3}</td></tr>
<tr><td>${this.translation('circuitname')}</td><td>${this.next_race.Circuit.circuitName}</td><td>&nbsp;</td><td>${this.translation('qualifying')}</td><td align="right">${qualifyingDate}</td></tr>
<tr><td>${this.translation('location')}</td><td>${this.next_race.Circuit.Location.country}</td><td>&nbsp;</td><td>${this.translation('sprint')}</td><td align="right">${sprintDate}</td></tr>
<tr><td>City</td><td>${this.next_race.Circuit.Location.locality}</td><td>&nbsp;</td><td>${this.translation('racetime')}</td><td align="right">${raceDateFormatted}</td></tr>
<tr><td>${this.translation('city')}</td><td>${this.next_race.Circuit.Location.locality}</td><td>&nbsp;</td><td>${this.translation('racetime')}</td><td align="right">${raceDateFormatted}</td></tr>
</tbody>
</table>
`;
Expand Down

0 comments on commit 11203bb

Please sign in to comment.