mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Refactor multi-script name code. Update languages.
This commit is contained in:
parent
0e82807170
commit
edd1645bab
@ -4,15 +4,11 @@ function customScriptName(req) {
|
|||||||
const scriptName = process.env.TRACKER_SCRIPT_NAME;
|
const scriptName = process.env.TRACKER_SCRIPT_NAME;
|
||||||
|
|
||||||
if (scriptName) {
|
if (scriptName) {
|
||||||
const names = scriptName.split(',').map(name => name + '.js');
|
|
||||||
|
|
||||||
const url = req.nextUrl.clone();
|
const url = req.nextUrl.clone();
|
||||||
const { pathname } = url;
|
const { pathname } = url;
|
||||||
|
const names = scriptName.split(',').map(name => (name + '.js').trim());
|
||||||
|
|
||||||
const pathNameParts = pathname.split('/');
|
if (names.find(name => pathname.endsWith(name))) {
|
||||||
const lastPathName = pathNameParts[pathNameParts.length - 1];
|
|
||||||
|
|
||||||
if (names.indexOf(lastPathName) !== -1) {
|
|
||||||
url.pathname = '/umami.js';
|
url.pathname = '/umami.js';
|
||||||
return NextResponse.rewrite(url);
|
return NextResponse.rewrite(url);
|
||||||
}
|
}
|
||||||
|
@ -734,7 +734,7 @@
|
|||||||
"metrics.languages": [
|
"metrics.languages": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
"value": "语言"
|
"value": "Languages"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metrics.operating-systems": [
|
"metrics.operating-systems": [
|
||||||
|
@ -32,13 +32,13 @@
|
|||||||
"label.all-events": [
|
"label.all-events": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
"value": "All events"
|
"value": "所有事件"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"label.all-time": [
|
"label.all-time": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
"value": "All time"
|
"value": "所有時間段"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"label.all-websites": [
|
"label.all-websites": [
|
||||||
@ -304,7 +304,7 @@
|
|||||||
"label.reset-website": [
|
"label.reset-website": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
"value": "Reset statistics"
|
"value": "重置統計數據"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"label.save": [
|
"label.save": [
|
||||||
@ -428,7 +428,7 @@
|
|||||||
"message.confirm-reset": [
|
"message.confirm-reset": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
"value": "Are your sure you want to reset "
|
"value": "您確定要重置 "
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": 1,
|
"type": 1,
|
||||||
@ -436,7 +436,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
"value": "'s statistics?"
|
"value": " 的數據嗎?"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"message.copied": [
|
"message.copied": [
|
||||||
@ -564,7 +564,7 @@
|
|||||||
"message.reset-warning": [
|
"message.reset-warning": [
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
"value": "All statistics for this website will be deleted, but your tracking code will remain intact."
|
"value": "本網站的所有統計數據將被刪除,但您的跟蹤代碼將保持不變。"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"message.save-success": [
|
"message.save-success": [
|
||||||
@ -626,7 +626,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
"value": " 確認"
|
"value": " 確認删除"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"message.type-reset": [
|
"message.type-reset": [
|
||||||
@ -640,7 +640,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": 0,
|
"type": 0,
|
||||||
"value": " 確認"
|
"value": " 確認删除"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metrics.actions": [
|
"metrics.actions": [
|
||||||
|
Loading…
Reference in New Issue
Block a user