mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 19:46:32 +08:00
chore(i18n): clean code
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"i18next": "^21.9.1",
|
||||
"jotai": "^1.8.1",
|
||||
"react-i18next": "^11.18.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ if (!TOLGEE_API_KEY) {
|
||||
const withTolgee = (
|
||||
fetch: typeof globalThis.fetch
|
||||
): typeof globalThis.fetch => {
|
||||
const baseUrl = `${TOLGEE_API_URL}/v2/projects`;
|
||||
const headers = new Headers({
|
||||
'X-API-Key': TOLGEE_API_KEY,
|
||||
'Content-Type': 'application/json',
|
||||
@@ -29,14 +30,14 @@ const withTolgee = (
|
||||
if (!argArray[0].headers) {
|
||||
argArray[0] = {
|
||||
...argArray[0],
|
||||
url: `${TOLGEE_API_URL}/v2/projects${argArray[0].url}`,
|
||||
url: `${baseUrl}${argArray[0].url}`,
|
||||
headers,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
// URL or URLLike + ?RequestInit
|
||||
if (typeof argArray[0] === 'string') {
|
||||
argArray[0] = `${TOLGEE_API_URL}/v2/projects${argArray[0]}`;
|
||||
argArray[0] = `${baseUrl}${argArray[0]}`;
|
||||
}
|
||||
if (!argArray[1]) {
|
||||
argArray[1] = {};
|
||||
|
||||
@@ -79,8 +79,7 @@ const differenceObject = (
|
||||
};
|
||||
|
||||
function warnDiff(diff: { add: string[]; remove: string[]; modify: string[] }) {
|
||||
if (!diff.add.length) {
|
||||
} else {
|
||||
if (diff.add.length) {
|
||||
console.log('New keys found:', diff.add.join(', '));
|
||||
//See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-notice-message
|
||||
process.env['CI'] &&
|
||||
|
||||
Reference in New Issue
Block a user