Skip to content

Commit d0d8644

Browse files
committed
duplicates found
1 parent b7bd04c commit d0d8644

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

scripts/lochex.mjs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ for (const lang of languages.filter(l => l !== "pxt")) {
8484

8585
const entries = {}
8686

87+
/*
88+
ERROR: already have entry for light
89+
ERROR: already have entry for line
90+
ERROR: already have entry for temperature
91+
ERROR: already have entry for NA
92+
ERROR: already have entry for red
93+
ERROR: already have entry for purple
94+
ERROR: already have entry for turn-left
95+
ERROR: already have entry for turn-right
96+
ERROR: already have entry for on
97+
ERROR: already have entry for off
98+
*/
99+
87100
const tooltip2tid = `
88101
export function tooltip2tid(id: string): number {
89102
let tid: number = undefined
@@ -95,12 +108,13 @@ for (const lang of languages.filter(l => l !== "pxt")) {
95108
.filter(k => /T\d+/.test(k))
96109
.map(k => {
97110
const tid = parseInt(k.slice(1))
98-
if (entries[translations[k]]) {
99-
console.log(
100-
`ERROR: already have entry for ${translations[k]}`
101-
)
111+
const trans = translations[k].replace(/ /g, "-")
112+
if (entries[trans]) {
113+
console.log(`ERROR: already have entry for ${trans}`)
114+
} else {
115+
entries[trans] = tid
102116
}
103-
return ` else if (id === "${translations[k]}") tid = ${tid};`
117+
return ` else if (id === "${trans}") tid = ${tid};`
104118
})
105119
.join("\n")}
106120
return tid

0 commit comments

Comments
 (0)