Skip to content

Commit

Permalink
v0.14.6 Release Candidate (#110)
Browse files Browse the repository at this point in the history
* Add Greek translation

* Add Greek language (#108)

* Create el.js

Added Greek language

* Update translator.js

Added Greek Language

* Update bundled files

* Add unique style names

* Adds swedish translation (#109)

* Update bundled file with Swedish translation

* Fix score style

* Update bundled script

---------

Co-authored-by: Chris Chreece <[email protected]>
Co-authored-by: Philip Persson <[email protected]>
  • Loading branch information
3 people authored Sep 1, 2024
1 parent 56e1f69 commit 213d902
Show file tree
Hide file tree
Showing 9 changed files with 636 additions and 40 deletions.
339 changes: 319 additions & 20 deletions dist/ha-teamtracker-card.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ha-teamtracker-card.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/const.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export let VERSION = "v0.14.5";
export let VERSION = "v0.14.6";

export let GOLF_HEADSHOT_URL = "https://a.espncdn.com/i/headshots/golf/players/full/";
export let MMA_HEADSHOT_URL = "https://a.espncdn.com/i/headshots/mma/players/full/";
Expand Down
148 changes: 148 additions & 0 deletions src/localize/languages/el.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
export const el = {
"common": {
"api_error": "Σφάλμα API",
"no_upcoming_games": "Δεν υπάρχουν προσεχείς αγώνες έως %s",
"finalTerm": "%s - Τελικός",
"byeTerm": "ΑΝΑΠΑΥΣΗ",
"tourney2": "Τελικός",
"tourney4": "Ημιτελικοί",
"tourney8": "Προημιτελικοί",
"tourney16": "Φάση των 16",
"tourney32": "Φάση των 32",
"tourney64": "Φάση των 64",
"tourney128": "Πρώιμες Φάσεις",
"tourney256": "Πρώιμες Φάσεις",
"today": "Σήμερα",
"tomorrow": "Αύριο"
},
"australian-football": {
"startTerm": "Έναρξη",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Πιθανότητα Νίκης",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"baseball": {
"startTerm": "Πρώτη Ρίψη",
"overUnder": "O/U: %s",
"gameStat1": "Μπάλες %s",
"gameStat2": "Χτυπήματα %s",
"gameStat3": "%s Άουτ",
"gameBar": "Πιθανότητα Νίκης",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"basketball": {
"startTerm": "Τζάμπολ",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Πιθανότητα Νίκης",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"cricket": {
"startTerm": "Έναρξη",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Πιθανότητα Νίκης",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"football": {
"startTerm": "Σέντρα",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Πιθανότητα Νίκης",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"golf": {
"startTerm": "Έναρξη Γύρου",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Χτυπήματα (Μέχρι)",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"hockey": {
"startTerm": "Έναρξη Παιχνιδιού",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Σουτ στο Τέρμα",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"mma": {
"startTerm": "Έναρξη",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Πιθανότητα Νίκης",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"racing": {
"startTerm": "Έναρξη",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Γύροι",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"soccer": {
"startTerm": "Σέντρα",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Σουτ (Στον Στόχο)",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"tennis": {
"startTerm": "Πρώτο Σερβίς",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "%s",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"volleyball": {
"startTerm": "Πρώτο Σερβίς",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Σκορ %s",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"default": {
"startTerm": "Έναρξη",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Πιθανότητα Νίκης",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
}
}
145 changes: 145 additions & 0 deletions src/localize/languages/sv.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
export const sv = {
"common": {
"api_error": "API Error",
"no_upcoming_games": "Inga kommande matcher %s",
"finalTerm": "%s - Final",
"byeTerm": "BYE",
"tourney2": "Final",
"tourney4": "Semifinaler",
"tourney8": "Kvartsfinaler",
"tourney16": "Åttondelsfinal",
"tourney32": "Sextondelsfinal",
"today": "Idag",
"tomorrow": "Imorgon"
},
"australian-football": {
"startTerm": "Start",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Vinstsannolikhet",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"baseball": {
"startTerm": "Första pitch",
"overUnder": "O/U: %s",
"gameStat1": "Bollar %s",
"gameStat2": "Strikes %s",
"gameStat3": "%s Outs",
"gameBar": "Vinstsannolikhet",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"basketball": {
"startTerm": "Avkast",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Vinstsannolikhet",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"cricket": {
"startTerm": "Start",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Vinstsannolikhet",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"football": {
"startTerm": "Avspark",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Vinstsannolikhet",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"golf": {
"startTerm": "Omgången startar",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Shots (Thru)",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"hockey": {
"startTerm": "Start",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Skott på mål",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"mma": {
"startTerm": "Start",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Vinstsannolikhet",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
},
"racing": {
"startTerm": "Start",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Varv",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"soccer": {
"startTerm": "Avspark",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Skott (på mål)",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"tennis": {
"startTerm": "Första serve",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "%s",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"volleyball": {
"startTerm": "Första serve",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "%s Score",
"teamBarLabel": "%s",
"oppoBarLabel": "%s"
},
"default": {
"startTerm": "Start",
"overUnder": "O/U: %s",
"gameStat1": "%s",
"gameStat2": "%s",
"gameStat3": "",
"gameBar": "Vinstsannolikhet",
"teamBarLabel": "%s%",
"oppoBarLabel": "%s%"
}
}
4 changes: 4 additions & 0 deletions src/localize/translator.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {de} from "./languages/de.js"
import {el} from "./languages/el.js"
import {en} from "./languages/en.js"
import {en_US} from "./languages/en_US.js"
import {es} from "./languages/es.js"
Expand All @@ -9,9 +10,11 @@ import {nl} from "./languages/nl.js"
import {pt_BR} from "./languages/pt_BR.js"
import {sk} from "./languages/sk.js"
import {sk_SK} from "./languages/sk_SK.js"
import {sv} from "./languages/sv.js"

var languages = {
de: de,
el: el,
en: en,
en_US: en_US,
es: es,
Expand All @@ -22,6 +25,7 @@ var languages = {
pt_BR: pt_BR,
sk: sk,
sk_SK: sk_SK,
sv: sv,
};

export class Translator {
Expand Down
12 changes: 6 additions & 6 deletions src/render_in.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export function renderIn(c) {
<div class="card-content">
<div class="team">
<a class="left-clickable ${!c.url[1] ? 'disabled' : ''}" href="${c.url[1] ? c.url[1] : '#'}" target="_blank">
<img class="logo" src="${c.logo[1]}" onerror="this.onerror=null; this.src='${c.logoError[1]}';" />
<div class="name"><span class="rank" style=${styleMap({"--rank-display": `${c.rankDisplay}`})}>${c.rank[1]}</span> ${c.name[1]}</div>
<div class="record">${c.record[1]}</div>
<img class="logo left-logo" src="${c.logo[1]}" onerror="this.onerror=null; this.src='${c.logoError[1]}';" />
<div class="name left-name"><span class="rank" style=${styleMap({"--rank-display": `${c.rankDisplay}`})}>${c.rank[1]}</span> ${c.name[1]}</div>
<div class="record left-record">${c.record[1]}</div>
<div class="timeouts-wrapper" style=${styleMap({"--timeouts-display": `${c.timeoutsDisplay}`})}>
<div class="timeout" style=${styleMap({"--timeout-opacity": `${c.timeoutsOp[1][1]}`, "--timeout-color": `${c.color[1]}`, "--timeout-border": `${c.outlineWidth}px`, "--timeout-border-color": `${c.outlineColor}`})}></div>
<div class="timeout" style=${styleMap({"--timeout-opacity": `${c.timeoutsOp[1][2]}`, "--timeout-color": `${c.color[1]}`, "--timeout-border": `${c.outlineWidth}px`, "--timeout-border-color": `${c.outlineColor}`})}></div>
Expand All @@ -31,9 +31,9 @@ export function renderIn(c) {
<div class="possession" style=${styleMap({"--possession-opacity": `${c.possessionOp[2]}`})}>&bull;</div>
<div class="team">
<a class="right-clickable ${!c.url[2] ? 'disabled' : ''}" href="${c.url[2] ? c.url[2] : '#'}" target="_blank">
<img class="logo" src="${c.logo[2]}" onerror="this.onerror=null; this.src='${c.logoError[2]}';" />
<div class="name"><span class="rank" style=${styleMap({"--rank-display": `${c.rankDisplay}`})}>${c.rank[2]}</span> ${c.name[2]}</div>
<div class="record">${c.record[2]}</div>
<img class="logo right-logo" src="${c.logo[2]}" onerror="this.onerror=null; this.src='${c.logoError[2]}';" />
<div class="name right-name"><span class="rank" style=${styleMap({"--rank-display": `${c.rankDisplay}`})}>${c.rank[2]}</span> ${c.name[2]}</div>
<div class="record right-record">${c.record[2]}</div>
<div class="timeouts-wrapper" style=${styleMap({"--timeouts-display": `${c.timeoutsDisplay}`})}>
<div class="timeout" style=${styleMap({"--timeout-opacity": `${c.timeoutsOp[2][1]}`, "--timeout-color": `${c.color[2]}`, "--timeout-border": `${c.outlineWidth}px`, "--timeout-border-color": `${c.outlineColor}`})}></div>
<div class="timeout" style=${styleMap({"--timeout-opacity": `${c.timeoutsOp[2][2]}`, "--timeout-color": `${c.color[2]}`, "--timeout-border": `${c.outlineWidth}px`, "--timeout-border-color": `${c.outlineColor}`})}></div>
Expand Down
12 changes: 6 additions & 6 deletions src/render_post.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ export function renderPost(c) {
<div class="card-content">
<div class="team">
<a class="left-clickable ${!c.url[1] ? 'disabled' : ''}" href="${c.url[1] ? c.url[1] : '#'}" target="_blank">
<img class="logo" src="${c.logo[1]}" onerror="this.onerror=null; this.src='${c.logoError[1]}';" />
<div class="name"><span class="rank" style=${styleMap({ '--rank-display': c.rankDisplay })}>${c.rank[1]}</span> ${c.name[1]}</div>
<div class="record">${c.record[1]}</div>
<img class="logo left-logo" src="${c.logo[1]}" onerror="this.onerror=null; this.src='${c.logoError[1]}';" />
<div class="name left-name"><span class="rank" style=${styleMap({ '--rank-display': c.rankDisplay })}>${c.rank[1]}</span> ${c.name[1]}</div>
<div class="record left-record">${c.record[1]}</div>
</a>
</div>
<div class="score" style=${styleMap({ '--score_opacity': c.scoreOp[1], "--score_size": c.scoreSize })}>${c.score[1]}</div>
<div class="divider">&nbsp&nbsp&nbsp</div>
<div class="score" style=${styleMap({ '--score_opacity': c.scoreOp[2], "--score_size": c.scoreSize })}>${c.score[2]}</div>
<div class="team">
<a class="right-clickable ${!c.url[2] ? 'disabled' : ''}" href="${c.url[2] ? c.url[2] : '#'}" target="_blank">
<img class="logo" src="${c.logo[2]}" onerror="this.onerror=null; this.src='${c.logoError[2]}';" />
<div class="name"><span class="rank" style=${styleMap({ '--rank-display': c.rankDisplay })}>${c.rank[2]}</span> ${c.name[2]}</div>
<div class="record">${c.record[2]}</div>
<img class="logo right-logo" src="${c.logo[2]}" onerror="this.onerror=null; this.src='${c.logoError[2]}';" />
<div class="name right-name"><span class="rank" style=${styleMap({ '--rank-display': c.rankDisplay })}>${c.rank[2]}</span> ${c.name[2]}</div>
<div class="record right-record">${c.record[2]}</div>
</a>
</div>
</div>
Expand Down
Loading

0 comments on commit 213d902

Please sign in to comment.