Skip to content

Commit f04ae0f

Browse files
Update JSON files
1 parent ab3b3f8 commit f04ae0f

7 files changed

Lines changed: 358 additions & 97 deletions

File tree

app.js

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -800,11 +800,11 @@
800800
const count = Number(subject.selectedRecord.artworkCount || relatedWorks.length || 0);
801801
let html = '<article class="recit-card recit-sujet story-subject-result">';
802802
html += '<header class="recit-header">';
803-
html += '<span class="recit-badge">Theme</span>';
803+
html += '<span class="recit-badge">' + escapeHtml(traduireInterface("recit.badge.theme")) + '</span>';
804804
html += '<h2 class="recit-titre">' + escapeHtml(subject.label || subject.selectedId) + '</h2>';
805805
html += '</header>';
806806
html += '<div class="recit-corps">';
807-
html += '<p class="recit-intro">' + (count ? escapeHtml(count + " artworks found for this theme.") : "Loading artworks for this theme...") + '</p>';
807+
html += '<p class="recit-intro">' + (count ? escapeHtml(traduireInterface("explorer.theme.artworksFound", { count })) : escapeHtml(traduireInterface("explorer.theme.loadingArtworks"))) + '</p>';
808808
if (relatedWorks.length) {
809809
html += '<ul class="recit-liste-oeuvres">';
810810
relatedWorks.slice(0, 10).forEach((work) => {
@@ -814,7 +814,7 @@
814814
}
815815
html += '</div>';
816816
html += '<footer class="recit-footer">';
817-
html += '<button type="button" class="recit-btn-explorer" data-explorer-open-observatory>Explore in constellation</button>';
817+
html += '<button type="button" class="recit-btn-explorer" data-explorer-open-observatory>' + escapeHtml(traduireInterface("explorer.action.openConstellation")) + '</button>';
818818
html += '</footer>';
819819
html += '</article>';
820820
root.innerHTML = html;
@@ -836,8 +836,8 @@
836836
if (!selectedId) {
837837
root.innerHTML = [
838838
'<div class="explorer-empty">',
839-
'<strong>Choose a theme or search result</strong>',
840-
'<span>Explorer will show the selected entity and its first useful connections here.</span>',
839+
'<strong>' + escapeHtml(traduireInterface("explorer.empty.title")) + '</strong>',
840+
'<span>' + escapeHtml(traduireInterface("explorer.empty.detail")) + '</span>',
841841
'</div>'
842842
].join("");
843843
return;
@@ -847,30 +847,30 @@
847847
const count = Number(selectedRecord.artworkCount || relatedWorks.length || 0);
848848
let html = '<article class="explorer-focus-card">';
849849
html += '<header class="explorer-focus-header">';
850-
html += '<div><span class="eyebrow">Current selection</span>';
850+
html += '<div><span class="eyebrow">' + escapeHtml(traduireInterface("explorer.currentSelection")) + '</span>';
851851
html += '<h3>' + escapeHtml(label || selectedId) + '</h3></div>';
852852
html += '<span class="chip">' + escapeHtml(selectedType || "entity") + '</span>';
853853
html += '</header>';
854854

855855
if (selectedType === "sujet" || selectedType === "subject") {
856-
html += '<p class="explorer-focus-summary">' + (count ? escapeHtml(count + " artworks found for this theme.") : "Theme loaded. Try another theme if Wikidata has no direct artwork matches.") + '</p>';
856+
html += '<p class="explorer-focus-summary">' + (count ? escapeHtml(traduireInterface("explorer.theme.artworksFound", { count })) : escapeHtml(traduireInterface("explorer.theme.loadedEmpty"))) + '</p>';
857857
} else {
858-
html += '<p class="explorer-focus-summary">' + escapeHtml(runtimeState.selectedEntity.meta || "Selection loaded.") + '</p>';
858+
html += '<p class="explorer-focus-summary">' + escapeHtml(runtimeState.selectedEntity.meta || traduireInterface("explorer.selectionLoaded")) + '</p>';
859859
}
860860

861861
if (relatedWorks.length) {
862-
html += '<div class="explorer-work-list" aria-label="Related artworks">';
862+
html += '<div class="explorer-work-list" aria-label="' + escapeHtml(traduireInterface("explorer.relatedArtworks")) + '">';
863863
relatedWorks.forEach((work) => {
864864
html += '<button type="button" class="explorer-work-item" data-explorer-entity-id="' + escapeHtml(work.id) + '" data-explorer-entity-type="artwork">';
865865
html += '<strong>' + escapeHtml(work.etiquette || work.label || work.id) + '</strong>';
866-
html += '<small>artwork</small>';
866+
html += '<small>' + escapeHtml(traduireInterface("explorer.type.artwork")) + '</small>';
867867
html += '</button>';
868868
});
869869
html += '</div>';
870870
}
871871

872872
html += '<div class="explorer-focus-actions">';
873-
html += '<button type="button" class="ghost-button" data-explorer-open-observatory>See constellation</button>';
873+
html += '<button type="button" class="ghost-button" data-explorer-open-observatory>' + escapeHtml(traduireInterface("explorer.action.seeConstellation")) + '</button>';
874874
html += '</div>';
875875
html += '</article>';
876876
root.innerHTML = html;
@@ -955,18 +955,18 @@ function setActiveTier(tier, options = {}) {
955955
const displaySideBySide = snapshot.afficher_surfaces_paralleles !== false;
956956

957957
// Render polyglot studio HTML directly
958-
let html = "<div class='polyglot-studio-container' role='main' aria-label='Polyglot Studio - Language Explorer'>";
958+
let html = "<div class='polyglot-studio-container' role='main' aria-label='" + escapeHtml(traduireInterface("polyglot.aria")) + "'>";
959959

960960
// Header
961961
html += "<div class='polyglot-header' role='banner'>";
962962
html += "<div class='polyglot-title-section'>";
963-
html += "<h2>Polyglot Studio</h2>";
964-
html += "<span class='polyglot-hint'>Explore language variations • Ctrl+L to toggle • Ctrl+V for view</span>";
963+
html += "<h2>" + escapeHtml(traduireInterface("polyglot.title")) + "</h2>";
964+
html += "<span class='polyglot-hint'>" + escapeHtml(traduireInterface("polyglot.hint")) + "</span>";
965965
html += "</div>";
966-
html += "<div class='polyglot-controls' role='toolbar' aria-label='Language and view controls'>";
967-
html += "<button class='language-toggle " + (currentLang === "fr" ? "is-active" : "") + "' data-lang='fr' title='French surface (Ctrl+L)' aria-pressed='" + (currentLang === "fr" ? "true" : "false") + "'>Francais</button>";
968-
html += "<button class='language-toggle " + (currentLang === "en" ? "is-active" : "") + "' data-lang='en' title='English surface (Ctrl+L)' aria-pressed='" + (currentLang === "en" ? "true" : "false") + "'>English</button>";
969-
html += "<button class='view-toggle' id='polyglot-toggle-view' title='Toggle between side-by-side and tab view (Ctrl+V)' aria-label='View mode toggle'>Changer vue</button>";
966+
html += "<div class='polyglot-controls' role='toolbar' aria-label='" + escapeHtml(traduireInterface("polyglot.controlsAria")) + "'>";
967+
html += "<button class='language-toggle " + (currentLang === "fr" ? "is-active" : "") + "' data-lang='fr' title='" + escapeHtml(traduireInterface("polyglot.surface.fr.title")) + "' aria-pressed='" + (currentLang === "fr" ? "true" : "false") + "'>" + escapeHtml(traduireInterface("polyglot.surface.fr.label")) + "</button>";
968+
html += "<button class='language-toggle " + (currentLang === "en" ? "is-active" : "") + "' data-lang='en' title='" + escapeHtml(traduireInterface("polyglot.surface.en.title")) + "' aria-pressed='" + (currentLang === "en" ? "true" : "false") + "'>" + escapeHtml(traduireInterface("polyglot.surface.en.label")) + "</button>";
969+
html += "<button class='view-toggle' id='polyglot-toggle-view' title='" + escapeHtml(traduireInterface("polyglot.viewToggle.title")) + "' aria-label='" + escapeHtml(traduireInterface("polyglot.viewToggle.aria")) + "'>" + escapeHtml(traduireInterface("polyglot.viewToggle.label")) + "</button>";
970970
html += "</div>";
971971
html += "</div>";
972972

@@ -1022,7 +1022,7 @@ function setActiveTier(tier, options = {}) {
10221022
}
10231023
}
10241024

1025-
let html = "<div class='polyglot-surface surface-" + lang + "' lang='" + lang + "' role='region' aria-label='" + lang.toUpperCase() + " surface'>";
1025+
let html = "<div class='polyglot-surface surface-" + lang + "' lang='" + lang + "' role='region' aria-label='" + escapeHtml(traduireInterface("polyglot.surface.aria", { lang: lang.toUpperCase() }, lang)) + "'>";
10261026

10271027
html += "<div class='entity-header'>";
10281028
html += "<div style='flex: 1'>";
@@ -1096,13 +1096,13 @@ function setActiveTier(tier, options = {}) {
10961096

10971097
function renderMovementProperties(entity, lang) {
10981098
let html = "";
1099-
const startLabel = lang === "fr" ? "Période" : "Period";
1100-
const countriesLabel = lang === "fr" ? "Pays d'origine" : "Countries";
1101-
const precLabel = lang === "fr" ? "Mouvements précurseurs" : "Preceding movements";
1102-
const succLabel = lang === "fr" ? "Mouvements successeurs" : "Succeeding movements";
1099+
const startLabel = traduireInterface("polyglot.property.period", {}, lang);
1100+
const countriesLabel = traduireInterface("polyglot.property.countries", {}, lang);
1101+
const precLabel = traduireInterface("polyglot.property.precedingMovements", {}, lang);
1102+
const succLabel = traduireInterface("polyglot.property.succeedingMovements", {}, lang);
11031103

11041104
html += "<div class='property-section'>";
1105-
html += "<div class='section-title'>" + (lang === "fr" ? "Informations principales" : "Primary information") + "</div>";
1105+
html += "<div class='section-title'>" + escapeHtml(traduireInterface("polyglot.section.primary", {}, lang)) + "</div>";
11061106

11071107
const debut = extractValue(entity.startTime);
11081108
const fin = extractValue(entity.endTime);
@@ -1137,7 +1137,7 @@ function setActiveTier(tier, options = {}) {
11371137

11381138
if (precMovements.length > 0 || succMovements.length > 0) {
11391139
html += "<div class='property-section'>";
1140-
html += "<div class='section-title'>" + (lang === "fr" ? "Contexte historique" : "Historical context") + "</div>";
1140+
html += "<div class='section-title'>" + escapeHtml(traduireInterface("polyglot.section.historical", {}, lang)) + "</div>";
11411141

11421142
const precLabels = relatedValues(entity, "follows", "followsLabel").join(", ");
11431143
if (precLabels) {
@@ -1163,13 +1163,13 @@ function setActiveTier(tier, options = {}) {
11631163

11641164
function renderArtistProperties(entity, lang) {
11651165
let html = "";
1166-
const datesLabel = lang === "fr" ? "Dates de vie" : "Lifespan";
1167-
const birthplaceLabel = lang === "fr" ? "Lieu de naissance" : "Birthplace";
1168-
const deathplaceLabel = lang === "fr" ? "Lieu de décès" : "Deathplace";
1169-
const movementsLabel = lang === "fr" ? "Mouvements artistiques" : "Artistic movements";
1166+
const datesLabel = traduireInterface("polyglot.property.lifespan", {}, lang);
1167+
const birthplaceLabel = traduireInterface("polyglot.property.birthplace", {}, lang);
1168+
const deathplaceLabel = traduireInterface("polyglot.property.deathplace", {}, lang);
1169+
const movementsLabel = traduireInterface("polyglot.property.artisticMovements", {}, lang);
11701170

11711171
html += "<div class='property-section'>";
1172-
html += "<div class='section-title'>" + (lang === "fr" ? "Biographie" : "Biography") + "</div>";
1172+
html += "<div class='section-title'>" + escapeHtml(traduireInterface("polyglot.section.biography", {}, lang)) + "</div>";
11731173

11741174
const birthDate = extractValue(entity.birthDate);
11751175
const deathDate = extractValue(entity.deathDate);
@@ -1207,7 +1207,7 @@ function setActiveTier(tier, options = {}) {
12071207

12081208
if (movements.length > 0) {
12091209
html += "<div class='property-section'>";
1210-
html += "<div class='section-title'>" + (lang === "fr" ? "Affiliations artistiques" : "Artistic affiliations") + "</div>";
1210+
html += "<div class='section-title'>" + escapeHtml(traduireInterface("polyglot.section.affiliations", {}, lang)) + "</div>";
12111211

12121212
const movementLabels = relatedValues(entity, "movement", "movementLabel").join(", ");
12131213
if (movementLabels) {
@@ -1237,14 +1237,14 @@ function setActiveTier(tier, options = {}) {
12371237

12381238
function renderArtworkProperties(entity, lang) {
12391239
let html = "";
1240-
const creatorLabel = lang === "fr" ? "Créateur" : "Creator";
1241-
const dateLabel = lang === "fr" ? "Date de création" : "Date created";
1242-
const museumLabel = lang === "fr" ? "Localisation" : "Location";
1243-
const materialLabel = lang === "fr" ? "Matériaux" : "Materials";
1244-
const depictsLabel = lang === "fr" ? "Sujets représentés" : "Subjects depicted";
1240+
const creatorLabel = traduireInterface("polyglot.property.creator", {}, lang);
1241+
const dateLabel = traduireInterface("polyglot.property.creationDate", {}, lang);
1242+
const museumLabel = traduireInterface("polyglot.property.location", {}, lang);
1243+
const materialLabel = traduireInterface("polyglot.property.materials", {}, lang);
1244+
const depictsLabel = traduireInterface("polyglot.property.depicts", {}, lang);
12451245

12461246
html += "<div class='property-section'>";
1247-
html += "<div class='section-title'>" + (lang === "fr" ? "Informations principales" : "Primary information") + "</div>";
1247+
html += "<div class='section-title'>" + escapeHtml(traduireInterface("polyglot.section.primary", {}, lang)) + "</div>";
12481248

12491249
// Creator
12501250
const creatorVal = relatedValues(entity, "creator", "creatorLabel").join(", ");
@@ -1287,7 +1287,7 @@ function setActiveTier(tier, options = {}) {
12871287

12881288
if (materials.length > 0 || depicts.length > 0) {
12891289
html += "<div class='property-section'>";
1290-
html += "<div class='section-title'>" + (lang === "fr" ? "Caractéristiques physiques" : "Physical characteristics") + "</div>";
1290+
html += "<div class='section-title'>" + escapeHtml(traduireInterface("polyglot.section.physical", {}, lang)) + "</div>";
12911291

12921292
if (materials.length > 0) {
12931293
const materialLabels = relatedValues(entity, "material", "materialLabel").join(", ");
@@ -1317,14 +1317,14 @@ function setActiveTier(tier, options = {}) {
13171317

13181318
function renderMuseumProperties(entity, lang) {
13191319
let html = "";
1320-
const countryLabel = lang === "fr" ? "Pays" : "Country";
1321-
const locationLabel = lang === "fr" ? "Lieu" : "Location";
1322-
const inceptionLabel = lang === "fr" ? "Fondation" : "Founded";
1323-
const collectionLabel = lang === "fr" ? "Oeuvres chargees" : "Loaded works";
1324-
const websiteLabel = lang === "fr" ? "Site web" : "Website";
1320+
const countryLabel = traduireInterface("polyglot.property.country", {}, lang);
1321+
const locationLabel = traduireInterface("polyglot.property.place", {}, lang);
1322+
const inceptionLabel = traduireInterface("polyglot.property.founded", {}, lang);
1323+
const collectionLabel = traduireInterface("polyglot.property.loadedWorks", {}, lang);
1324+
const websiteLabel = traduireInterface("polyglot.property.website", {}, lang);
13251325

13261326
html += "<div class='property-section'>";
1327-
html += "<div class='section-title'>" + (lang === "fr" ? "Informations principales" : "Primary information") + "</div>";
1327+
html += "<div class='section-title'>" + escapeHtml(traduireInterface("polyglot.section.primary", {}, lang)) + "</div>";
13281328

13291329
const inception = extractValue(entity.inceptionDate || entity.foundedDate);
13301330
if (inception) {

0 commit comments

Comments
 (0)