🌐 Add the english version of the alt
This commit is contained in:
parent
eec1c50693
commit
1496614da1
1 changed files with 6 additions and 1 deletions
7
main.js
7
main.js
|
@ -8,6 +8,10 @@ const myGm = gm.subClass({imageMagick: true});
|
|||
const position = {x: 4, y: 2, gravity: "NorthEast"}
|
||||
const metadatas = []
|
||||
|
||||
function capitalizeFirstLetter(val) {
|
||||
return String(val).charAt(0).toUpperCase() + String(val).slice(1);
|
||||
}
|
||||
|
||||
function createFilename(prideflag, text, now = false) {
|
||||
const adaptedText = text
|
||||
.replaceAll("⋅", "_")
|
||||
|
@ -43,7 +47,8 @@ function createMetadatas(prideflag, text, now = false) {
|
|||
const filename = createFilename(prideflag, text, now);
|
||||
const textForAlt = text.replaceAll("\n", " ").toLowerCase();
|
||||
const alt = `Drapeau ${prideflag.name.fr.toLowerCase()} (${prideflag.alt.fr}) avec écrit "${textForAlt}${now?", now!": ""}"`
|
||||
return {file:filename, alt:alt, text:textForAlt};
|
||||
const alten = `${capitalizeFirstLetter(prideflag.name.en)} flag (${prideflag.alt.en}) with written "${textForAlt}${now?", now!": ""}"`
|
||||
return {file:filename, alt:alt, localizedAlt:{en: alten, fr: alt}, text:textForAlt};
|
||||
}
|
||||
|
||||
let count = 0;
|
||||
|
|
Loading…
Reference in a new issue