mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Check for additional placeholders in translations
validation didn’t check for extra placeholders if there were none in the original.
This commit is contained in:
parent
3a8cf833b4
commit
8db6469cb5
2 changed files with 11 additions and 8 deletions
|
@ -19,9 +19,12 @@ const validateEntry = function (entry) {
|
|||
const re = /(%\d)/g;
|
||||
const [key, translation] = entry;
|
||||
const enMatch = en[key].match(re);
|
||||
const placeholdersCount = enMatch ? enMatch.length : 0;
|
||||
if (placeholdersCount > 0) {
|
||||
const tMatch = translation.match(re);
|
||||
const tMatch = translation.match(re);
|
||||
const enCount = enMatch ? enMatch.length : 0;
|
||||
const tCount = tMatch ? tMatch.length : 0;
|
||||
assert.strictEqual(tCount, enCount, `${key}:${en[key]} - "${translation}" placeholder mismatch`);
|
||||
if (enCount > 0) {
|
||||
|
||||
assert.notStrictEqual(tMatch, null, `${key} is missing a placeholder: ${translation}`);
|
||||
assert.strictEqual(
|
||||
tMatch.sort().toString(),
|
||||
|
|
|
@ -1117,14 +1117,14 @@ Blockly.ScratchMsgs.locales["cy"] =
|
|||
"DELETE_VARIABLE": "Dileu newidyn \"%1\"",
|
||||
"NEW_PROCEDURE": "Creu Bloc",
|
||||
"PROCEDURE_ALREADY_EXISTS": "Mae trefn o'r enw \"%1\" yn bodoli eisoes.",
|
||||
"PROCEDURE_DEFAULT_NAME": "block name",
|
||||
"PROCEDURE_DEFAULT_NAME": "enw bloc",
|
||||
"NEW_LIST": "Gwneud Rhestr",
|
||||
"NEW_LIST_TITLE": "Enw rhestr newydd:",
|
||||
"LIST_MODAL_TITLE": "Rhestr Newydd",
|
||||
"LIST_ALREADY_EXISTS": "Mae rhestr o'r enw \"%1\" yn bodoli eisoes.",
|
||||
"RENAME_LIST_TITLE": "Ailenwi pob rhestr \"%1\" i:",
|
||||
"RENAME_LIST_MODAL_TITLE": "Ailenwi Rhestr",
|
||||
"DEFAULT_LIST_ITEM": "thing",
|
||||
"DEFAULT_LIST_ITEM": "peth",
|
||||
"NEW_BROADCAST_MESSAGE": "Neges newydd",
|
||||
"NEW_BROADCAST_MESSAGE_TITLE": "Enw neges newydd:",
|
||||
"BROADCAST_MODAL_TITLE": "Neges Newydd",
|
||||
|
@ -4208,7 +4208,7 @@ Blockly.ScratchMsgs.locales["gd"] =
|
|||
"DELETE_VARIABLE": "Sguab às dha “%1”",
|
||||
"NEW_PROCEDURE": "Cruthaich bloca",
|
||||
"PROCEDURE_ALREADY_EXISTS": "Tha modh air a bheil “%1” ann mu thràth.",
|
||||
"PROCEDURE_DEFAULT_NAME": "block name",
|
||||
"PROCEDURE_DEFAULT_NAME": "ainm a’ bhloca",
|
||||
"NEW_LIST": "Cruthaich liosta",
|
||||
"NEW_LIST_TITLE": "Ainm na liosta ùire:",
|
||||
"LIST_MODAL_TITLE": "Liosta ùr",
|
||||
|
@ -7673,7 +7673,7 @@ Blockly.ScratchMsgs.locales["pl"] =
|
|||
"LOOKS_CLEARGRAPHICEFFECTS": "Wyczyść efekty graficzne",
|
||||
"LOOKS_CHANGESIZEBY": "Zmień rozmiar o %1",
|
||||
"LOOKS_SETSIZETO": "Ustaw rozmiar na %1 %",
|
||||
"LOOKS_SIZE": "Rozmiar %1",
|
||||
"LOOKS_SIZE": "rozmiar",
|
||||
"LOOKS_CHANGESTRETCHBY": "zmień rozciągnięcie o %1",
|
||||
"LOOKS_SETSTRETCHTO": "ustaw rozciąganie na %1 %",
|
||||
"LOOKS_SWITCHCOSTUMETO": "Zmień kostium na %1",
|
||||
|
@ -9835,7 +9835,7 @@ Blockly.ScratchMsgs.locales["sv"] =
|
|||
"LIST_ALREADY_EXISTS": "En lista \"%1\" finns redan.",
|
||||
"RENAME_LIST_TITLE": "Döp om alla \"%1\" listor till:",
|
||||
"RENAME_LIST_MODAL_TITLE": "Döp om lista",
|
||||
"DEFAULT_LIST_ITEM": "thing",
|
||||
"DEFAULT_LIST_ITEM": "grej",
|
||||
"NEW_BROADCAST_MESSAGE": "Nytt meddelande",
|
||||
"NEW_BROADCAST_MESSAGE_TITLE": "Nytt namn på meddelande:",
|
||||
"BROADCAST_MODAL_TITLE": "Nytt meddelande",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue