One-liner in Bash (Linux command line). Doing it manually would take a few minutes - replacing parts of the previous command.
The whole job is just tedious and annoying.
And yes, you could feed the yaml file for English to ChatGPT and tell it to translate the strings to French. It’s that good nowadays.
Going to try it later with GitHub Copilot in VSCode. This thing is just crazy…
Took the example file from here:
… and asked ChatGPT to translate it to French. Result:
{
"tag": "fr",
"label": "Porte de Garage Personnalisée",
"attributes": {
"door": {
"label": "État de la Porte de Garage",
"displayTemplate": "{{attribute}} de {{device.label}} est {{value}}",
"i18n": {
"value": {
"closing": {
"label": "Fermeture..."
},
"closed": {
"label": "Fermée"
},
"opening": {
"label": "Ouverture..."
},
"partial": {
"label": "Partiellement ouverte"
},
"open": {
"label": "Ouverte"
}
}
}
}
}
}
German (took another 2 seconds):
{
"tag": "de",
"label": "Benutzerdefiniertes Garagentor",
"attributes": {
"door": {
"label": "Garagentorstatus",
"displayTemplate": "{{attribute}} von {{device.label}} ist {{value}}",
"i18n": {
"value": {
"closing": {
"label": "Schließt..."
},
"closed": {
"label": "Geschlossen"
},
"opening": {
"label": "Öffnet..."
},
"partial": {
"label": "Teilweise geöffnet"
},
"open": {
"label": "Geöffnet"
}
}
}
}
}
}
See how awesome it is? Took seconds.
This is what AI was made for.