Skip to content

Commit

Permalink
add outdated-version.html
Browse files Browse the repository at this point in the history
  • Loading branch information
sadiqkhoja committed Dec 10, 2024
1 parent 2d95a61 commit 8e0a278
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docs/i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"heading": {
"en": "You're using a significantly outdated version of ODK Central",
"fr": "Vous utilisez une version de ODK Central considérablement obsolète",
"es": "Estás usando una versión significativamente desactualizada de ODK Central",
"cs": "Používáte výrazně zastaralou verzi ODK Central",
"de": "Sie verwenden eine deutlich veraltete Version von ODK Central",
"id": "Anda menggunakan versi ODK Central yang sangat usang",
"it": "Stai usando una versione di ODK Central significativamente obsoleta",
"ja": "ODK Central の大幅に古いバージョンを使用しています",
"sw": "Unatumia toleo la ODK Central ambalo limepitwa sana na wakati",
"zh": "您正在使用一个明显过时的 ODK Central 版本"
},
"sentence1": {
"en": "Upgrade now to protect your data and take advantage of the latest features.",
"fr": "Mettez à jour maintenant pour protéger vos données et profiter des dernières fonctionnalités.",
"es": "Actualiza ahora para proteger tus datos y aprovechar las últimas funciones.",
"cs": "Aktualizujte nyní, abyste ochránili svá data a využili nejnovější funkce.",
"de": "Aktualisieren Sie jetzt, um Ihre Daten zu schützen und die neuesten Funktionen zu nutzen.",
"id": "Perbarui sekarang untuk melindungi data Anda dan memanfaatkan fitur terbaru.",
"it": "Aggiorna ora per proteggere i tuoi dati e sfruttare le ultime funzionalità.",
"ja": "データを保護し、最新の機能を利用するために今すぐアップグレードしてください。",
"sw": "Sasisha sasa ili kulinda data zako na kutumia vipengele vipya zaidi.",
"zh": "立即升级以保护您的数据并利用最新功能。"
},
"sentence2": {
"en": "If you don't want to maintain Central, try {{OdkCloudLink}}",
"fr": "Si vous ne voulez pas maintenir Central, essayez {{OdkCloudLink}}",
"es": "Si no quieres mantener Central, prueba {{OdkCloudLink}}",
"cs": "Pokud nechcete spravovat Central, vyzkoušejte {{OdkCloudLink}}",
"de": "Wenn Sie Central nicht warten möchten, probieren Sie {{OdkCloudLink}} aus",
"id": "Jika Anda tidak ingin memelihara Central, coba {{OdkCloudLink}}",
"it": "Se non vuoi mantenere Central, prova {{OdkCloudLink}}",
"ja": "Central を管理したくない場合は、{{OdkCloudLink}} を試してください。",
"sw": "Kama hutaki kudumisha Central, jaribu {{OdkCloudLink}}",
"zh": "如果您不想维护 Central,请尝试 {{OdkCloudLink}}"
}
}
36 changes: 36 additions & 0 deletions docs/outdated-version.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ODK Central</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- this page is rendered in an iframe of size 600x200 -->
<div class="outdated-version" style="display: block;">
<h1 class="heading">You're using a significantly outdated version of ODK Central</h1>
<p>
<span class="sentence1">Upgrade now to protect your data and take advantage of the latest features.</span>
<span class="sentence2">If you don't want to maintain Central, try<a href="https://getodk.org/#success-stories" target="_blank"> ODK Cloud.</a></span>
</p>
<script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "81f288331d6e4638be205e0e63388165"}'></script>
</div>

<script>
document.addEventListener('DOMContentLoaded', () => {
const queryParams = new URLSearchParams(location.search);
const lang = queryParams.get('lang');
const odkCloudLink = '<a href="https://getodk.org/#success-stories" target="_blank">ODK Cloud</a>';

fetch('./i18n.json').then(r => r.json()).then(i18n => {
const localText = Object.keys(i18n).reduce((a, k) => {a.set(k, i18n[k][lang] ?? i18n[k]['en']); return a;}, new Map());
document.querySelector('.heading').textContent = localText.get('heading');
document.querySelector('.sentence1').textContent = localText.get('sentence1');
document.querySelector('.sentence2').innerHTML = localText.get('sentence2').replace('{{OdkCloudLink}}', odkCloudLink);
})
})
</script>
</body>
</html>


18 changes: 18 additions & 0 deletions docs/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,21 @@ a:focus {
.news-item a {
margin-left: 82px;
}

.outdated-version {
display: flex;
flex-direction: column;
height: 250px;
justify-content: center;
gap: 20px;
}

.outdated-version h1 {
margin: 0;
font-size: 30px;
}

.outdated-version p {
margin: 0;
font-size: 18px;
}

0 comments on commit 8e0a278

Please sign in to comment.