Skip to content

Commit

Permalink
✨ Add French locales and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Oct 10, 2024
1 parent c4a5dcd commit 2930280
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"ghcr.io/ghcr.io/devcontainers/features/github-cli:1.0.13": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/azure-cli:1.2.5": {},
"ghcr.io/devcontainers/features/python:1.6.3": {}
}
"ghcr.io/devcontainers/features/python:1.6.4": {}
},
"postCreateCommand": "node npm install -g makecode"
}
17 changes: 17 additions & 0 deletions compass/_locales/fr/jacdac-compass-jsdoc-strings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"jacdac.CompassCmd.Calibrate": "Pas d'arguments. Démarre une séquence de calibration pour la boussole.",
"jacdac.CompassReg.Enabled": "Lecture-écriture booléen (uint8_t). Allume ou éteint le capteur. Allumer le capteur peut démarrer une séquence de calibration.\n* ```\nconst [enabled] = jdunpack<[number]>(buf, \"u8\")\n```",
"jacdac.CompassReg.Heading": "Lecture seule ° u16.16 (uint32_t). La direction par rapport au nord magnétique.\n* ```\nconst [heading] = jdunpack<[number]>(buf, \"u16.16\")\n```",
"jacdac.CompassReg.HeadingError": "Lecture seule ° u16.16 (uint32_t). Erreur sur la lecture de la direction\n* ```\nconst [headingError] = jdunpack<[number]>(buf, \"u16.16\")\n```",
"jacdac.CompassRegPack.Enabled": "Format de paquet pour les données 'enabled'.",
"jacdac.CompassRegPack.Heading": "Format de paquet pour les données 'heading'.",
"jacdac.CompassRegPack.HeadingError": "Format de paquet pour les données 'heading_error'.",
"modules": "Modules Jacdac",
"modules.CompassClient": "Un capteur qui mesure la direction.",
"modules.CompassClient.calibrate": "Démarre une séquence de calibration pour la boussole.",
"modules.CompassClient.enabled": "Allume ou éteint le capteur. Allumer le capteur peut démarrer une séquence de calibration.",
"modules.CompassClient.heading": "La direction par rapport au nord magnétique.",
"modules.CompassClient.headingError": "Erreur sur la lecture de la direction",
"modules.CompassClient.onHeadingChangedBy": "Exécute le code lorsque la direction change de la valeur seuil donnée.",
"modules.CompassClient.setEnabled": "Allume ou éteint le capteur. Allumer le capteur peut démarrer une séquence de calibration."
}
16 changes: 16 additions & 0 deletions compass/_locales/fr/jacdac-compass-strings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"jacdac.CompassCmd.Calibrate": "Pas d'arguments. Démarre une séquence d'étalonnage pour la boussole.",
"jacdac.CompassReg.Enabled": "Lecture-écriture booléen (uint8_t). Allume ou éteint le capteur. Allumer le capteur peut démarrer une séquence d'étalonnage.\n* ```\nconst [enabled] = jdunpack<[number]>(buf, \"u8\")\n```",
"jacdac.CompassReg.Heading": "Lecture seule ° u16.16 (uint32_t). L'orientation par rapport au nord magnétique.\n* ```\nconst [heading] = jdunpack<[number]>(buf, \"u16.16\")\n```",
"jacdac.CompassReg.HeadingError": "Lecture seule ° u16.16 (uint32_t). Erreur sur la lecture de l'orientation\n* ```\nconst [headingError] = jdunpack<[number]>(buf, \"u16.16\")\n```",
"modules.CompassClient.calibrate|block": "%compass calibrer",
"modules.CompassClient.enabled|block": "%compass activé",
"modules.CompassClient.heading|block": "%compass orientation (°)",
"modules.CompassClient.onHeadingChangedBy|block": "quand %compass orientation change de %threshold (°)",
"modules.CompassClient.setEnabled|block": "mettre %compass %value=toggleOnOff",
"modules.compass1|block": "boussole1",
"modules|block": "modules",
"{id:category}Jacdac": "Jacdac",
"{id:category}Modules": "Modules",
"{id:group}Compass": "Boussole"
}
18 changes: 14 additions & 4 deletions genaisrc/loc-strings.genai.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
script({
title: "MakeCode Blocks Localization Env",
description: "Translate block strings that define blocks in MakeCode",
title: "translate blocks",
description: "Translate block strings in compiled locales files",
parameters: {
lang: {
type: "string",
Expand Down Expand Up @@ -100,10 +100,20 @@ and should be translated following these rules:
`
ctx.def("ORIGINAL", contentToTranslate, { language: "ini" })
},
{ label: filename }
{ label: filename, cache: "translate" }
)
const news = INI.parse(fences?.[0]?.content || text)
const news = INI.parse(fences?.[0]?.content || text) || {}

// validate that keys are the same
for (const key in news)
if (!strings[key]) {
console.warn(`key ${key} not found in original`)
delete news[key]
}

Object.assign(translated, news)
const newContent = JSON.stringify(translated, null, 2)
if (content !== newContent) await workspace.writeText(trfn, newContent)

// TODO build and validate translations
}
10 changes: 2 additions & 8 deletions tools/farm-beats/pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@
"jacdac-soil-moisture": "github:microsoft/pxt-jacdac/soil-moisture#v0.7.31",
"jacdac-uv-index": "github:microsoft/pxt-jacdac/uv-index#v0.7.31"
},
"files": [
"main.ts",
"README.md"
],
"files": ["main.ts", "README.md"],
"targetVersions": {
"target": "4.0.11",
"targetId": "microbit"
},
"supportedTargets": [
"microbit",
"calliopemini"
],
"supportedTargets": ["microbit", "calliopemini"],
"preferredEditor": "tsprj",
"version": "1.9.28"
}

0 comments on commit 2930280

Please sign in to comment.