diff --git a/hooks/useVersion.js b/hooks/useVersion.js
new file mode 100644
index 00000000..76aefadc
--- /dev/null
+++ b/hooks/useVersion.js
@@ -0,0 +1,28 @@
+import { useMemo } from 'react';
+import useFetch from 'hooks/useFetch';
+
+export default function useVersion() {
+ const { data } = useMemo(() =>
+ useFetch('https://api.github.com/repos/mikecao/umami/releases/latest'),
+ );
+
+ if (!data || !data['tag_name']) return null;
+
+ const latest = data['tag_name'].startsWith('v') ? data['tag_name'].slice(1) : data['tag_name'];
+ const current = process.env.VERSION;
+
+ if (latest === current) return null;
+
+ const latestArray = latest.split('.');
+ const currentArray = current.split('.');
+
+ for (let i = 0; i < 3; i++) {
+ if (Number(latestArray[i]) > Number(currentArray[i]))
+ return {
+ current: current,
+ latest: latest,
+ };
+ }
+
+ return null;
+}
diff --git a/lang/de-DE.json b/lang/de-DE.json
index f960d1eb..f7ef14fc 100644
--- a/lang/de-DE.json
+++ b/lang/de-DE.json
@@ -54,6 +54,7 @@
"message.get-tracking-code": "Erstelle Tracking Kennung",
"message.go-to-settings": "Zu den Einstellungen",
"message.incorrect-username-password": "Falsches Passwort oder Benutzername.",
+ "message.new-version-available": "Version {latest} ist verfügbar! Aktuelle Version: {current}",
"message.no-data-available": "Keine Daten vorhanden.",
"message.no-websites-configured": "Es ist keine Webseite vorhanden.",
"message.page-not-found": "Seite nicht gefunden.",
@@ -62,6 +63,7 @@
"message.share-url": "Dies ist der öffentliche URL zum Teilen für {target}.",
"message.track-stats": "Um die Statistiken für {target} zu übermitteln, platzieren Sie bitte den folgenden Quelltext im {head} ihrer Homepage.",
"message.type-delete": "Geben Sie {delete} in das Feld unten ein um zu bestätigen.",
+ "message.visit-github-update": "Klicken Sie hier um umami auf GitHub zu besuchen für Anweisungen",
"metrics.actions": "Aktionen",
"metrics.average-visit-time": "Durchschn. Besuchszeit",
"metrics.bounce-rate": "Absprungrate",
diff --git a/lang/en-US.json b/lang/en-US.json
index 54ee8cad..044d4645 100644
--- a/lang/en-US.json
+++ b/lang/en-US.json
@@ -54,6 +54,7 @@
"message.get-tracking-code": "Get tracking code",
"message.go-to-settings": "Go to settings",
"message.incorrect-username-password": "Incorrect username/password.",
+ "message.new-version-available": "Version {latest} available! Current version: {current}",
"message.no-data-available": "No data available.",
"message.no-websites-configured": "You don't have any websites configured.",
"message.page-not-found": "Page not found.",
@@ -62,6 +63,7 @@
"message.share-url": "This is the publicly shared URL for {target}.",
"message.track-stats": "To track stats for {target}, place the following code in the {head} section of your website.",
"message.type-delete": "Type {delete} in the box below to confirm.",
+ "message.visit-github-update": "Click here to visit umami on GitHub for instructions",
"metrics.actions": "Actions",
"metrics.average-visit-time": "Average visit time",
"metrics.bounce-rate": "Bounce rate",
diff --git a/lang/nl-NL.json b/lang/nl-NL.json
index 3ebfcd14..d8fc730f 100644
--- a/lang/nl-NL.json
+++ b/lang/nl-NL.json
@@ -54,6 +54,7 @@
"message.get-tracking-code": "Tracking code",
"message.go-to-settings": "Naar instellingen",
"message.incorrect-username-password": "Incorrecte gebruikersnaam/wachtwoord.",
+ "message.new-version-available": "Versie {latest} beschikbaar! Huidige versie: {current}",
"message.no-data-available": "Geen gegevens beschikbaar.",
"message.no-websites-configured": "Je hebt geen websites ingesteld.",
"message.page-not-found": "Pagina niet gevonden.",
@@ -62,6 +63,7 @@
"message.share-url": "Met deze URL kan {target} openbaar gedeeld worden.",
"message.track-stats": "Om statistieken voor {target} bij te houden, plaats je de volgende code in het {head} gedeelte van je website.",
"message.type-delete": "Type {delete} in onderstaande veld om dit te bevestigen.",
+ "message.visit-github-update": "Klik hier om naar umami op GitHub te gaan voor instructies",
"metrics.actions": "Acties",
"metrics.average-visit-time": "Gemiddelde bezoektijd",
"metrics.bounce-rate": "Bouncepercentage",