diff --git a/dev/generateInitialLangFallback.ts b/dev/generateInitialLangFallback.ts new file mode 100644 index 000000000..0839a4b47 --- /dev/null +++ b/dev/generateInitialLangFallback.ts @@ -0,0 +1,19 @@ +import { writeFileSync } from 'fs'; + +import initialKeys from '../src/assets/localization/initialKeys'; +import readFallbackStrings from '../src/util/data/readFallbackStrings'; +import { pick } from '../src/util/iteratees'; + +const HEADER = `/* eslint-disable */ +// This file is generated by dev/generateInitialLangFallback.ts. Do not edit it manually.\n`; + +async function main() { + const data = await readFallbackStrings(true); + + const selectedKeys = pick(data.langPack.strings, initialKeys); + const json = JSON.stringify(selectedKeys, undefined, 2); + const text = `${HEADER}\nexport default ${json} as Record;\n`; + writeFileSync('./src/assets/localization/initialStrings.ts', text, 'utf8'); +} + +main(); diff --git a/dev/generateLangTypes.ts b/dev/generateLangTypes.ts new file mode 100644 index 000000000..2b766287a --- /dev/null +++ b/dev/generateLangTypes.ts @@ -0,0 +1,47 @@ +import { readFileSync, writeFileSync } from 'fs'; + +import readStrings from '../src/util/data/readStrings'; + +const TOP_COMMENT = '// This file is generated by dev/generateLangTypes.ts. Do not edit it manually.\n'; +const LANG_KEY_TYPE = 'export type LangKey = keyof LangPair;'; + +const data = readFileSync('./src/assets/localization/fallback.strings', 'utf8'); + +const parsed = readStrings(data); +const keysWithVars = Object.entries(parsed).reduce((acc, [keyWithSuffix, value]) => { + const key = keyWithSuffix.split('_')[0]; + const variables = extractVariables(value); + + const previousVariables = acc[key] || []; + if (!previousVariables.length) { + acc[key] = variables; + } else { + acc[key] = Array.from(new Set([...previousVariables, ...variables])); + } + return acc; +}, {} as Record); + +let entries = ''; + +Object.entries(keysWithVars).forEach(([key, variables]) => { + const varString = variables.length + ? `{\n ${variables.map((v) => `${wrapInQuotes(v)}: string | number;`).join('\n ')}\n };\n` + : 'undefined;\n'; + entries += ` ${wrapInQuotes(key)}: ${varString}`; +}); + +const langPair = `export interface LangPair {\n${entries}\n}\n`; +const text = `${TOP_COMMENT}\n${langPair}\n${LANG_KEY_TYPE}\n`; +writeFileSync('./src/types/language.d.ts', text, 'utf8'); +// eslint-disable-next-line no-console +console.log(`Language types generated: ${Object.keys(keysWithVars).length} keys`); + +function extractVariables(value: string) { + const matches = value.match(/(? match.slice(1, -1)); +} + +function wrapInQuotes(value: string) { + return `'${value}'`; +} diff --git a/package-lock.json b/package-lock.json index 336378595..fd3283a3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -104,6 +104,7 @@ "stylelint-high-performance-animation": "^1.10.0", "stylelint-selector-tag-no-without-class": "^3.0.1", "telegraph-node": "^1.0.4", + "tsx": "^4.11.0", "typescript": "^5.4.5", "webpack": "^5.91.0", "webpack-dev-server": "^5.0.4" @@ -2714,6 +2715,374 @@ "node": "*" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -10200,6 +10569,44 @@ "dev": true, "optional": true }, + "node_modules/esbuild": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" + } + }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", @@ -12440,6 +12847,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/git-revision-webpack-plugin": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/git-revision-webpack-plugin/-/git-revision-webpack-plugin-5.0.0.tgz", @@ -19994,6 +20413,15 @@ "node": ">=4" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/resolve.exports": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", @@ -22438,6 +22866,25 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, + "node_modules/tsx": { + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.11.0.tgz", + "integrity": "sha512-vzGGELOgAupsNVssAmZjbUDfdm/pWP4R+Kg8TVdsonxbXk0bEpE1qh0yV6/QxUVXaVlNemgcPajGdJJ82n3stg==", + "dev": true, + "dependencies": { + "esbuild": "~0.20.2", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, "node_modules/ttf2eot": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/ttf2eot/-/ttf2eot-3.1.0.tgz", diff --git a/package.json b/package.json index 1184ff4cf..48139527f 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,8 @@ "gramjs:tl": "node ./src/lib/gramjs/tl/generateModules.js", "gramjs:lint": "eslint src/lib/gramjs --ext .ts,.tsx,.js", "gramjs:lint:fix": "npm run gramjs:lint -- --fix", + "lang:ts": "tsx ./dev/generateLangTypes.js", + "lang:initial": "tsx ./dev/generateInitialLangFallback.js", "icons:build": "fantasticon", "test": "cross-env APP_ENV=test jest --verbose --silent --forceExit", "test:playwright": "playwright test", @@ -124,6 +126,7 @@ "stylelint-high-performance-animation": "^1.10.0", "stylelint-selector-tag-no-without-class": "^3.0.1", "telegraph-node": "^1.0.4", + "tsx": "^4.11.0", "typescript": "^5.4.5", "webpack": "^5.91.0", "webpack-dev-server": "^5.0.4" diff --git a/public/compatTest.js b/public/compatTest.js index 8f6f31e1e..e5fd6f8d8 100644 --- a/public/compatTest.js +++ b/public/compatTest.js @@ -7,9 +7,12 @@ function compatTest() { var hasCssSupports = window.CSS && typeof window.CSS.supports === 'function'; var hasIntl = typeof window.Intl !== 'undefined'; var hasDisplayNames = hasIntl && typeof Intl.DisplayNames !== 'undefined'; + var hasPluralRules = hasIntl && typeof Intl.PluralRules !== 'undefined'; + var hasListFormat = hasIntl && typeof Intl.ListFormat !== 'undefined'; + var hasNumberFormat = hasIntl && typeof Intl.NumberFormat !== 'undefined'; var isCompatible = hasPromise && hasWebSockets && hasWebCrypto && hasObjectFromEntries && hasResizeObserver - && hasCssSupports && hasDisplayNames; + && hasCssSupports && hasDisplayNames && hasPluralRules && hasListFormat && hasNumberFormat; if (isCompatible || (window.localStorage && window.localStorage.getItem('tt-ignore-compat'))) { window.isCompatTestPassed = true; @@ -25,6 +28,9 @@ function compatTest() { console.warn('ResizeObserver', hasResizeObserver); console.warn('CSS.supports', hasCssSupports); console.warn('Intl.DisplayNames', hasDisplayNames); + console.warn('Intl.PluralRules', hasPluralRules); + console.warn('Intl.ListFormat', hasListFormat); + console.warn('Intl.NumberFormat', hasNumberFormat); } // Hardcoded page because server forbids iframe embedding diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index a62c73d94..9ddfb4109 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -64,6 +64,7 @@ declare module '*.png'; declare module '*.svg'; declare module '*.tgs'; declare module '*.wasm'; +declare module '*.strings'; declare module '*.txt' { const content: string; diff --git a/src/api/gramjs/apiBuilders/misc.ts b/src/api/gramjs/apiBuilders/misc.ts index dc0755ac5..b75100134 100644 --- a/src/api/gramjs/apiBuilders/misc.ts +++ b/src/api/gramjs/apiBuilders/misc.ts @@ -4,12 +4,15 @@ import type { ApiPrivacyKey } from '../../../types'; import type { ApiChatLink, ApiCollectionInfo, - ApiConfig, ApiCountry, ApiLangString, + ApiConfig, ApiCountry, ApiLanguage, ApiOldLangString, ApiPeerColors, ApiSession, ApiTimezone, ApiUrlAuthResult, ApiWallpaper, ApiWebSession, + LangPackStringValue, } from '../../types'; -import { buildCollectionByCallback, omit, pick } from '../../../util/iteratees'; +import { + buildCollectionByCallback, omit, omitUndefined, pick, +} from '../../../util/iteratees'; import { getServerTime } from '../../../util/serverTime'; import { addUserToLocalDb } from '../helpers'; import { omitVirtualClassFields } from './helpers'; @@ -225,14 +228,14 @@ export function buildApiConfig(config: GramJs.Config): ApiConfig { }; } -export function buildLangPack(mtpLangPack: GramJs.LangPackDifference) { - return mtpLangPack.strings.reduce>((acc, mtpString) => { - acc[mtpString.key] = buildLangPackString(mtpString); +export function oldBuildLangPack(mtpLangPack: GramJs.LangPackDifference) { + return mtpLangPack.strings.reduce>((acc, mtpString) => { + acc[mtpString.key] = oldBuildLangPackString(mtpString); return acc; }, {}); } -export function buildLangPackString(mtpString: GramJs.TypeLangPackString) { +export function oldBuildLangPackString(mtpString: GramJs.TypeLangPackString) { return mtpString instanceof GramJs.LangPackString ? mtpString.value : mtpString instanceof GramJs.LangPackStringPluralized @@ -240,6 +243,55 @@ export function buildLangPackString(mtpString: GramJs.TypeLangPackString) { : undefined; } +export function buildLangStrings(strings: GramJs.TypeLangPackString[]) { + const keysToRemove: string[] = []; + const apiStrings = strings.reduce>((acc, mtpString) => { + if (mtpString instanceof GramJs.LangPackStringDeleted) { + keysToRemove.push(mtpString.key); + } + + if (mtpString instanceof GramJs.LangPackString) { + acc[mtpString.key] = mtpString.value; + } + + if (mtpString instanceof GramJs.LangPackStringPluralized) { + acc[mtpString.key] = omitUndefined({ + zero: mtpString.zeroValue, + one: mtpString.oneValue, + two: mtpString.twoValue, + few: mtpString.fewValue, + many: mtpString.manyValue, + other: mtpString.otherValue, + }); + } + + return acc; + }, {}); + + return { + keysToRemove, + strings: apiStrings, + }; +} + +export function buildApiLanguage(lang: GramJs.TypeLangPackLanguage): ApiLanguage { + const { + name, nativeName, langCode, pluralCode, rtl, stringsCount, translatedCount, translationsUrl, beta, official, + } = lang; + return { + name, + nativeName, + langCode, + pluralCode, + isRtl: rtl, + isBeta: beta, + isOfficial: official, + stringsCount, + translatedCount, + translationsUrl, + }; +} + function buildApiPeerColorSet(colorSet: GramJs.help.TypePeerColorSet) { if (colorSet instanceof GramJs.help.PeerColorSet) { return colorSet.colors.map((color) => `#${color.toString(16).padStart(6, '0')}`); diff --git a/src/api/gramjs/methods/settings.ts b/src/api/gramjs/methods/settings.ts index de02e6db8..91bdadf8f 100644 --- a/src/api/gramjs/methods/settings.ts +++ b/src/api/gramjs/methods/settings.ts @@ -19,16 +19,19 @@ import { getServerTime } from '../../../util/serverTime'; import { buildAppConfig } from '../apiBuilders/appConfig'; import { buildApiChatFromPreview } from '../apiBuilders/chats'; import { buildApiPhoto, buildPrivacyRules } from '../apiBuilders/common'; -import { omitVirtualClassFields } from '../apiBuilders/helpers'; import { buildApiConfig, buildApiCountryList, + buildApiLanguage, buildApiNotifyException, buildApiPeerColors, buildApiSession, buildApiTimezone, buildApiWallpaper, - buildApiWebSession, buildLangPack, buildLangPackString, + buildApiWebSession, + buildLangStrings, + oldBuildLangPack, + oldBuildLangPackString, } from '../apiBuilders/misc'; import { getApiChatIdFromMtpPeer } from '../apiBuilders/peers'; import { buildApiUser } from '../apiBuilders/users'; @@ -429,6 +432,57 @@ export function updateNotificationSettings(peerType: 'contact' | 'group' | 'broa })); } +export async function fetchLangPack({ + langPack, + langCode, +}: { + langPack: string; + langCode: string; +}) { + const result = await invokeRequest(new GramJs.langpack.GetLangPack({ + langPack, + langCode, + })); + if (!result) { + return undefined; + } + + const { strings, keysToRemove } = buildLangStrings(result.strings); + + return { + version: result.version, + strings, + keysToRemove, + }; +} + +export async function fetchLangDifference({ + langPack, + langCode, + fromVersion, +}: { + langPack: string; + langCode: string; + fromVersion: number; +}) { + const result = await invokeRequest(new GramJs.langpack.GetDifference({ + langPack, + langCode, + fromVersion, + })); + if (!result) { + return undefined; + } + + const { strings, keysToRemove } = buildLangStrings(result.strings); + + return { + version: result.version, + strings, + keysToRemove, + }; +} + export async function fetchLanguages(): Promise { const result = await invokeRequest(new GramJs.langpack.GetLanguages({ langPack: DEFAULT_LANG_PACK, @@ -437,10 +491,28 @@ export async function fetchLanguages(): Promise { return undefined; } - return result.map(omitVirtualClassFields); + return result.map(buildApiLanguage); } -export async function fetchLangPack({ sourceLangPacks, langCode }: { +export async function fetchLanguage({ + langPack, + langCode, +}: { + langPack: string; + langCode: string; +}): Promise { + const result = await invokeRequest(new GramJs.langpack.GetLanguage({ + langPack, + langCode, + })); + if (!result) { + return undefined; + } + + return buildApiLanguage(result); +} + +export async function oldFetchLangPack({ sourceLangPacks, langCode }: { sourceLangPacks: typeof LANG_PACKS; langCode: string; }) { @@ -451,7 +523,7 @@ export async function fetchLangPack({ sourceLangPacks, langCode }: { })); })); - const collections = results.filter(Boolean).map(buildLangPack); + const collections = results.filter(Boolean).map(oldBuildLangPack); if (!collections.length) { return undefined; } @@ -459,7 +531,7 @@ export async function fetchLangPack({ sourceLangPacks, langCode }: { return { langPack: Object.assign({}, ...collections.reverse()) as typeof collections[0] }; } -export async function fetchLangStrings({ langPack, langCode, keys }: { +export async function oldFetchLangStrings({ langPack, langCode, keys }: { langPack: string; langCode: string; keys: string[]; }) { const result = await invokeRequest(new GramJs.langpack.GetStrings({ @@ -472,7 +544,7 @@ export async function fetchLangStrings({ langPack, langCode, keys }: { return undefined; } - return result.map(buildLangPackString); + return result.map(oldBuildLangPackString); } export async function fetchPrivacySettings(privacyKey: ApiPrivacyKey) { diff --git a/src/api/types/settings.ts b/src/api/types/settings.ts index 77a63a86e..0d182961b 100644 --- a/src/api/types/settings.ts +++ b/src/api/types/settings.ts @@ -1,7 +1,7 @@ export interface ApiLanguage { - official?: true; - rtl?: true; - beta?: true; + isOfficial?: true; + isRtl?: true; + isBeta?: true; name: string; nativeName: string; langCode: string; @@ -12,7 +12,7 @@ export interface ApiLanguage { translationsUrl: string; } -export type ApiLangString = string | { +export type ApiOldLangString = string | { zeroValue?: string; oneValue?: string; twoValue?: string; @@ -21,4 +21,30 @@ export type ApiLangString = string | { otherValue?: string; }; -export type ApiLangPack = Record; +export type ApiOldLangPack = Record; + +export type LangPack = { + langCode: string; + version: number; + strings: Record; +}; + +export type CachedLangData = { + langPack: LangPack; + language: ApiLanguage; +}; + +export type LangPackStringValueRegular = string; +export type LangPackStringValueDeleted = { + isDeleted: true; +}; +export type LangPackStringValuePlural = { + zero?: string; + one?: string; + two?: string; + few?: string; + many?: string; + other: string; +}; + +export type LangPackStringValue = LangPackStringValueRegular | LangPackStringValueDeleted | LangPackStringValuePlural; diff --git a/src/assets/localization/fallback.strings b/src/assets/localization/fallback.strings new file mode 100644 index 000000000..763cf52d5 --- /dev/null +++ b/src/assets/localization/fallback.strings @@ -0,0 +1,1271 @@ +"Month1" = "January"; +"Month2" = "February"; +"Month3" = "March"; +"Month4" = "April"; +"Month5" = "May"; +"Month6" = "June"; +"Month7" = "July"; +"Month8" = "August"; +"Month9" = "September"; +"Month10" = "October"; +"Month11" = "November"; +"Month12" = "December"; +"GroupLeaveGroup" = "Leave Group"; +"DeleteChatUser" = "Delete chat"; +"AccDescrGroup" = "Group"; +"AccDescrChannel" = "Channel"; +"ChatServiceGroupUpdatedPinnedMessage1" = "{user} pinned \"{message}\""; +"MessagePinnedGenericMessage" = "{user} pinned a message"; +"Nothing" = "Nothing"; +"UserTyping" = "{user} is typing"; +"SendActionRecordVideo" = "recording a video"; +"SendActionUploadVideo" = "sending a video"; +"SendActionRecordAudio" = "recording a voice message"; +"SendActionUploadAudio" = "sending a voice message"; +"SendActionUploadPhoto" = "sending a photo"; +"SendActionUploadFile" = "sending a file"; +"PlayingGame" = "playing a game"; +"SendActionRecordRound" = "recording a video message"; +"SendActionUploadRound" = "sending a video message"; +"SendActionChooseSticker" = "choosing a sticker"; +"UserActionWatchingAnimations" = "watching {emoji}"; +"SetUrlAvailable" = "{url} is available."; +"SetUrlInUse" = "Sorry, this link is already taken."; +"UsernameAvailable" = "{username} is available."; +"UsernameInUse" = "Sorry, this username is already taken."; +"CreateGroupError" = "Sorry, you can\'t create a group with these users because of their privacy settings."; +"PasscodeControllerErrorCurrent" = "invalid passcode"; +"LimitReachedChatInFolders" = "Sorry, you can\'t add more than **{limit}** chats to a folder. You can increase this limit to **{limit2}** by subscribing to **Telegram Premium**."; +"LimitReachedFileSize" = "The document can’t be sent, because it is larger than **{limit}**. You can double this limit to **{limit2}** per document by subscribing to **Telegram Premium**."; +"LimitReachedFolders" = "You have reached the limit of **{limit}** folders. You can double the limit to **{limit2}** folders by subscribing to **Telegram Premium**."; +"LimitReachedPinDialogs" = "You can\'t pin more than {limit} chats to the top. Unpin some that are currently pinned – or subscribe to **Telegram Premium** to double the limit to **{limit2}** chats."; +"LimitReachedPublicLinks" = "You have reserved too many public links. Try revoking the link from an older group or channel, or subscribe to **Telegram Premium** to double the limit to **{limit2}** public links."; +"LimitReachedCommunities" = "You are a member of **{limit}** groups and channels. Please leave some before joining a new one — or subscribe to **Telegram Premium** to double the limit to **{limit2}** groups and channels."; +"LimitReachedChatInFoldersLocked" = "Sorry, you can't add more than **{limit}** chats to a folder. Please create a new one. We are working to let you increase this limit in the future."; +"LimitReachedFileSizeLocked" = "The document can’t be sent, because it is larger than **{limit}**. We are working to let you increase this limit in the future."; +"LimitReachedFoldersLocked" = "You have reached the limit of **{limit}** folders for this account. We are working to let you increase this limit in the future."; +"LimitReachedPinDialogsLocked" = "Sorry, you can't pin more than {limit} chats to the top. Unpin some that are currently pinned. We are working to let you increase this limit in the future."; +"LimitReachedPublicLinksLocked" = "You have reserved too many public links. Try revoking the link from an older group or channel. We are working to let you increase this limit in the future."; +"LimitReachedCommunitiesLocked" = "You are a member of **{limit}** groups and channels. Please leave some before joining a new one. We are working to let you increase this limit in the future."; +"LimitReachedChatInFoldersPremium" = "Sorry, you can't add more than **{limit}** chats to a folder. Please create a new one."; +"LimitReachedFileSizePremium" = "The document can't be sent, because it is larger than **{limit}**."; +"LimitReachedFoldersPremium" = "You have reached the limit of **{limit}** folders for this account."; +"LimitReachedPinDialogsPremium" = "Sorry, you can\'t pin more than {limit} chats to the top. Unpin some that are currently pinned."; +"LimitReachedPublicLinksPremium" = "You have reserved too many public links. Try revoking the link from an older group or channel."; +"LimitReachedCommunitiesPremium" = "You are a member of **{limit}** groups and channels. Please leave some before joining a new one."; +"PremiumPreviewLimits" = "Doubled Limits"; +"PremiumPreviewReactions" = "Unique Reactions"; +"PremiumPreviewStickers" = "Premium Stickers"; +"PremiumPreviewNoAds" = "No Ads"; +"PremiumPreviewVoiceToText" = "Voice-to-Text Conversion"; +"PremiumPreviewProfileBadge" = "Profile Badge"; +"PremiumPreviewDownloadSpeed" = "Faster Download Speed"; +"PremiumPreviewUploads" = "Unlimited Cloud Storage"; +"PremiumPreviewAdvancedChatManagement" = "Advanced Chat Management"; +"PremiumPreviewAnimatedProfiles" = "Animated Profile Pictures"; +"PremiumPreviewLimitsDescription" = "Up to {limit1} channels, {limit2} folders, {limit3} pins, {limit4} public links, {limit5} accounts and more."; +"PremiumPreviewReactionsDescription" = "Additional animated reactions on messages, available only to Premium subscribers."; +"PremiumPreviewStickersDescription" = "Exclusive enlarged stickers featuring additional effects, updated monthly."; +"PremiumPreviewNoAdsDescription" = "No more ads in public channels where Telegram sometimes shows ads."; +"PremiumPreviewVoiceToTextDescription" = "Ability to read the transcript of any incoming voice message."; +"PremiumPreviewProfileBadgeDescription" = "An exclusive badge next to your name showing that you subscribe to Telegram Premium."; +"PremiumPreviewDownloadSpeedDescription" = "No more limits on the speed with which media and documents are downloaded."; +"PremiumPreviewUploadsDescription" = "4 GB per each document, unlimited storage for your chats and media overall."; +"PremiumPreviewAdvancedChatManagementDescription" = "Tools to set the default folder, auto-archive and hide new chats from non-contacts."; +"PremiumPreviewAnimatedProfilesDescription" = "Video avatars animated in chat lists and chats to allow for additional self-expression."; +"SendMessage" = "Send Message"; +"ConversationDefaultRestrictedMedia" = "Sending media isn't allowed in this group."; +"AccDescrVoiceMessage" = "Record voice message"; +"BotSettings" = "Settings"; +"Privacy" = "Privacy Settings"; +"BotHelp" = "Help"; +"ContextCopyImage" = "Copy Image"; +"ContextCopyMessageLink" = "Copy Message Link"; +"ProfileCopyPhone" = "Copy Phone Number"; +"ContextCopySelected" = "Copy Selected Text"; +"ContextCopyText" = "Copy Text"; +"CallMessageVideoIncomingDeclined" = "Declined Video Call"; +"CallMessageVideoOutgoingMissed" = "Canceled Video Call"; +"CallMessageVideoIncomingMissed" = "Missed Video Call"; +"CallMessageVideoOutgoing" = "Outgoing Video Call"; +"CallMessageVideoIncoming" = "Incoming Video Call"; +"CallMessageIncomingDeclined" = "Declined Call"; +"CallMessageOutgoingMissed" = "Canceled Call"; +"CallMessageIncomingMissed" = "Missed Call"; +"CallMessageOutgoing" = "Outgoing Call"; +"CallMessageIncoming" = "Incoming Call"; +"FinalResults" = "Final Results"; +"QuizPoll" = "Quiz"; +"AnonymousQuizPoll" = "Anonymous Quiz"; +"PublicPoll" = "Poll"; +"AnonymousPoll" = "Anonymous Poll"; +"AccDescrReactionMentionDown" = "Go to next unread reactions"; +"AccDescrMentionDown" = "Go to next mention"; +"AccDescrPageDown" = "Go to bottom"; +"ChannelPrivate" = "Private Channel"; +"ChannelPrivateInfo" = "Private channels can only be joined via invite link."; +"ChannelPublic" = "Public Channel"; +"ChannelPublicInfo" = "Public channels can be found in search, anyone can join them."; +"MegaPrivate" = "Private Group"; +"MegaPrivateInfo" = "Private groups can only be joined if you were invited or have an invite link."; +"MegaPublic" = "Public Group"; +"MegaPublicInfo" = "Public groups can be found in search, chat history is available to everyone and anyone can join."; +"ChannelType" = "Channel Type"; +"GroupType" = "Group Type"; +"ChannelPrivateLinkHelp" = "People can join your channel by following this link. You can revoke the link at any time."; +"MegaPrivateLinkHelp" = "People can join your group by following this link. You can revoke the link at any time."; +"ChannelUsernameCreatePublicLinkHelp" = "If you set a public link, other people will be able to find and join your channel.\n\nYou can use a–z, 0–9 and underscores.\nMinimum length is 5 characters."; +"GroupUsernameCreatePublicLinkHelp" = "People can share this link with others and find your group using Telegram search."; +"UserRestrictionsNoSend" = "can\'t send messages"; +"UserRestrictionsNoSendMedia" = "no media"; +"UserRestrictionsNoSendStickers" = "no stickers & GIFs"; +"UserRestrictionsNoEmbedLinks" = "no embed links"; +"UserRestrictionsNoSendPolls" = "no polls"; +"UserRestrictionsNoChangeInfo" = "can\'t change Info"; +"UserRestrictionsInviteUsers" = "Add Users"; +"UserRestrictionsPinMessages" = "Pin Messages"; +"StatsMessageInteractionsTitle" = "INTERACTIONS"; +"StatsGroupGrowthTitle" = "GROWTH"; +"StatsGroupMembersTitle" = "GROUP MEMBERS"; +"StatsGroupLanguagesTitle" = "MEMBERS' PRIMARY LANGUAGE"; +"StatsGroupMessagesTitle" = "MESSAGES"; +"StatsGroupActionsTitle" = "ACTIONS"; +"StatsGroupTopHoursTitle" = "TOP HOURS"; +"ChannelStatsGraphGrowth" = "GROWTH"; +"ChannelStatsGraphFollowers" = "FOLLOWERS"; +"ChannelStatsGraphNotifications" = "NOTIFICATIONS"; +"ChannelStatsGraphViewsByHours" = "VIEWS BY HOURS (UTC)"; +"ChannelStatsGraphViewsBySource" = "VIEWS BY SOURCE"; +"ChannelStatsGraphNewFollowersBySource" = "FOLLOWERS BY SOURCE"; +"ChannelStatsGraphLanguage" = "LANGUAGES"; +"ChannelStatsGraphInteractions" = "INTERACTIONS"; +"StatsMessageViews" = "Views"; +"StatsMessagePrivateShares" = "Private Shares"; +"StatsMessagePublicShares" = "Public Shares"; +"StatsGroupMembers" = "Members"; +"StatsGroupMessages" = "Messages"; +"StatsGroupViewers" = "Viewing Members"; +"StatsGroupPosters" = "Posting Members"; +"ChannelStatsOverviewFollowers" = "Followers"; +"ChannelStatsOverviewEnabledNotifications" = "Enabled Notifications"; +"ChannelStatsOverviewViewsPerPost" = "Views Per Post"; +"ChannelStatsOverviewSharesPerPost" = "Shares Per Post"; +"WrongNumber" = "Wrong number?"; +"SentAppCode" = "We\'ve sent the code to the **Telegram** app on your other device."; +"LoginJustSentSms" = "We've sent you a code via SMS. Please enter it above."; +"Code" = "Code"; +"LoginHeaderPassword" = "Enter Password"; +"LoginEnterPasswordDescription" = "You have Two-Step Verification enabled, so your account is protected with an additional password."; +"StartText" = "Please confirm your country code\nand enter your phone number."; +"LoginPhonePlaceholder" = "Your phone number"; +"LoginNext" = "Next"; +"LoginQRLogin" = "Log in by QR Code"; +"LoginQRTitle" = "Log in to Telegram by QR Code"; +"LoginQRHelp1" = "Open Telegram on your phone"; +"LoginQR2Help2" = "Go to **Settings** > **Devices** > **Link Desktop Device**"; +"LoginQRHelp3" = "Point your phone at this screen to confirm login"; +"LoginQRCancel" = "Log in by phone Number"; +"YourName" = "Your Name"; +"LoginRegisterDesc" = "Enter your name and add a profile photo."; +"LoginRegisterFirstNamePlaceholder" = "First Name"; +"LoginRegisterLastNamePlaceholder" = "Last Name"; +"Next" = "Next"; +"LoginSelectCountryTitle" = "Country"; +"CountryNone" = "Country not found"; +"VoipGroupVoiceChat" = "Video Chat"; +"AccDescrMoreOptions" = "More options"; +"AccExitFullscreen" = "Exit fullscreen"; +"AccSwitchToFullscreen" = "Switch to fullscreen"; +"VoipChatStopScreenCapture" = "Stop sharing screen"; +"VoipChatStartScreenCapture" = "Share screen"; +"VoipGroupLeaveAlertEndChat" = "End video chat"; +"VoipSpeaker" = "Speaker"; +"VoipCamera" = "Camera"; +"VoipGroupLeave" = "Leave"; +"VoipGroupEndAlertTitle" = "End video chat"; +"VoipGroupLeaveAlertTitle" = "Leave video chat"; +"VoipGroupEndAlertText" = "Are you sure you want to end this video chat?"; +"VoipGroupLeaveAlertText" = "Are you sure you want to leave this video chat?"; +"VoipGroupEndChat" = "End video chat"; +"VoipGroupEnd" = "End"; +"Cancel" = "Cancel"; +"ThisIsYou" = "this is you"; +"VoipGroupMutedForMe" = "muted for you"; +"WantsToSpeak" = "wants to speak"; +"SpeakingWithVolume" = "{volume}% speaking"; +"Speaking" = "speaking"; +"Listening" = "listening"; +"VoipGroupInviteMember" = "Invite Members"; +"VoipGroupCancelRaiseHand" = "Cancel request to speak"; +"VoipGroupOpenProfile" = "Open Profile"; +"VoipGroupAllowToSpeak" = "Allow to speak"; +"VoipMute" = "Mute"; +"VoipGroupUnmuteForMe" = "Unmute for me"; +"VoipGroupMuteForMe" = "Mute for me"; +"VoipGroupUserRemove" = "Remove"; +"Back" = "Back"; +"Participants_one" = "{count} participant"; +"Participants_other" = "{count} participants"; +"VoipChatJoin" = "Join"; +"CallStatusHanging" = "hanging up..."; +"CallStatusRequesting" = "requesting..."; +"CallStatusRinging" = "ringing..."; +"CallStatusIncoming" = "is calling you..."; +"CallStatusWaiting" = "waiting..."; +"CallStatusExchanging" = "exchanging encryption keys..."; +"CallEmojiKeyTooltip" = "If the emoji on {user}’s screen are the same, this call is 100% secure."; +"CallMuteAudio" = "Mute"; +"CallUnmuteAudio" = "Unmute"; +"CallStopVideo" = "Stop Video"; +"CallStartVideo" = "Start Video"; +"VoipFlip" = "Flip"; +"CallScreencast" = "Screencast"; +"CallAccept" = "Accept"; +"CallDecline" = "Decline"; +"CallEndCall" = "End Call"; +"CallRateLabel" = "Please rate the quality of your call"; +"CallRateComment" = "Comment (optional)"; +"Send" = "Send"; +"SponsoredMessageInfo" = "What are sponsored\nmessages?"; +"SponsoredMessageInfoDescription1" = "Unlike other apps, Telegram never uses your private data to target ads. Sponsored messages on Telegram are based solely on the topic of the public channels in which they are shown. This means that no user data is mined or analyzed to display ads, and every user viewing a channel on Telegram sees the same sponsored messages."; +"SponsoredMessageInfoDescription2" = "Unlike other apps, Telegram doesn\'t track whether you tapped on a sponsored message and doesn\'t profile you based on your activity. We also prevent external links in sponsored messages to ensure that third parties can’t spy on our users. We believe that everyone has the right to privacy, and technological platforms should respect that."; +"SponsoredMessageInfoDescription3" = "Telegram offers a free and unlimited service to hundreds of millions of users, which involves significant server and traffic costs. In order to remain independent and stay true to its values, Telegram developed a paid tool to promote messages with user privacy in mind. We welcome responsible advertisers at:"; +"SponsoredMessageAlertLearnMoreUrl" = "https://ads.telegram.org"; +"SponsoredMessageInfoDescription4" = "Sponsored Messages are currently in test mode. Once they are fully launched and allow Telegram to cover its basic costs, we will start sharing ad revenue with the owners of public channels in which sponsored messages are displayed.\n\nOnline ads should no longer be synonymous with abuse of user privacy. Let us redefine how a tech company should operate – together."; +"Close" = "Close"; +"ConversationScheduleMessageSendToday" = "Send today at {time}"; +"ConversationScheduleMessageSendOn" = "Send on {date} at {time}"; +"Phone" = "Phone"; +"Username" = "Username"; +"UserBio" = "Bio"; +"Info" = "Info"; +"SetUrlPlaceholder" = "Link"; +"Notifications" = "Notifications"; +"SavedMessagesInfo" = "Forward here to save"; +"BlockedListNotFound" = "No users found."; +"TextCopied" = "Text copied to clipboard."; +"Copy" = "Copy"; +"ChatListDeleteAndLeaveGroupConfirmation" = "Are you sure you want to leave and delete {chat}?"; +"ChannelLeaveAlertWithName" = "Are you sure you want to leave **{chat}**?"; +"ChatListDeleteChatConfirmation" = "Are you sure you want to delete the chat\nwith {chat}?"; +"DeleteAndStop" = "Delete and Block"; +"ChatListDeleteForEveryone" = "Delete for me and {user}"; +"DeleteForAll" = "Delete for all members"; +"DeleteSingleMessagesTitle" = "Delete message"; +"AreYouSureDeleteSingleMessage" = "Are you sure you want to delete this message?"; +"DeleteForMeChatHint_one" = "This will delete it just for you, not for other participants of the chat."; +"DeleteForMeChatHint_other" = "This will delete them just for you, not for other participants of the chat."; +"DeleteForEveryoneHint_one" = "This will delete it for everyone in this chat."; +"DeleteForEveryoneHint_other" = "This will delete them for everyone in this chat."; +"ConversationDeleteMessagesFor" = "Delete for me and {user}"; +"ConversationDeleteMessagesForEveryone" = "Delete for everyone"; +"ChatListDeleteForCurrentUser" = "Delete just for me"; +"Delete" = "Delete"; +"FakeMessage" = "FAKE"; +"ScamMessage" = "SCAM"; +"SendWithoutSound" = "Send Without Sound"; +"SetReminder" = "Set a Reminder"; +"ScheduleMessage" = "Schedule Message"; +"Updating" = "Updating..."; +"OnlineCount_one" = "{count} online"; +"OnlineCount_other" = "{count} online"; +"Subscribers_one" = "{count} subscriber"; +"Subscribers_other" = "{count} subscribers"; +"NMembers_one" = "{count} member"; +"NMembers_other" = "{count} members"; +"SelectChat" = "Select Chat"; +"PinMessageAlertChannel" = "Do you want to pin this message in this channel?"; +"PinMessageAlert" = "Pin this message in the group?"; +"PinMessageAlertChat" = "Do you want to pin this message to the top of the chat?"; +"PinMessageAlertTitle" = "Pin message"; +"DialogPin" = "Pin"; +"ConversationPinMessagesFor" = "Pin for me and {user}"; +"ConversationPinMessageAlertPinAndNotifyMembers" = "Pin and notify all members"; +"SavedMessages" = "Saved Messages"; +"AccDescrPrevious" = "Previous"; +"ReportReasonSpam" = "Spam"; +"ReportReasonViolence" = "Violence"; +"ReportReasonPornography" = "Pornography"; +"ReportReasonChildAbuse" = "Child Abuse"; +"ReportPeerReasonCopyright" = "Copyright"; +"ReportReasonOther" = "Other"; +"ReportMessageTitle" = "Report message"; +"ReportPeerReport" = "Report"; +"ReportReasonDescription" = "Description"; +"ReportButton" = "Report"; +"StickersRemoveFromFavorites" = "Remove from Favorites"; +"StickersAddToFavorites" = "Add to Favorites"; +"ViewPackPreview" = "View Sticker Set"; +"DeleteFromRecent" = "Remove from Recent"; +"AccDescrStickerSet" = "Sticker set"; +"ChatPanelUnpinAllMessages" = "Unpin All Messages"; +"ChatUnpinAllMessagesConfirmation_one" = "Do you want to unpin {count} message in this chat?"; +"ChatUnpinAllMessagesConfirmation_other" = "Do you want to unpin all {count} messages in this chat?"; +"DialogUnpin" = "Unpin"; +"ArchivedChats" = "Archived Chats"; +"FilterAddTo" = "Add to folder"; +"Draft" = "Draft"; +"FilterAllChatsShort" = "All"; +"FilterAllChats" = "All Chats"; +"CreateNewContact" = "Create New Contact"; +"FilterNoChatsToDisplay" = "Folder is empty"; +"ChatListEmptyChatListFilterText" = "No chats currently belong to this folder."; +"ChatEmptyChat" = "No messages here yet"; +"ChatListEmptyChatListEditFilter" = "Edit Folder"; +"UpdateTelegram" = "Update Telegram"; +"AccDescrOpenMenu2" = "Open menu"; +"SettingsTipsUsername" = "TelegramTips"; +"SearchFriends" = "Search contacts"; +"Search" = "Search"; +"Contacts" = "Contacts"; +"Settings" = "Settings"; +"MenuNightMode" = "Night Mode"; +"SettingsDisableNightTheme" = "Disable night mode"; +"SettingsEnableNightTheme" = "Enable night mode"; +"TelegramPremium" = "Telegram Premium"; +"New" = "New"; +"TelegramFeatures" = "Telegram Features"; +"ShortcutsControllerOthersLockByPasscode" = "Lock by Passcode"; +"GroupAddMembers" = "Add Members"; +"SendMessageTo" = "Send message to…"; +"NewChannel" = "New Channel"; +"NewGroup" = "New Group"; +"AddPhoto" = "Set Profile Photo"; +"EnterChannelName" = "Channel name"; +"GroupName" = "Group name"; +"DescriptionOptionalPlaceholder" = "Description (optional)"; +"DescriptionInfo" = "You can provide an optional description for your channel."; +"GroupInfoParticipantCount_one" = "1 member"; +"GroupInfoParticipantCount_other" = "{count} members"; +"ChannelIntroCreateChannel" = "Create Channel"; +"NewMessageTitle" = "New Message"; +"ChatListSearchNoResults" = "No Results"; +"ChatListSearchNoResultsDescription" = "There were no results.\nTry a new search."; +"ChatListSearchShowLess" = "Show Less"; +"ChatListSearchShowMore" = "Show More"; +"DialogListSearchSectionDialogs" = "Chats and Contacts"; +"DialogListSearchSectionGlobal" = "Global Search"; +"SearchMessages" = "Messages"; +"Recent" = "Recent"; +"BlockedUsersBlockUser" = "Block User..."; +"FilterChatTypes" = "Chat types"; +"FilterChats" = "Chats"; +"FilterIncludeInfo" = "Choose chats or types of chats that will appear in this folder."; +"FilterNameHint" = "Folder name"; +"FilterInclude" = "Included Chats"; +"FilterAddChats" = "Add Chats"; +"FilterExclude" = "Excluded Chats"; +"CreateNewFilterInfo" = "Create folders for different groups of chats and quickly switch between them."; +"CreateNewFilter" = "Create New Folder"; +"Filters" = "Chat Folders"; +"FilterRecommended" = "Recommended Folders"; +"Add" = "Add"; +"EnterNewPasscode" = "Enter new passcode"; +"Continue" = "Continue"; +"ReEnterYourPasscode" = "Re-enter your new passcode"; +"PasscodeControllerCurrentPlaceholder" = "Enter current passcode"; +"PleaseEnterNewFirstPassword" = "Enter a new password"; +"PasscodeControllerReEnterPasscodePlaceholder" = "Re-enter new passcode"; +"PasscodeChange" = "Change passcode"; +"PasscodeTurnOff" = "Turn Passcode Off"; +"EnablePasscode" = "Enable Passcode"; +"SessionPreviewTitle" = "Session"; +"SessionPreviewTerminateSession" = "Terminate Session"; +"PrivacySettingsLastSeen" = "Last Seen"; +"SessionPreviewApp" = "Application"; +"SessionPreviewIp" = "IP Address"; +"SessionPreviewLocation" = "Location"; +"SessionPreviewIpDesc" = "This location estimate is based on the IP address and may not always be accurate."; +"AuthSessionsViewAcceptTitle" = "Accept on This Device"; +"SessionPreviewAcceptSecret" = "New Secret Chats"; +"SessionPreviewAcceptCalls" = "Incoming Calls"; +"Weeks_one" = "{count} week"; +"Weeks_other" = "{count} weeks"; +"Months_one" = "{count} month"; +"Months_other" = "{count} months"; +"AuthSessionsCurrentSession" = "THIS DEVICE"; +"TerminateAllSessions" = "Terminate All Other Sessions"; +"OtherSessions" = "Active sessions"; +"TerminateOldSessionHeader" = "Automatically terminate old sessions"; +"IfInactiveFor" = "If inactive for"; +"AreYouSureSessions" = "Are you sure you want to terminate all other sessions?"; +"WebSessionsTitle" = "Logged In with Telegram"; +"AuthSessionsLogOut" = "Log Out"; +"AuthSessionsViewBrowser" = "Browser"; +"AuthSessionsViewLocationInfo" = "This location estimate is based on the IP address and may not always be accurate."; +"AuthSessionsLogOutApplications" = "Disconnect All Websites"; +"ClearOtherWebSessionsHelp" = "You can log in on websites that support signing in with Telegram."; +"AreYouSureWebSessions" = "Are you sure you want to disconnect all websites where you logged in with Telegram?"; +"AutodownloadSizeLimitUpTo" = "up to {limit}"; +"FileSizeMB" = "{count} MB"; +"AutoDownloadMaxFileSize" = "Maximum file size"; +"AutoDownloadSettingsContacts" = "Contacts"; +"AutoDownloadSettingsPrivateChats" = "Other Private Chats"; +"AutoDownloadSettingsGroupChats" = "Group Chats"; +"AutoDownloadSettingsChannels" = "Channels"; +"AutoDownloadPhotosTitle" = "Auto-download photos"; +"AutoDownloadVideosTitle" = "Auto-download videos and GIFs"; +"AutoDownloadFilesTitle" = "Auto-download files"; +"AutoplayMedia" = "Autoplay media"; +"GifsTab2" = "GIFs"; +"DataAndStorageAutoplayVideos" = "Videos"; +"FirstName" = "First name (required)"; +"LastName" = "Last name"; +"SettingsAboutBio" = "Any details such as age, occupation or city.\nExample: 23 y.o. designer from San Francisco"; +"UsernameHelp" = "You can choose a username on **Telegram**. If you do, people will be able to find you by this username and contact you without knowing your phone number.\n\nYou can use **a–z**, **0–9** and underscores.\nMinimum length is **5** characters."; +"UsernameLink" = "This link opens a chat with you:"; +"SettingsExperimentalAbout" = "Warning! Those are experimental settings. Some may not work. Others may break the app. Any of them may disappear in the next version without a trace. Use at your own risk."; +"EmptyChatAppearanceLight" = "Light"; +"EmptyChatAppearanceDark" = "Dark"; +"EmptyChatAppearanceSystem" = "System"; +"SettingsSendEnter" = "Send with Enter"; +"SettingsSendCmdenter" = "Send with Cmd+Enter"; +"SettingsSendCtrlenter" = "Send with Ctrl+Enter"; +"TextSize" = "Message Font Size"; +"ChatBackground" = "Chat Wallpaper"; +"Theme" = "Theme"; +"VoiceOverKeyboard" = "Keyboard"; +"AccDescrStickers" = "Stickers"; +"DoubleTapSetting" = "Quick Reaction"; +"SuggestStickers" = "Sticker suggestions by emoji"; +"LoopAnimatedStickers" = "Loop Animated Stickers"; +"UploadImage" = "Upload image"; +"SetColor" = "Set a color"; +"ThemeResetToDefaults" = "Reset to default"; +"BackgroundBlurred" = "Blurred"; +"SettingsInformation" = "Edit profile"; +"General" = "General"; +"DataSettings" = "Data and Storage"; +"PrivacySettings" = "Privacy and Security"; +"Language" = "Language"; +"SettingsExperimental" = "Experimental settings"; +"PrivacyPhone" = "Phone Number"; +"PrivacyLastSeen" = "Last Seen & Online"; +"PrivacyProfilePhoto" = "Profile Photo"; +"PrivacyForwards" = "Forwarded Messages"; +"AutodownloadGroupChats" = "Group Chats"; +"AlwaysShareWith" = "Always Share With"; +"NeverShareWith" = "Never Share With"; +"SessionsTitle" = "Active Sessions"; +"OtherWebSessions" = "Connected Websites"; +"BlockedUsers" = "Blocked Users"; +"TwoStepVerification" = "Two-Step Verification"; +"PleaseEnterCurrentPassword" = "Enter your password"; +"PleaseReEnterPassword" = "Re-enter your password"; +"PasswordHint" = "Password Hint"; +"RecoveryEmailTitle" = "Recovery Email"; +"TwoStepVerificationPasswordSet" = "Password Set!"; +"Passcode" = "Passcode Lock"; +"PasscodeControllerDisableTitle" = "Disable Passcode"; +"PasscodeControllerChangeTitle" = "Change Passcode"; +"FilterNew" = "New Folder"; +"FilterEdit" = "Edit folder"; +"AutoDeleteConfirm" = "Confirm"; +"LogOutTitle" = "Log Out"; +"AccDescrGoBack" = "Go back"; +"SureLogout" = "Are you sure you want to log out?"; +"AccountSettingsLogout" = "Log Out"; +"TelegramGeneralSettingsViewController" = "General Settings"; +"UserInfoNotificationsEnabled" = "Enabled"; +"UserInfoNotificationsDisabled" = "Disabled"; +"AutodownloadPrivateChats" = "Private Chats"; +"NotificationsForPrivateChats" = "Notifications for private chats"; +"MessagePreview" = "Message Preview"; +"FilterGroups" = "Groups"; +"NotificationsForGroups" = "Notifications for groups"; +"FilterChannels" = "Channels"; +"NotificationsForChannels" = "Notifications for channels"; +"PhoneOther" = "Other"; +"ContactJoined" = "Contact joined Telegram"; +"P2PEverybody" = "Everybody"; +"P2PContacts" = "My Contacts"; +"P2PNobody" = "Nobody"; +"Users_one" = "{count} user"; +"Users_other" = "{count} users"; +"PrivacySettingsWebSessions" = "Active Websites"; +"PasswordOn" = "On"; +"PasswordOff" = "Off"; +"PrivacyTitle" = "Privacy"; +"PrivacyPhoneTitle" = "Who can see my phone number?"; +"LastSeenTitle" = "Who can see your Last Seen time?"; +"PrivacyProfilePhotoTitle" = "Who can see my profile photos?"; +"WhoCanCallMe" = "Who can call me"; +"PrivacyP2P" = "Peer-to-Peer Calls"; +"PrivacyForwardsTitle" = "Who can add a link to my account when forwarding my messages?"; +"WhoCanAddMe" = "Who can add me to group chats?"; +"NewChatsFromNonContacts" = "New chats from unknown users"; +"ArchiveAndMute" = "Archive and Mute"; +"ArchiveAndMuteInfo" = "Automatically archive and mute new chats, groups and channels from non-contacts."; +"SettingsSensitiveTitle" = "Sensitive content"; +"SettingsSensitiveDisableFiltering" = "Disable filtering"; +"SettingsSensitiveAbout" = "Display sensitive media in public channels on all your Telegram devices."; +"BlockedUsersInfo" = "Blocked users can\'t send you messages or add you to groups. They will not see your profile pictures, online and last seen status."; +"NoBlocked" = "No blocked users yet"; +"BlockContact" = "Block"; +"CustomHelp" = "You won\'t see Last Seen or Online statuses for people with whom you don\'t share yours. Approximate times will be shown instead (recently, within a week, within a month)."; +"PrivacyExceptions" = "Exceptions"; +"AlwaysAllow" = "Always Allow"; +"EditAdminAddUsers" = "Add Users"; +"NeverAllow" = "Never Allow"; +"AlwaysAllowPlaceholder" = "Always allow..."; +"NeverAllowPlaceholder" = "Never allow..."; +"StickerPackStickerCount_one" = "1 sticker"; +"StickerPackStickerCount_other" = "{count} stickers"; +"PleaseEnterPassword" = "Enter your new password"; +"PasswordHintPlaceholder" = "Hint"; +"TwoStepVerificationPasswordSetInfo" = "This password will be required when you log in on a new device in addition to the code you get in the SMS."; +"TwoStepVerificationPasswordReturnSettings" = "Return to Settings"; +"YourEmailCode" = "Your Email Code"; +"EnabledPasswordText" = "You have enabled Two-Step verification.\nYou\'ll need the password you set up here to log in to your Telegram account."; +"ChangePassword" = "Change Password"; +"TurnPasswordOff" = "Disable Password"; +"SetRecoveryEmail" = "Set Recovery Email"; +"YourEmailSkip" = "Skip"; +"YourEmailSkipWarning" = "Warning"; +"YourEmailSkipWarningText" = "No, seriously.\n\nIf you forget your password, you will lose access to your Telegram account. There will be no way to restore it."; +"SetAdditionalPasswordInfo" = "You can set a password that will be required when you log in on a new device in addition to the code you get via SMS."; +"EditAdminTransferSetPassword" = "Set Password"; +"WebAppAddToAttachmentText" = "{bot} requests your permission to be added as an option to your attachment menu, so you can access it from any chat."; +"BotOpenPageTitle" = "Open page"; +"BotPermissionGameAlert" = "Allow {bot} to pass your Telegram name and id (not your phone number) to pages you open with this bot?"; +"BotOpenPageMessage" = "**{bot}** would like to open its web app to proceed.\n\nIt will be able to access your **IP address** and basic device info."; +"FilterDeleteAlert" = "Are you sure you want to remove this folder? Your chats will not be deleted."; +"RequestToJoinChannelSentDescription" = "You will be added to the channel once its admins approve your request."; +"RequestToJoinGroupSentDescription" = "You will be added to the group once an admin approves your request."; +"ChannelJoin" = "JOIN"; +"JoinGroup" = "JOIN GROUP"; +"MemberRequestsRequestToJoinChannel" = "Request to Join Channel"; +"MemberRequestsRequestToJoinGroup" = "Request to Join Group"; +"MemberRequestsRequestToJoinDescriptionChannel" = "This channel accepts new subscribers only after they are approved by its admins."; +"MemberRequestsRequestToJoinDescriptionGroup" = "This group accepts new members only after they are approved by its admins."; +"ShareYouPhoneNumberTitle" = "Share your phone number?"; +"AreYouSureShareMyContactInfoBot" = "The bot will know your phone number. This can be useful for integration with other services."; +"OK" = "OK"; +"ForwardTo" = "Forward to..."; +"AttachGame" = "Game"; +"JumpToDate" = "Jump to Date"; +"FloodWait" = "Too many attempts, please try again later."; +"PasscodeWrong" = "Wrong passcode"; +"PasscodeEnterPasscodePlaceholder" = "Enter your passcode"; +"MobileHidden" = "Mobile hidden"; +"NewContactPhoneHiddenText" = "Phone number will be **visible** once {user} adds you as a contact."; +"NewContactShare" = "Share my phone number"; +"AddContactSharedContactExceptionInfo" = "You can make your phone visible to {user}."; +"ContactPhone" = "Phone Number"; +"NewContact" = "New Contact"; +"Done" = "Done"; +"FileSizeGB" = "{count} GB"; +"LimitReached" = "Limit Reached"; +"IncreaseLimit" = "Increase Limit"; +"LimitFree" = "Free"; +"LimitPremium" = "Premium"; +"SubscribeToPremium" = "Subscribe for {price} per month"; +"TelegramPremiumUserDialogTitle" = "**{user}** is a subscriber of Telegram Premium."; +"TelegramPremiumSubscribedTitle" = "You are all set!"; +"AboutPremiumDescription" = "While the free version of Telegram already gives its users more than any other messaging application, **Telegram Premium** pushes its capabilities even further."; +"AboutPremiumDescription2" = "**Telegram Premium** is a paid option, because most Premium Features require additional expenses from Telegram to third parties such as data center providers and server manufacturers. Contributions from **Telegram Premium** users allow us to cover such costs and also help Telegram stay free for everyone."; +"OpenUrlTitle" = "Open Link"; +"OpenUrlAlert2" = "Do you want to open {url}?"; +"ConversationOpenBotLinkLogin" = "Log in to **{url}** as {user}"; +"ConversationOpenBotLinkAllowMessages" = "Allow **{bot}** to send me messages"; +"BotWebViewOpenBot" = "Open Bot"; +"WebAppReloadPage" = "Reload Page"; +"WebAppRemoveBot" = "Remove From Menu"; +"WebAppAddToAttachmentAdd" = "Add"; +"AccActionDownload" = "Download"; +"Forward" = "Forward"; +"MediaZoomOut" = "Zoom Out"; +"MediaZoomIn" = "Zoom In"; +"PeerInfoReportProfileVideo" = "Report Profile Photo"; +"PeerInfoReportProfilePhoto" = "Report Profile Photo"; +"MediaviewProfilePhoto" = "Profile Photo"; +"AccActionPlay" = "Play"; +"AttachAudio" = "Voice Message"; +"NewContactAdd" = "Add contact"; +"NewContactBlock" = "Block user"; +"ReportSpamAndLeave" = "Report spam and leave"; +"BlockUserTitle" = "Block {user}"; +"UserInfoBlockConfirmationTitle" = "Do you want to block {user} from messaging and calling you on Telegram?"; +"ChatConfirmReportSpamChannel" = "Report Spam and Leave Channel?"; +"Block" = "BLOCK"; +"DeleteThisChat" = "Delete this chat"; +"ReportChat" = "Report {peer}"; +"PreviewSenderSendPhoto_one" = "Send Photo"; +"PreviewSenderSendPhoto_other" = "Send {count} Photos"; +"PreviewSenderSendVideo_one" = "Send Video"; +"PreviewSenderSendVideo_other" = "Send {count} Videos"; +"PreviewSenderSendAudio_one" = "Send Audio"; +"PreviewSenderSendAudio_other" = "Send {count} Audios"; +"PreviewSenderSendFile_one" = "Send File"; +"PreviewSenderSendFile_other" = "Send {count} Files"; +"PreviewDraggingAddItems_one" = "Add Item"; +"PreviewDraggingAddItems_other" = "Add Items"; +"Caption" = "Caption"; +"AttachmentMenuPhotoOrVideo" = "Photo or Video"; +"AttachDocument" = "File"; +"Poll" = "Poll"; +"SlowModeHint" = "Slow Mode is active. You can send\nyour next message in {time}."; +"SendMessageAsTitle" = "Send message as..."; +"Message" = "Message"; +"RecentStickers" = "Recently Used"; +"PollsChooseQuestion" = "Please enter a question."; +"PollsChooseAnswers" = "Please enter at least two options."; +"NewPoll" = "New Poll"; +"Create" = "Create"; +"OptionHint" = "Option"; +"CreatePollAddOption" = "Add an Option"; +"PollsChooseCorrect" = "Please choose the correct answer."; +"AskAQuestion" = "Ask a Question"; +"PollOptions" = "Poll options"; +"PollAnonymous" = "Anonymous Poll"; +"PollMultiple" = "Multiple Answers"; +"PollQuiz" = "Quiz Mode"; +"PollsSolutionTitle" = "Explanation"; +"CreatePollExplanationInfo" = "Users will see this comment after choosing a wrong answer, good for educational purposes."; +"VoipGroupPersonalAccount" = "personal account"; +"FavoriteStickers" = "Favorites"; +"PremiumStickers" = "Premium Stickers"; +"GroupStickers" = "Group Stickers"; +"ErrorSendRestrictedStickersAll" = "Sorry, sending stickers is not allowed in this group."; +"NoStickers" = "No stickers yet"; +"ClearRecentEmoji" = "Clear recent emoji?"; +"TextFormatAddLinkTitle" = "Add Link"; +"Save" = "Save"; +"ConversationEmptyPlaceholder" = "No messages here yet..."; +"ConversationGreetingText" = "Send a message or tap on the greeting below."; +"ConversationDeleteManyMessages" = "Delete Messages"; +"AreYouSureDeleteFewMessages" = "Are you sure you want to delete these messages?"; +"ProfileJoinChannel" = "Join Channel"; +"ProfileJoinGroup" = "Join Group"; +"ChannelJoinRequest" = "APPLY TO JOIN GROUP"; +"BotStart" = "START"; +"BotRestart" = "Restart Bot"; +"SubscribeRequests" = "Join Requests"; +"MemberRequests" = "Join Requests"; +"AddContact" = "Add Contact"; +"Call" = "Call"; +"VideoCall" = "Video Call"; +"ChatsUnmute" = "Unmute"; +"ChatsMute" = "Mute"; +"StartVoipChat" = "Start Video chat"; +"VoipGroupJoinCall" = "Join video chat"; +"ViewDiscussion" = "View Discussion"; +"ProfileViewChannel" = "View Channel"; +"ReportSelectMessages" = "Select messages"; +"Statistics" = "Statistics"; +"EventLogFilterPinnedMessages" = "Pinned messages"; +"UnpinMessageAlertTitle" = "Unpin message"; +"PinnedMessage" = "Pinned message"; +"Comments_one" = "{count} Comment"; +"Comments_other" = "{count} Comments"; +"LeaveAComment" = "Leave a comment"; +"PollsStopWarning" = "If you stop this poll now, nobody will be able to vote in it anymore. This action cannot be undone."; +"PollsStopSure" = "Stop"; +"PaymentTestInvoice" = "TEST INVOICE"; +"AttachLiveLocation" = "Live Location"; +"NoWordsRecognized" = "No words recognized."; +"ViaBot" = "via"; +"DiscussChannel" = "channel"; +"ForwardedMessage" = "Forwarded message"; +"ContextForwardMsg" = "Forward"; +"ShareLinkCopied" = "Copied to Clipboard"; +"MessageScheduleSend" = "Send Now"; +"MessageScheduleEditTime" = "Reschedule"; +"Reply" = "Reply"; +"Edit" = "Edit"; +"AddToFavorites" = "Add to Favorites"; +"ContextSaveGif" = "Save GIF"; +"PollsRetract" = "Retract vote"; +"PollsStop" = "Stop poll"; +"ContextCancelDownload" = "Cancel Download"; +"MediaDownload" = "Download"; +"CommonSelect" = "Select"; +"ContextReportMsg" = "Report"; +"ChatContextReactionCount_one" = "1 reaction"; +"ChatContextReactionCount_other" = "{count} reactions"; +"ConversationContextMenuSeen_one" = "1 Seen"; +"ConversationContextMenuSeen_other" = "{count} Seen"; +"ConversationContextMenuNoViews" = "Nobody Viewed"; +"HideAd" = "Hide"; +"EditedDate" = "Edited: {date}"; +"ForwardedDate" = "Original: {date}"; +"EditedMessage" = "edited"; +"CallAgain" = "Call Again"; +"CallBack" = "Call Back"; +"CallMessageWithDuration" = "{time} ({duration})"; +"PollSubmitVotes" = "VOTE"; +"PollViewResults" = "VIEW RESULTS"; +"ChatQuizTotalVotesEmpty" = "No answers yet"; +"ChatPollTotalVotesResultEmpty" = "No votes"; +"Answer_one" = "{count} answer"; +"Answer_other" = "{count} answers"; +"Vote" = "Vote"; +"MessageRecommendedLabel" = "recommended"; +"SponsoredMessage" = "ad"; +"PremiumStickerTooltip" = "This set contains premium stickers like this one."; +"ViewAction" = "View"; +"Loading" = "Loading..."; +"NoMessages" = "No messages here yet…"; +"BotInfoTitle" = "What can this bot do?"; +"UnreadMessages" = "Unread Messages"; +"DiscussionStarted" = "Discussion started"; +"MessageScheduledUntilOnline" = "Scheduled until online"; +"MessageScheduledOn" = "Scheduled for {date}"; +"VoiceOverChatMessagesSelected_one" = "{count} message selected"; +"VoiceOverChatMessagesSelected_other" = "{count} messages selected"; +"ChatForwardActionHeader" = "Forward Messages"; +"ConversationReportMessages" = "Report Messages"; +"ContextCopySelectedItems" = "Copy Selected as Text"; +"EditAdminGroupDeleteMessages" = "Delete Messages"; +"ChatPinnedUnpinAll_one" = "Unpin {count} Message"; +"ChatPinnedUnpinAll_other" = "Unpin All {count} Messages"; +"CommentsCount_one" = "{count} comment"; +"CommentsCount_other" = "{count} comments"; +"PinnedMessagesCount_one" = "Pinned Message"; +"PinnedMessagesCount_other" = "{count} Pinned Messages"; +"Reminders" = "Reminders"; +"Messages_one" = "{count} message"; +"Messages_other" = "{count} messages"; +"ScheduledMessagesEmptyPlaceholder" = "No scheduled messages here yet..."; +"ConversationCloudStorageInfoTitle" = "Your Cloud Storage"; +"ConversationClousStorageInfoDescription1" = "• Forward messages here to save them"; +"ConversationClousStorageInfoDescription2" = "• Send media and files to store them"; +"ConversationClousStorageInfoDescription3" = "• Access this chat from any device"; +"ConversationClousStorageInfoDescription4" = "• Use search to quickly find things"; +"EmptyGroupInfoTitle" = "You created a group"; +"EmptyGroupInfoSubtitle" = "Groups can have:"; +"EmptyGroupInfoLine1" = "• Up to {count} members"; +"EmptyGroupInfoLine2" = "• Persistent chat history"; +"EmptyGroupInfoLine3" = "• Public links such as t.me/title"; +"EmptyGroupInfoLine4" = "• Admins with different rights"; +"Reactions" = "Reactions"; +"MarkAllAsRead" = "Mark all as read"; +"PaymentCardNumber" = "Card Number"; +"PaymentCheckoutAcceptRecurrent" = "I accept the *Terms of Service* of {bot}."; +"CheckoutTotalAmount" = "Total"; +"PaymentCheckoutMethod" = "Payment method"; +"PaymentCheckoutProvider" = "Payment provider"; +"PaymentShippingAddress" = "Shipping address"; +"PaymentCheckoutName" = "Name"; +"PaymentCheckoutPhoneNumber" = "Phone number"; +"PaymentCheckoutShippingMethod" = "Shipping method"; +"CheckoutWebConfirmationTitle" = "Complete Payment"; +"PaymentCardExpireDate" = "MM/YY"; +"PaymentCardTitle" = "Payment card"; +"CheckoutNewCardCardholderNamePlaceholder" = "Cardholder Name"; +"PaymentsCardCvc" = "CVC"; +"PaymentBillingAddress" = "Billing address"; +"PaymentShippingCountry" = "Country"; +"PaymentShippingZipPlaceholder" = "Postcode"; +"PaymentCardSavePaymentInformation" = "Save Payment Information"; +"PaymentShippingInfo" = "Shipping Information"; +"PaymentShippingMethod" = "Shipping methods"; +"PaymentCardInfo" = "Payment info"; +"PaymentCheckout" = "Checkout"; +"CheckoutPayPrice" = "Pay {amount}"; +"PaymentReceipt" = "Receipt"; +"PaymentShippingAddress1Placeholder" = "Address 1 (Street)"; +"PaymentShippingAddress2Placeholder" = "Address 2 (Street)"; +"PaymentShippingCityPlaceholder" = "City"; +"PaymentShippingStatePlaceholder" = "State"; +"PaymentShippingReceiver" = "Receiver"; +"PaymentShippingName" = "Full Name"; +"PaymentShippingEmailPlaceholder" = "Email"; +"PaymentShippingPhoneNumber" = "Phone Number"; +"PaymentShippingSave" = "Save Shipping Information"; +"PaymentShippingSaveInfo" = "You can save your shipping info for future use."; +"ChannelAddUsers" = "Add users"; +"GroupRemovedRemove" = "Remove User"; +"PeerInfoConfirmRemovePeer" = "Remove {user} from the group?"; +"BoxRemove" = "Remove"; +"NoGIFsFound" = "No GIFs found"; +"ChannelAddToChannel" = "Add to channel"; +"ChannelAddToGroup" = "Add to group"; +"DismissRequest" = "Dismiss request"; +"DescriptionPlaceholder" = "Description"; +"TypePublic" = "Public"; +"TypePrivate" = "Private"; +"Discussion" = "Discussion"; +"DiscussionUnlink" = "Unlink"; +"GroupInfoInviteLinks" = "Invite Links"; +"ChannelSignMessages" = "Sign Messages"; +"ChannelAdministrators" = "Administrators"; +"ChannelSubscribers" = "Subscribers"; +"ChannelBlockedUsers" = "Removed users"; +"ChannelDelete" = "Delete Channel"; +"LeaveChannel" = "Leave channel"; +"ChannelDeleteAlert" = "Deleting this channel will remove all subscribers and all posts will be lost. Delete the channel anyway?"; +"ChannelLeaveAlert" = "Are you sure you want to leave this channel?"; +"ChannelCreator" = "Owner"; +"EditAdminPromotedBy" = "Promoted by {user}"; +"ChannelAdmin" = "Admin"; +"EventLog" = "Recent Actions"; +"EventLogInfoDetailChannel" = "This is a list of all notable actions by channel admins in the last 48 hours."; +"EventLogInfoDetail" = "This is a list of all notable actions by group members and admins in the last 48 hours."; +"ChannelManagementAddModerator" = "Add Admin"; +"ChannelVisibilityForwardingEnabled" = "Allow Saving Content"; +"ChannelVisibilityForwardingDisabled" = "Restrict Saving Content"; +"RevokeLink" = "Revoke Link"; +"RevokeAlert" = "Are you sure you want to revoke this link? Once the link is revoked, no one will be able to join using it."; +"RevokeButton" = "Revoke"; +"ChannelVisibilityForwardingChannelTitle" = "Forwarding From This Channel"; +"ChannelVisibilityForwardingGroupTitle" = "Forwarding From This Group"; +"ChannelVisibilityForwardingChannelInfo" = "Subscribers will be able to copy, save and forward content from this channel."; +"ChannelVisibilityForwardingGroupInfo" = "Members will be able to copy, save and forward content from this group."; +"UserRemovedBy" = "Removed by {user}"; +"Unblock" = "Unblock"; +"NoBlockedChannel2" = "Users removed from the channel by admins can\'t rejoin via invite links."; +"NoBlockedGroup2" = "Users removed from the group by admins can\'t rejoin via invite links."; +"ChannelEditAdminPermissionBanUsers" = "Ban Users"; +"DiscussionUnlinkGroup" = "Unlink Group"; +"DiscussionUnlinkChannel" = "Unlink Channel"; +"ChannelDiscussionGroupLinkGroup" = "Link Group"; +"DiscussionUnlinkChannelAlert" = "Are you sure you want to unlink **{chat}** from this channel?"; +"DiscussionUnlinkGroupAlert" = "Are you sure you want to unlink **{channel}** from this group?"; +"DiscussionChannelHelp" = "Select a group chat for discussion that will be displayed in your channel."; +"DiscussionCreateGroup" = "Create a New Group"; +"DiscussionChannelHelp2" = "Everything you post in the channel will be forwarded to this group."; +"DiscussionLinkGroup" = "LINK GROUP"; +"ChannelSettingsJoinTitle" = "Who can send messages?"; +"ChannelSettingsJoinToSend" = "Only members"; +"ChannelSettingsJoinRequest" = "Approve new members"; +"ChannelSettingsJoinRequestInfo" = "Turn this on if you want users to join only after they are approved by an admin."; +"ChannelSettingsJoinToSendInfo" = "Turn this on if you expect users to join your group before being able to send messages."; +"LinkedChannel" = "Linked Channel"; +"ChannelPermissions" = "Permissions"; +"GroupMembers" = "Members"; +"ChatHistory" = "Chat History for New Members"; +"DeleteMega" = "Delete Group"; +"AreYouSureDeleteAndExit" = "Are you sure you want to delete and leave the group?"; +"AreYouSureDeleteThisChatWithGroup" = "Are you sure you want to delete the chat **{chat}**?"; +"DeleteGroupForAll" = "Delete the group for all members"; +"EditAdminWhatCanDo" = "What can this admin do?"; +"EditAdminChangeChannelInfo" = "Change Channel Info"; +"EditAdminChangeGroupInfo" = "Change Group Info"; +"EditAdminPostMessages" = "Post Messages"; +"EditAdminEditMessages" = "Edit Messages of Others"; +"EditAdminDeleteMessages" = "Delete Messages of Others"; +"EditAdminBanUsers" = "Ban Users"; +"EditAdminPinMessages" = "Pin Messages"; +"EditAdminAddAdmins" = "Add New Admins"; +"StartVoipChatPermission" = "Manage Video Chats"; +"EditAdminSendAnonymously" = "Remain Anonymous"; +"ChannelEditAdminCannotEdit" = "You can't edit the rights of this admin."; +"EditAdminRank" = "Custom title"; +"EditAdminRemoveAdmin" = "Dismiss Admin"; +"ChannelAdminDismiss" = "Dismiss Admin"; +"ChannelPermissionsHeader" = "What can members of this group do?"; +"UserRestrictionsSend" = "Send Messages"; +"UserRestrictionsSendMedia" = "Send Media"; +"UserRestrictionsSendStickers" = "Send Stickers & GIFs"; +"UserRestrictionsSendPolls" = "Send Polls"; +"UserRestrictionsEmbedLinks" = "Embed Links"; +"UserRestrictionsChangeInfo" = "Change Chat Info"; +"ChannelAddException" = "Add Exception"; +"EventLogAllEvents" = "All actions"; +"EventLogFilterNewAdmins" = "Admin rights"; +"EventLogFilterNewMembers" = "New members"; +"EventLogFilterChannelInfo" = "Channel info"; +"EventLogFilterDeletedMessages" = "Deleted messages"; +"EventLogFilterEditedMessages" = "Edited messages"; +"EventLogFilterLeavingMembers" = "Members leaving"; +"ChannelManagementTitle" = "Admins"; +"EventLogAllAdmins" = "All admins"; +"UserRestrictionsCanDo" = "What can this user do?"; +"UserRestrictionsBlock" = "Ban and remove from group"; +"ApproveNewMembers" = "Request Admin Approval"; +"ApproveNewMembersDescription" = "Turn this on if you want users to join only after they are approved by an admin."; +"LinkNameHint" = "Link Name (Optional)"; +"LinkNameHelp" = "Only admins will see this name."; +"LimitByPeriod" = "Limit by time period"; +"Hours_one" = "{count} hour"; +"Hours_other" = "{count} hours"; +"Days_one" = "{count} day"; +"Days_other" = "{count} days"; +"NoLimit" = "No limit"; +"GroupInviteExpireCustom" = "Custom"; +"TimeLimitHelp" = "You can make the link expire after a certain time."; +"LimitNumberOfUses" = "Limit by number of users"; +"GroupInviteUsageCustom" = "Custom"; +"UsesLimitHelp" = "You can make the link work only for a certain number of users."; +"SaveLink" = "Save Link"; +"CreateLink" = "Create Link"; +"LinkCopied" = "Link copied to clipboard."; +"PeopleJoined_one" = "{count} person joined"; +"PeopleJoined_other" = "{count} people joined"; +"NoOneJoined" = "No one joined"; +"PeopleCanJoinViaLinkCount_one" = "{count} person can join via this link."; +"PeopleCanJoinViaLinkCount_other" = "{count} people can join via this link."; +"NoOneJoinedYet" = "No one joined yet"; +"CopyLink" = "Copy link"; +"ExpiredLink" = "Expired Link"; +"LinkExpiresIn" = "The link expires {time}"; +"LinkCreatedeBy" = "Link created by"; +"CanJoin_one" = "{count} can join"; +"CanJoin_other" = "{count} can join"; +"Revoked" = "Revoked"; +"JoinRequests_one" = "{count} join request"; +"JoinRequests_other" = "{count} join requests"; +"LinkLimitReached" = "Limit reached"; +"InviteLinkExpiresIn" = "expires in {time}"; +"InviteLinkExpired" = "expired"; +"Permanent" = "Primary link"; +"DeleteLink" = "Delete Link"; +"PrimaryLinkHelpChannel" = "Anyone on Telegram will be able to join your channel by following this link."; +"PrimaryLinkHelp" = "Anyone on Telegram will be able to join your group by following this link."; +"PublicLink" = "Public link"; +"CreatePermanentLinkTitle" = "Primary link"; +"CreateNewLink" = "Create a New Link"; +"ManageLinksInfoHelp" = "You can create additional invite links that have a limited time or number of users."; +"RevokedLinks" = "Revoked Links"; +"DeleteAllRevokedLinks" = "Delete All Revoked Links"; +"DeleteAllRevokedLinkHelp" = "This will delete all revoked links."; +"DeleteAll" = "Delete All"; +"DeleteLinkHelp" = "This will delete link."; +"NoMemberRequests" = "No join requests"; +"NoSubscribeRequestsDescription" = "There are no pending join requests."; +"NoMemberRequestsDescription" = "There are no pending join requests."; +"EnableReactions" = "Enable Reactions"; +"UserInfoFirstNamePlaceholder" = "First Name"; +"UserInfoLastNamePlaceholder" = "Last Name"; +"DeleteContact" = "Delete contact"; +"AreYouSureDeleteContact" = "Are you sure you want to delete this contact?"; +"ChannelBlockUser" = "Remove User"; +"ContextRemoveFromGroup" = "Remove from group"; +"NoGroupsInCommon" = "No common groups"; +"MediaFileEmpty" = "No files here yet"; +"MediaLinkEmpty" = "No shared links here yet"; +"MediaSongEmpty" = "No music files here yet"; +"MediaAudioEmpty" = "No voice messages here yet"; +"SharedMediaEmptyTitle" = "No media files yet"; +"PollResults" = "Final Results"; +"ChannelAddSubscribers" = "Add Subscribers"; +"ChannelTypeHeader" = "Channel type"; +"GroupTypeHeader" = "Group type"; +"GroupInfoAdminLog" = "Recent Actions"; +"EditAdminRights" = "Edit Admin Rights"; +"SetAsAdmin" = "Promote to Admin"; +"UserRestrictions" = "User Permissions"; +"GroupInviteTitle" = "Invite links"; +"EditLink" = "Edit link"; +"NewLink" = "New Link"; +"InviteLink" = "Invite Link"; +"SearchStickersHint" = "Search sticker sets"; +"SearchGifsTitle" = "Search GIFs"; +"ChannelStatsTitle" = "Channel Statistics"; +"GroupStatsTitle" = "Group Statistics"; +"StatsMessageTitle" = "Message Statistics"; +"SharedMedia" = "Shared Media"; +"CommonBack" = "Back"; +"CommonClose" = "Close"; +"DlgSearchForMessages" = "Search for messages"; +"SearchNoResults" = "No messages found"; +"GraphZoomOut" = "Zoom Out"; +"ChannelStatsRecentHeader" = "TOP RECENT POSTS"; +"StatisticOverview" = "Overview"; +"ChannelStatsViewsCount_one" = "{count} view"; +"ChannelStatsViewsCount_other" = "{count} views"; +"ChannelStatsSharesCount_one" = "{count} share"; +"ChannelStatsSharesCount_other" = "{count} shares"; +"Stickers" = "Stickers"; +"StickersInstalled" = "ADDED"; +"StickersInstall" = "ADD"; +"CropImage" = "Crop image"; +"ReportPeerAlertSuccess" = "Thank you!\nYour report will be reviewed by our team."; +"UsernameByPhoneNotFound" = "User {phone} not found."; +"WebAppAddToAttachmentUnavailableError" = "This bot can't be added to the attachment menu."; +"LimitReachedFavoriteGifs" = "Limit of {count} GIFs Reached"; +"LimitReachedFavoriteGifsSubtitlePremium" = "An older GIF was replaced with this one."; +"LimitReachedFavoriteGifsSubtitle" = "An older GIF was replaced with this one. You can **increase the limit** to {count} GIFs."; +"LimitReachedFavoriteStickers" = "Limit of {count} Stickers Reached"; +"LimitReachedFavoriteStickersSubtitlePremium" = "An older sticker was replaced with this one."; +"LimitReachedFavoriteStickersSubtitle" = "An older sticker was replaced with this one. You can **increase the limit** to {count} stickers."; +"StickerPackErrorNotFound" = "Sorry, this sticker set doesn't seem to exist."; +"ContactsPhoneNumberNotRegistred" = "The person with this phone number is not registered on Telegram yet."; +"VoipPeerIncompatible" = "**{user}**\'s app is using an incompatible protocol. They need to update their app before you can call them."; +"NoUsernameFound" = "Username not found."; +"HiddenName" = "Deleted Account"; +"ChannelPersmissionDeniedSendMessagesForever" = "The admins of this group have restricted your ability to send messages."; +"ChannelPersmissionDeniedSendMessagesDefaultRestrictedText" = "Sending messages is not allowed in this group."; +"Chats" = "Chats"; +"FilterBots" = "Bots"; +"FilterContacts" = "Contacts"; +"FilterNonContacts" = "Non-Contacts"; +"FromYou" = "You"; +"InDlgAlbum" = "Album"; +"AttachPhoto" = "Photo"; +"AttachGif" = "GIF"; +"AttachVideo" = "Video"; +"AttachSticker" = "Sticker"; +"AttachMusic" = "Music"; +"AttachContact" = "Contact"; +"MessageLocation" = "Location"; +"MessageLiveLocation" = "Live Location"; +"ServiceNotifications" = "service notifications"; +"Bot" = "bot"; +"ALongTimeAgo" = "last seen a long time ago"; +"WithinAMonth" = "last seen within a month"; +"WithinAWeek" = "last seen within a week"; +"LastSeenOffline" = "last seen a long time ago"; +"LastSeenJustNow" = "last seen just now"; +"LastSeenMinutesAgo_one" = "last seen 1 minute ago"; +"LastSeenMinutesAgo_other" = "last seen {count} minutes ago"; +"LastSeenHoursAgo_one" = "last seen {count} hour ago"; +"LastSeenHoursAgo_other" = "last seen {count} hours ago"; +"LastSeenTodayAt" = "last seen today at {time}"; +"LastSeenYesterdayAt" = "last seen yesterday at {time}"; +"LastSeenAtDate" = "last seen {date}"; +"Online" = "online"; +"Lately" = "last seen recently"; +"VoipMutedTapedForSpeak" = "You asked to speak"; +"VoipMutedByAdmin" = "Muted by admin"; +"VoipUnmute" = "Unmute"; +"VoipTapToMute" = "You\'re live"; +"Weekday1" = "Mon"; +"Weekday2" = "Tue"; +"Weekday3" = "Wed"; +"Weekday4" = "Thu"; +"Weekday5" = "Fri"; +"Weekday6" = "Sat"; +"Weekday7" = "Sun"; +"WeekdayMonday" = "Monday"; +"WeekdayTuesday" = "Tuesday"; +"WeekdayWednesday" = "Wednesday"; +"WeekdayThursday" = "Thursday"; +"WeekdayFriday" = "Friday"; +"WeekdaySaturday" = "Saturday"; +"WeekdaySunday" = "Sunday"; +"WeekdayToday" = "Today"; +"WeekdayYesterday" = "Yesterday"; +"User" = "User"; +"SecretChat" = "Secret Chat"; +"ChannelPermissionDeniedSendMessagesUntil" = "The admins of this group have restricted you from messaging until {date}."; +"FormatDateAtTime" = "{date} at {time}"; +"StickerPackRemoveStickerCount_one" = "Remove {count} sticker"; +"StickerPackRemoveStickerCount_other" = "Remove {count} stickers"; +"StickerPackAddStickerCount_one" = "Add {count} sticker"; +"StickerPackAddStickerCount_other" = "Add {count} stickers"; +"ChatListFilterErrorEmpty" = "Please add some chats or chat types to the folder."; +"ChatListFilterErrorTitleEmpty" = "Please enter title for this folder."; +"FilterMuted" = "Muted"; +"FilterRead" = "Read"; +"FilterArchived" = "Archived"; +"GroupsAndChannelsLimitTitle" = "Groups and Channels"; +"PinChatsLimitTitle" = "Pinned Chats"; +"PublicLinksLimitTitle" = "Public Links"; +"SavedGifsLimitTitle" = "Saved GIFs"; +"FavoriteStickersLimitTitle" = "Favorite Stickers"; +"BioLimitTitle" = "Bio"; +"CaptionsLimitTitle" = "Captions"; +"FoldersLimitTitle" = "Folders"; +"ChatPerFolderLimitTitle" = "Chats per Folder"; +"GroupsAndChannelsLimitSubtitle" = "Join up to {count} channels and large groups"; +"PinChatsLimitSubtitle" = "Pin up to {count} chats in your main chat list"; +"PublicLinksLimitSubtitle" = "Reserve up to {count} t.me/username links"; +"SavedGifsLimitSubtitle" = "Save up to {count} GIFs in your Favorite GIFs"; +"FavoriteStickersLimitSubtitle" = "Save up to {count} stickers in your Favorite stickers"; +"BioLimitSubtitle" = "Add more characters and use links in your bio"; +"CaptionsLimitSubtitle" = "Use longer descriptions for your photos and videos"; +"FoldersLimitSubtitle" = "Organize your chats into {count} folders"; +"ChatPerFolderLimitSubtitle" = "Add up to {count} chats into each of your folders"; +"TelegramPremiumUserDialogSubtitle" = "Owners of **Telegram Premium** accounts have exclusive access to multiple additional features."; +"TelegramPremiumSubscribedSubtitle" = "Thank you for subscribing to **Telegram Premium**.\nHere’s what is now unlocked."; +"TelegramPremiumSubtitle" = "Go **beyond the limits** and **unlock dozens of exclusive** features by subscribing to **Telegram Premium**."; +"EditMessageAriaLabel" = "Save edited message"; +"Emoji1" = "Emoji & People"; +"Emoji2" = "Animals and nature"; +"Emoji3" = "Food and drink"; +"Emoji4" = "Activity"; +"Emoji5" = "Travel and places"; +"Emoji6" = "Objects"; +"Emoji7" = "Symbols"; +"Emoji8" = "Flags"; +"GroupInfoDeleteAndExit" = "Delete and Leave"; +"HidAccount" = "The account was hidden by the user"; +"ChatOutgoingContextMixedReactionCount" = "{count}/{total} reacted"; +"ConversationViewBot" = "VIEW BOT"; +"ConversationViewPost" = "VIEW POST"; +"ConversationViewChannel" = "VIEW CHANNEL"; +"Telegram" = "Telegram"; +"ChatListFilterAddToFolder" = "Add to folder..."; +"UnpinFromTop" = "Unpin from top"; +"PinToTop" = "Pin to top"; +"MarkAsRead" = "Mark as read"; +"MarkAsUnread" = "Mark as unread"; +"Unarchive" = "Unarchive"; +"Archive" = "Archive"; +"WaitingForNetwork" = "Waiting for network..."; +"ScheduleSendWhenOnline" = "Send When Online"; +"VoipIncoming" = "Incoming call"; +"FileSizeB" = "{count} B"; +"FileSizeKB" = "{count} KB"; +"Years_one" = "{count} year"; +"Years_other" = "{count} years"; +"MessageTimerShortHours" = "{count}h"; +"MessageTimerShortDays" = "{count}d"; +"LiveLocationUpdatedJustNow" = "updated just now"; +"LiveLocationUpdatedMinutesAgo_one" = "updated 1 minute ago"; +"LiveLocationUpdatedMinutesAgo_other" = "updated {count} minutes ago"; +"LiveLocationUpdatedTodayAt" = "updated at {time}"; +"Seconds_one" = "{count} second"; +"Seconds_other" = "{count} seconds"; +"Minutes_one" = "{count} minute"; +"Minutes_other" = "{count} minutes"; +"AudioPause" = "Pause audio"; +"AudioPlay" = "Play audio"; +"ToggleUserNotifications" = "Toggle user notifications"; +"ToggleChatNotifications" = "Toggle chat notifications"; +"ChannelInaccessible" = "channel is inaccessible"; +"GroupInaccessible" = "group is inaccessible"; +"AriaPasswordToggle" = "Toggle password visibility"; +"NothingFound" = "Nothing found"; +"SetUrlShort" = "Link is too short"; +"SetUrlLong" = "Link is too long"; +"SetUrlInvalid" = "Link contains invalid characters"; +"UsernameShort" = "Username is too short"; +"UsernameLong" = "Username is too long"; +"UsernameInvalid" = "Username contains invalid characters"; +"AriaCodeWordWrap" = "Word wrap"; +"AriaBackToChatList" = "Return to chat list"; +"NoContactsFound" = "No contacts found"; +"ContactListEmpty" = "Contact list empty"; +"AriaNewChannelContinue" = "Continue to Channel Info"; +"AriaNewGroupContinue" = "Continue to Group Info"; +"NewChatTitleEmptyError" = "Chat title can't be empty"; +"NewChannelTitleEmptyError" = "Channel title can't be empty"; +"NewChatTooManyUsers" = "Sorry, creating supergroups is not yet supported"; +"AriaCreateGroup" = "Create Group"; +"SearchAllMessagesTab" = "All messages"; +"SearchMediaTab" = "Media"; +"SearchLinksTab" = "Links"; +"SearchGifsTab" = "GIF"; +"SearchFilesTab" = "Files"; +"SearchMusicTab" = "Music"; +"SearchVoiceTab" = "Voice"; +"SearchGroupsTab" = "Groups"; +"RecentChatsClear" = "Clear recent chats"; +"EditProfileNoFirstName" = "Please enter your first name"; +"AriaEditProfilePhoto" = "Edit avatar"; +"LaunchConfetti" = "Launch confetti!"; +"SettingsAnimations" = "Animation Level"; +"SettingsAnimationsDescription" = "Choose the desired animations amount"; +"SettingsAnimationsLow" = "Solid and Steady"; +"SettingsAnimationsMedium" = "Nice and Fast"; +"SettingsAnimationsHigh" = "Lots of Stuff"; +"Settings12HourFormat" = "12-hour"; +"Settings24HourFormat" = "24-hour"; +"SettingsSendEnterDescription" = "New line by Shift + Enter"; +"SettingsSendCtrlEnterDescription" = "New line by Enter"; +"AriaMoreButton" = "More Actions"; +"RecoveryEmailCode" = "Recovery Email Code"; +"NotificationsWeb" = "Web Notifications"; +"NotificationsOffline" = "Offline Notifications"; +"NotificationsSound" = "Sound volume"; +"SettingsPasswordEqual" = "Passwords should be equal"; +"SettingsSaveChanges" = "Save changes"; +"SettingsFolderCreate" = "Create folder"; +"SettingsFoldersEmpty" = "You have no folders yet"; +"SettingsPasscodeSuccess" = "Congratulations!\nNow you can lock the app with a passcode so that others can't open it."; +"SettingsPasscodeEnabled" = "Local Passcode is Enabled"; +"SettingsPasscodeStart1" = "When you set up an additional passcode, a lock icon will appear on the chats page.\nTap it to lock and unlock your Telegram Web A."; +"SettingsPasscodeStart2" = "Note: if you forget your local passcode, you'll need to log out of Telegram Web A and log in again."; +"CurrentPasswordPlaceholder" = "Current password"; +"TooManyTabsTitle" = "Such error, many tabs"; +"TooManyTabsDescription" = "Telegram supports only one active tab with the app.\nPlease reload this page to continue using this tab or close it."; +"TooManyTabsReload" = "Reload app"; +"SlowmodeEnabled" = "Slowmode enabled"; +"SomethingWentWrong" = "Something went wrong"; +"MediaViewDownloading" = "{count}% downloading..."; +"VideoPlayerBuffering" = "Buffering..."; +"VideoPlayerFullscreen" = "Fullscreen"; +"PlayerVolume" = "Volume"; +"PlayerPlaybackRate" = "Playback Rate"; +"AudioPlayerPrevious" = "Previous track"; +"AudioPlayerNext" = "Next track"; +"AudioPlayerClose" = "Close"; +"DeleteForMeDescription" = "This will delete them just for you, not for other participants in the chat"; +"DeleteForEveryoneDescription" = "This will delete them for everyone in this chat"; +"AriaSearchInChat" = "Search in chat"; +"PinnedConfirmUnpin" = "Would you like to unpin this message?"; +"RestictionReasonPrivateChat" = "This is a private chat"; +"RestictionReasonPrivateChannel" = "This is a private channel"; +"BotInfoImageAlt" = "Bot info"; +"AriaExitMessageSelection" = "Exit select mode"; +"AriaSearchByDate" = "Search by date"; +"AriaCloseAttachmentModal" = "Discard attachments"; +"AriaAddAttachment" = "Add attachment"; +"AttachMenuMediaBlocked" = "Sending media is not allowed in this group."; +"AriaOpenBotMenu" = "Open bot menu"; +"AriaOpenSymbolMenu" = "Choose emoji, sticker or GIF"; +"AriaComposerOpenScheduled" = "Open scheduled messages"; +"AriaComposerCancelVoice" = "Cancel voice recording"; +"PreviewForwardedMessage_one" = "{count} forwarded message"; +"PreviewForwardedMessage_other" = "{count} forwarded messages"; +"PreviewEditMessage" = "Edit message"; +"FileDropZoneTitle" = "Drop files here to send them"; +"FileDropZoneQuick" = "in a quick way"; +"FileDropZoneNoCompression" = "without compression"; +"GifPickerBlocked" = "Sending GIFs is not allowed in this chat"; +"GifPickerEmpty" = "No saved GIFs"; +"AriaCancelPollCreation" = "Cancel poll creation"; +"AriaLabelSearchStickers" = "Search stickers"; +"AriaLabelSearchGifs" = "Search GIFs"; +"FormattingSpoilerAria" = "Spoiler text"; +"FormattingBoldAria" = "Bold text"; +"FormattingItalicAria" = "Italic text"; +"FormattingMonospaceAria" = "Monospace text"; +"FormattingUnderlineAria" = "Underlined text"; +"FormattingStrikethroughAria" = "Strikethrough text"; +"FormattingEnterUrl" = "Enter URL..."; +"PreviewWebPageClose" = "Clear Webpage Preview"; +"MediaLocaltionImageAlt" = "Location on a map"; +"MediaPollSolutionAria" = "Show solution"; +"GeneralError" = "An error occurred"; +"PaymentsProvidesNotSupported" = "Sorry, Telegram Web A does not support payments with this provider yet.\nPlease use one of our mobile apps to complete this payment."; +"ChatMemberListNoAccess" = "You have no access to group members list"; +"NoMembersFound" = "No members found"; +"Profile" = "Profile"; +"SearchMessagesFound_one" = "1 message found"; +"SearchMessagesFound_other" = "{count} messages found"; +"ChannelManagementAddAdminDescription" = "You can add admins to help you manage your channel."; +"GroupManagementAddAdminDescription" = "You can add admins to help you manage your group."; +"ChannelManagementLinkDiscussion" = "Do you want to make **{group}** the discussion board for **{channel}**?"; +"ChannelManagementLinkPrivate" = "Anyone from the channel will be able to see messages in this group"; +"NoDiscussionsLinked" = "No discussion groups found"; +"ManagementRemoveAdminConfirm" = "Are you sure you want to dismiss this admin?"; +"NoSubscribersFound" = "No subscribers found"; +"GroupManagementBanUserConfirm" = "Are you sure you want to ban and remove this user from the group?"; +"NoLinksFound" = "No links found"; +"JoinRequestAcceptAllTitle" = "Accept all requests?"; +"JoinRequestAcceptAllDescription" = "Are you sure you want to accept all requests?"; +"JoinRequestRejectAllTitle" = "Reject all requests?"; +"JoinRequestRejectAllDescription" = "Are you sure you want to reject all requests?"; +"StatsNoShares" = "No shares"; +"AvatarChangeTitle" = "Change your profile photo"; +"PleaseWait" = "Please wait..."; +"GeneralConfirm" = "Confirm"; +"ImageCropTitle" = "Drag to reposition"; +"NewChatReturnBackAria" = "Return to member selection"; +"FoldersAllChatsDesc" = "All unarchived chats"; +"RemoveSymbol" = "Delete emoji"; +"FocusMessage" = "Focus message"; +"ShowMoreChats_one" = "Show 1 more chat"; +"ShowMoreChats_other" = "Show {count} more chats"; +"ShowMoreVoters_one" = "Show 1 more voter"; +"ShowMoreVoters_other" = "Show {count} more voters"; +"HiddenSendersNameDescription" = "Sender names removed"; +"ShowSenderNames" = "Show Sender Names"; +"ShowSendersName" = "Show Sender Name"; +"HideSenderNames" = "Hide Sender Names"; +"HideSendersName" = "Hide Sender Name"; +"ConversationForwardOptionsShowCaption" = "Show Captions"; +"ShowCaption" = "Show Caption"; +"ConversationForwardOptionsHideCaption" = "Hide Captions"; +"HideCaption" = "Hide Caption"; +"ChangeRecipient" = "Change Recipient"; +"DragToSortAria" = "Drag to sort"; +"SettingsTimeFormat" = "Time format"; +"MenuReportBug" = "Report a Bug"; +"MenuBetaChangelog" = "Beta Changelog"; +"MenuSwitchToK" = "Switch to K Version"; +"MenuInstallApp" = "Install App"; diff --git a/src/assets/localization/initialKeys.ts b/src/assets/localization/initialKeys.ts new file mode 100644 index 000000000..40110a28c --- /dev/null +++ b/src/assets/localization/initialKeys.ts @@ -0,0 +1,26 @@ +const INITIAL_KEYS = [ + 'WrongNumber', + 'SentAppCode', + 'LoginJustSentSms', + 'LoginHeaderPassword', + 'LoginEnterPasswordDescription', + 'StartText', + 'LoginPhonePlaceholder', + 'LoginNext', + 'LoginQRLogin', + 'LoginQRTitle', + 'LoginQRHelp1', + 'LoginQRHelp2', + 'LoginQR2Help2', + 'LoginQRHelp3', + 'LoginQRCancel', + 'YourName', + 'LoginRegisterDesc', + 'LoginRegisterFirstNamePlaceholder', + 'LoginRegisterLastNamePlaceholder', + 'LoginSelectCountryTitle', + 'CountryNone', + 'PleaseEnterPassword', +]; + +export default INITIAL_KEYS; diff --git a/src/assets/localization/initialStrings.ts b/src/assets/localization/initialStrings.ts new file mode 100644 index 000000000..26a1092b1 --- /dev/null +++ b/src/assets/localization/initialStrings.ts @@ -0,0 +1,26 @@ +/* eslint-disable */ +// This file is generated by dev/generateInitialLangFallback.ts. Do not edit it manually. + +export default { + "WrongNumber": "Wrong number?", + "SentAppCode": "We've sent the code to the **Telegram** app on your other device.", + "LoginJustSentSms": "We've sent you a code via SMS. Please enter it above.", + "LoginHeaderPassword": "Enter Password", + "LoginEnterPasswordDescription": "You have Two-Step Verification enabled, so your account is protected with an additional password.", + "StartText": "Please confirm your country codenand enter your phone number.", + "LoginPhonePlaceholder": "Your phone number", + "LoginNext": "Next", + "LoginQRLogin": "Log in by QR Code", + "LoginQRTitle": "Log in to Telegram by QR Code", + "LoginQRHelp1": "Open Telegram on your phone", + "LoginQR2Help2": "Go to **Settings** > **Devices** > **Link Desktop Device**", + "LoginQRHelp3": "Point your phone at this screen to confirm login", + "LoginQRCancel": "Log in by phone Number", + "YourName": "Your Name", + "LoginRegisterDesc": "Enter your name and add a profile photo.", + "LoginRegisterFirstNamePlaceholder": "First Name", + "LoginRegisterLastNamePlaceholder": "Last Name", + "LoginSelectCountryTitle": "Country", + "CountryNone": "Country not found", + "PleaseEnterPassword": "Enter your new password" +} as Record; diff --git a/src/components/App.tsx b/src/components/App.tsx index eb4b1f8e8..47c607dd8 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -22,7 +22,7 @@ import useAppLayout from '../hooks/useAppLayout'; import useFlag from '../hooks/useFlag'; import usePrevious from '../hooks/usePrevious'; -// import Test from './test/TestSvg'; +// import Test from './test/TestLocale'; import Auth from './auth/Auth'; import UiLoader from './common/UiLoader'; import AppInactive from './main/AppInactive'; diff --git a/src/components/auth/AuthCode.tsx b/src/components/auth/AuthCode.tsx index 4c1669795..c4be26833 100644 --- a/src/components/auth/AuthCode.tsx +++ b/src/components/auth/AuthCode.tsx @@ -12,7 +12,7 @@ import { IS_TOUCH_ENV } from '../../util/windowEnvironment'; import renderText from '../common/helpers/renderText'; import useHistoryBack from '../../hooks/useHistoryBack'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import TrackingMonkey from '../common/TrackingMonkey'; import InputText from '../ui/InputText'; @@ -34,7 +34,7 @@ const AuthCode: FC = ({ clearAuthError, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const inputRef = useRef(null); diff --git a/src/components/auth/AuthPassword.tsx b/src/components/auth/AuthPassword.tsx index 4d209936a..7a4f6a32e 100644 --- a/src/components/auth/AuthPassword.tsx +++ b/src/components/auth/AuthPassword.tsx @@ -6,7 +6,7 @@ import type { GlobalState } from '../../global/types'; import { pick } from '../../util/iteratees'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import PasswordForm from '../common/PasswordForm'; import MonkeyPassword from '../common/PasswordMonkey'; @@ -18,7 +18,7 @@ const AuthPassword: FC = ({ }) => { const { setAuthPassword, clearAuthError } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [showPassword, setShowPassword] = useState(false); const handleChangePasswordVisibility = useCallback((isVisible) => { diff --git a/src/components/auth/AuthPhoneNumber.tsx b/src/components/auth/AuthPhoneNumber.tsx index 5e2f9469b..4615c3b96 100644 --- a/src/components/auth/AuthPhoneNumber.tsx +++ b/src/components/auth/AuthPhoneNumber.tsx @@ -13,14 +13,14 @@ import { requestMeasure } from '../../lib/fasterdom/fasterdom'; import { preloadImage } from '../../util/files'; import preloadFonts from '../../util/fonts'; import { pick } from '../../util/iteratees'; -import { setLanguage } from '../../util/langProvider'; +import { oldSetLanguage } from '../../util/oldLangProvider'; import { formatPhoneNumber, getCountryCodesByIso, getCountryFromPhoneNumber } from '../../util/phoneNumber'; import { IS_SAFARI, IS_TOUCH_ENV } from '../../util/windowEnvironment'; import { getSuggestedLanguage } from './helpers/getSuggestedLanguage'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; -import useLangString from '../../hooks/useLangString'; +import useOldLang from '../../hooks/useOldLang'; +import useOldLangString from '../../hooks/useOldLangString'; import Button from '../ui/Button'; import Checkbox from '../ui/Checkbox'; @@ -66,13 +66,13 @@ const AuthPhoneNumber: FC = ({ setSettingOption, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const inputRef = useRef(null); const suggestedLanguage = getSuggestedLanguage(); const isConnected = connectionState === 'connectionStateReady'; - const continueText = useLangString(isConnected ? suggestedLanguage : undefined, 'ContinueOnThisLanguage', true); + const continueText = useOldLangString(isConnected ? suggestedLanguage : undefined, 'ContinueOnThisLanguage', true); const [country, setCountry] = useState(); const [phoneNumber, setPhoneNumber] = useState(); const [isTouched, setIsTouched] = useState(false); @@ -129,7 +129,7 @@ const AuthPhoneNumber: FC = ({ const handleLangChange = useCallback(() => { markIsLoading(); - void setLanguage(suggestedLanguage, () => { + void oldSetLanguage(suggestedLanguage, () => { unmarkIsLoading(); setSettingOption({ language: suggestedLanguage }); diff --git a/src/components/auth/AuthQrCode.tsx b/src/components/auth/AuthQrCode.tsx index 0caf47bd6..60693b09a 100644 --- a/src/components/auth/AuthQrCode.tsx +++ b/src/components/auth/AuthQrCode.tsx @@ -10,16 +10,16 @@ import type { LangCode } from '../../types'; import { DEFAULT_LANG_CODE, STRICTERDOM_ENABLED } from '../../config'; import { disableStrict, enableStrict } from '../../lib/fasterdom/stricterdom'; import buildClassName from '../../util/buildClassName'; -import { setLanguage } from '../../util/langProvider'; +import { oldSetLanguage } from '../../util/oldLangProvider'; import { LOCAL_TGS_URLS } from '../common/helpers/animatedAssets'; import renderText from '../common/helpers/renderText'; import { getSuggestedLanguage } from './helpers/getSuggestedLanguage'; import useAsync from '../../hooks/useAsync'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; -import useLangString from '../../hooks/useLangString'; import useMediaTransition from '../../hooks/useMediaTransition'; +import useOldLang from '../../hooks/useOldLang'; +import useOldLangString from '../../hooks/useOldLangString'; import AnimatedIcon from '../common/AnimatedIcon'; import Button from '../ui/Button'; @@ -57,12 +57,12 @@ const AuthCode: FC = ({ } = getActions(); const suggestedLanguage = getSuggestedLanguage(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const qrCodeRef = useRef(null); const isConnected = connectionState === 'connectionStateReady'; - const continueText = useLangString(isConnected ? suggestedLanguage : undefined, 'ContinueOnThisLanguage', true); + const continueText = useOldLangString(isConnected ? suggestedLanguage : undefined, 'ContinueOnThisLanguage', true); const [isLoading, markIsLoading, unmarkIsLoading] = useFlag(); const [isQrMounted, markQrMounted, unmarkQrMounted] = useFlag(); @@ -130,14 +130,14 @@ const AuthCode: FC = ({ useEffect(() => { if (isConnected) { - void setLanguage(DEFAULT_LANG_CODE); + void oldSetLanguage(DEFAULT_LANG_CODE); } }, [isConnected]); const handleLangChange = useCallback(() => { markIsLoading(); - void setLanguage(suggestedLanguage, () => { + void oldSetLanguage(suggestedLanguage, () => { unmarkIsLoading(); setSettingOption({ language: suggestedLanguage }); diff --git a/src/components/auth/AuthRegister.tsx b/src/components/auth/AuthRegister.tsx index d6220ab80..111a7b02c 100644 --- a/src/components/auth/AuthRegister.tsx +++ b/src/components/auth/AuthRegister.tsx @@ -7,7 +7,7 @@ import type { GlobalState } from '../../global/types'; import { pick } from '../../util/iteratees'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import AvatarEditable from '../ui/AvatarEditable'; import Button from '../ui/Button'; @@ -20,7 +20,7 @@ const AuthRegister: FC = ({ }) => { const { signUp, clearAuthError, uploadProfilePhoto } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isButtonShown, setIsButtonShown] = useState(false); const [croppedFile, setCroppedFile] = useState(); const [firstName, setFirstName] = useState(''); diff --git a/src/components/auth/CountryCodeInput.tsx b/src/components/auth/CountryCodeInput.tsx index 1ffd1260d..95279ee52 100644 --- a/src/components/auth/CountryCodeInput.tsx +++ b/src/components/auth/CountryCodeInput.tsx @@ -12,7 +12,7 @@ import { isoToEmoji } from '../../util/emoji/emoji'; import { prepareSearchWordsForNeedle } from '../../util/searchWords'; import renderText from '../common/helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import useSyncEffect from '../../hooks/useSyncEffect'; import DropdownMenu from '../ui/DropdownMenu'; @@ -42,7 +42,7 @@ const CountryCodeInput: FC = ({ onChange, phoneCodeList, }) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const inputRef = useRef(null); diff --git a/src/components/calls/ActiveCallHeader.tsx b/src/components/calls/ActiveCallHeader.tsx index 83424bcec..b6e2b8cc9 100644 --- a/src/components/calls/ActiveCallHeader.tsx +++ b/src/components/calls/ActiveCallHeader.tsx @@ -8,7 +8,7 @@ import { selectTabState } from '../../global/selectors'; import { selectActiveGroupCall, selectPhoneCallUser } from '../../global/selectors/calls'; import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import './ActiveCallHeader.scss'; @@ -25,7 +25,7 @@ const ActiveCallHeader: FC = ({ }) => { const { toggleGroupCallPanel } = getActions(); - const lang = useLang(); + const lang = useOldLang(); useEffect(() => { document.body.classList.toggle('has-call-header', Boolean(isCallPanelVisible)); diff --git a/src/components/calls/group/GroupCall.tsx b/src/components/calls/group/GroupCall.tsx index 5952c525e..889524364 100644 --- a/src/components/calls/group/GroupCall.tsx +++ b/src/components/calls/group/GroupCall.tsx @@ -25,8 +25,8 @@ import { compact } from '../../../util/iteratees'; import useAppLayout from '../../../hooks/useAppLayout'; import useFlag from '../../../hooks/useFlag'; import { useIntersectionObserver, useIsIntersecting } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import { useFullscreenStatus } from '../../../hooks/window/useFullscreen'; import useGroupCallVideoLayout from './hooks/useGroupCallVideoLayout'; @@ -78,7 +78,7 @@ const GroupCall: FC = ({ createGroupCallInviteLink, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); diff --git a/src/components/calls/group/GroupCallParticipant.tsx b/src/components/calls/group/GroupCallParticipant.tsx index f39517754..7784834db 100644 --- a/src/components/calls/group/GroupCallParticipant.tsx +++ b/src/components/calls/group/GroupCallParticipant.tsx @@ -15,8 +15,8 @@ import renderText from '../../common/helpers/renderText'; import formatGroupCallVolume from './helpers/formatGroupCallVolume'; import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers'; -import useLang from '../../../hooks/useLang'; import useMenuPosition from '../../../hooks/useMenuPosition'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import FullNameTitle from '../../common/FullNameTitle'; @@ -42,7 +42,7 @@ const GroupCallParticipant: FC = ({ const ref = useRef(null); // eslint-disable-next-line no-null/no-null const menuRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { isSelf, isMutedByMe, isMuted, hasVideoStream, hasPresentationStream, diff --git a/src/components/calls/group/GroupCallParticipantMenu.tsx b/src/components/calls/group/GroupCallParticipantMenu.tsx index bd6409cf9..3ee15bdf6 100644 --- a/src/components/calls/group/GroupCallParticipantMenu.tsx +++ b/src/components/calls/group/GroupCallParticipantMenu.tsx @@ -12,8 +12,8 @@ import buildClassName from '../../../util/buildClassName'; import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useRunThrottled from '../../../hooks/useRunThrottled'; import AnimatedIcon from '../../common/AnimatedIcon'; @@ -73,7 +73,7 @@ const GroupCallParticipantMenu: FC = ({ requestToSpeak, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isDeleteUserModalOpen, openDeleteUserModal, closeDeleteUserModal] = useFlag(); const id = participant?.id; diff --git a/src/components/calls/group/GroupCallParticipantVideo.tsx b/src/components/calls/group/GroupCallParticipantVideo.tsx index 800fa8a12..bc4e70177 100644 --- a/src/components/calls/group/GroupCallParticipantVideo.tsx +++ b/src/components/calls/group/GroupCallParticipantVideo.tsx @@ -21,9 +21,9 @@ import formatGroupCallVolume from './helpers/formatGroupCallVolume'; import useInterval from '../../../hooks/schedulers/useInterval'; import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMenuPosition from '../../../hooks/useMenuPosition'; +import useOldLang from '../../../hooks/useOldLang'; import FullNameTitle from '../../common/FullNameTitle'; import Button from '../../ui/Button'; @@ -61,7 +61,7 @@ const GroupCallParticipantVideo: FC = ({ user, chat, }) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const thumbnailRef = useRef(null); diff --git a/src/components/calls/group/GroupCallTopPane.tsx b/src/components/calls/group/GroupCallTopPane.tsx index 57a2a5eb1..29cf620d8 100644 --- a/src/components/calls/group/GroupCallTopPane.tsx +++ b/src/components/calls/group/GroupCallTopPane.tsx @@ -11,7 +11,7 @@ import { selectChatGroupCall } from '../../../global/selectors/calls'; import buildClassName from '../../../util/buildClassName'; import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import useShowTransition from '../../../hooks/useShowTransition'; import AvatarList from '../../common/AvatarList'; @@ -44,7 +44,7 @@ const GroupCallTopPane: FC = ({ subscribeToGroupCallUpdates, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const handleJoinGroupCall = useCallback(() => { requestMasterAndJoinGroupCall({ diff --git a/src/components/calls/group/MicrophoneButton.tsx b/src/components/calls/group/MicrophoneButton.tsx index 7f1af3afa..c75729927 100644 --- a/src/components/calls/group/MicrophoneButton.tsx +++ b/src/components/calls/group/MicrophoneButton.tsx @@ -11,7 +11,7 @@ import buildClassName from '../../../util/buildClassName'; import { vibrateShort } from '../../../util/vibrate'; import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import AnimatedIcon from '../../common/AnimatedIcon'; @@ -51,7 +51,7 @@ const MicrophoneButton: FC = ({ playGroupCallSound, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const muteMouseDownState = useRef('up'); const [isRequestingToSpeak, setIsRequestingToSpeak] = useState(false); diff --git a/src/components/calls/phone/PhoneCall.tsx b/src/components/calls/phone/PhoneCall.tsx index 14cf2ca5d..13e08b52a 100644 --- a/src/components/calls/phone/PhoneCall.tsx +++ b/src/components/calls/phone/PhoneCall.tsx @@ -14,7 +14,7 @@ import { import { selectTabState } from '../../../global/selectors'; import { selectPhoneCallUser } from '../../../global/selectors/calls'; import buildClassName from '../../../util/buildClassName'; -import { formatMediaDuration } from '../../../util/date/dateFormat'; +import { formatMediaDuration } from '../../../util/dates/dateFormat'; import { IS_ANDROID, IS_IOS, @@ -27,7 +27,7 @@ import useInterval from '../../../hooks/schedulers/useInterval'; import useAppLayout from '../../../hooks/useAppLayout'; import useFlag from '../../../hooks/useFlag'; import useForceUpdate from '../../../hooks/useForceUpdate'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import AnimatedIcon from '../../common/AnimatedIcon'; import Avatar from '../../common/Avatar'; @@ -50,7 +50,7 @@ const PhoneCall: FC = ({ phoneCall, isCallPanelVisible, }) => { - const lang = useLang(); + const lang = useOldLang(); const { hangUp, requestMasterAndAcceptCall, playGroupCallSound, toggleGroupCallPanel, connectToActivePhoneCall, } = getActions(); diff --git a/src/components/calls/phone/RatePhoneCallModal.tsx b/src/components/calls/phone/RatePhoneCallModal.tsx index b44a64d9c..ea7e7e8fe 100644 --- a/src/components/calls/phone/RatePhoneCallModal.tsx +++ b/src/components/calls/phone/RatePhoneCallModal.tsx @@ -6,7 +6,7 @@ import { getActions } from '../../../global'; import buildClassName from '../../../util/buildClassName'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Button from '../../ui/Button'; import InputText from '../../ui/InputText'; @@ -26,7 +26,7 @@ const RatePhoneCallModal: FC = ({ // eslint-disable-next-line no-null/no-null const inputRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const [rating, setRating] = useState(); const handleSend = useCallback(() => { diff --git a/src/components/common/AboutAdsModal.tsx b/src/components/common/AboutAdsModal.tsx index 68217e1b9..555870985 100644 --- a/src/components/common/AboutAdsModal.tsx +++ b/src/components/common/AboutAdsModal.tsx @@ -5,7 +5,7 @@ import buildClassName from '../../util/buildClassName'; import renderText from './helpers/renderText'; import useDerivedState from '../../hooks/useDerivedState'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import useSelectorSignal from '../../hooks/useSelectorSignal'; import Button from '../ui/Button'; @@ -28,7 +28,7 @@ const AboutAdsModal: FC = ({ isRevenueSharing, onClose, }) => { - const lang = useLang(); + const lang = useOldLang(); const minLevelSignal = useSelectorSignal((global) => global.appConfig?.channelRestrictAdsLevelMin); const minLevelToRestrictAds = useDerivedState(minLevelSignal); diff --git a/src/components/common/AnimatedCounter.tsx b/src/components/common/AnimatedCounter.tsx index d59128880..107418e4c 100644 --- a/src/components/common/AnimatedCounter.tsx +++ b/src/components/common/AnimatedCounter.tsx @@ -8,7 +8,7 @@ import { selectCanAnimateInterface } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import styles from './AnimatedCounter.module.scss'; @@ -21,7 +21,7 @@ const AnimatedCounter: FC = ({ text, className, }) => { - const lang = useLang(); + const lang = useOldLang(); const prevTextRef = useRef(); const [isAnimating, markAnimating, unmarkAnimating] = useFlag(false); diff --git a/src/components/common/Audio.tsx b/src/components/common/Audio.tsx index 076799295..963216a0e 100644 --- a/src/components/common/Audio.tsx +++ b/src/components/common/Audio.tsx @@ -6,7 +6,7 @@ import { getActions } from '../../global'; import type { ApiAudio, ApiMessage, ApiVoice } from '../../api/types'; import type { BufferedRange } from '../../hooks/useBuffering'; -import type { LangFn } from '../../hooks/useLang'; +import type { LangFn } from '../../hooks/useOldLang'; import type { ISettings } from '../../types'; import { ApiMediaFormat } from '../../api/types'; import { AudioOrigin } from '../../types'; @@ -24,7 +24,7 @@ import { import { makeTrackId } from '../../util/audioPlayer'; import buildClassName from '../../util/buildClassName'; import { captureEvents } from '../../util/captureEvents'; -import { formatMediaDateTime, formatMediaDuration, formatPastTimeShort } from '../../util/date/dateFormat'; +import { formatMediaDateTime, formatMediaDuration, formatPastTimeShort } from '../../util/dates/dateFormat'; import { decodeWaveform, interpolateArray } from '../../util/waveform'; import { LOCAL_TGS_URLS } from './helpers/animatedAssets'; import { getFileSizeString } from './helpers/documentInfo'; @@ -34,10 +34,10 @@ import { MAX_EMPTY_WAVEFORM_POINTS, renderWaveform } from './helpers/waveform'; import useAppLayout from '../../hooks/useAppLayout'; import useAudioPlayer from '../../hooks/useAudioPlayer'; import useBuffering from '../../hooks/useBuffering'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMedia from '../../hooks/useMedia'; import useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress'; +import useOldLang from '../../hooks/useOldLang'; import useShowTransition from '../../hooks/useShowTransition'; import Button from '../ui/Button'; @@ -121,7 +121,7 @@ const Audio: FC = ({ const isSeeking = useRef(false); // eslint-disable-next-line no-null/no-null const seekerRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { isRtl } = lang; const { isMobile } = useAppLayout(); diff --git a/src/components/common/Avatar.tsx b/src/components/common/Avatar.tsx index 58553bf0d..20f5e80e8 100644 --- a/src/components/common/Avatar.tsx +++ b/src/components/common/Avatar.tsx @@ -29,10 +29,10 @@ import { getPeerColorClass } from './helpers/peerColor'; import renderText from './helpers/renderText'; import { useFastClick } from '../../hooks/useFastClick'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMedia from '../../hooks/useMedia'; import useMediaTransition from '../../hooks/useMediaTransition'; +import useOldLang from '../../hooks/useOldLang'; import OptimizedVideo from '../ui/OptimizedVideo'; import AvatarStoryCircle from './AvatarStoryCircle'; @@ -171,7 +171,7 @@ const Avatar: FC = ({ } }); - const lang = useLang(); + const lang = useOldLang(); let content: TeactNode | undefined; const author = user ? getUserFullName(user) : (chat ? getChatTitle(lang, chat) : text); diff --git a/src/components/common/AvatarList.tsx b/src/components/common/AvatarList.tsx index 7580a55ab..29dac9cd0 100644 --- a/src/components/common/AvatarList.tsx +++ b/src/components/common/AvatarList.tsx @@ -6,7 +6,7 @@ import type { AvatarSize } from './Avatar'; import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Avatar from './Avatar'; @@ -29,7 +29,7 @@ const AvatarList: FC = ({ limit = DEFAULT_LIMIT, badgeText, }) => { - const lang = useLang(); + const lang = useOldLang(); const renderingBadgeText = useMemo(() => { if (badgeText) return badgeText; if (!peers?.length || peers.length <= limit) return undefined; diff --git a/src/components/common/CalendarModal.tsx b/src/components/common/CalendarModal.tsx index 6c336f95f..50694ee67 100644 --- a/src/components/common/CalendarModal.tsx +++ b/src/components/common/CalendarModal.tsx @@ -3,14 +3,14 @@ import React, { memo, useCallback, useEffect, useMemo, useState, } from '../../lib/teact/teact'; -import type { LangFn } from '../../hooks/useLang'; +import type { LangFn } from '../../hooks/useOldLang'; import { MAX_INT_32 } from '../../config'; import buildClassName from '../../util/buildClassName'; -import { formatDateToString, formatTime, getDayStart } from '../../util/date/dateFormat'; +import { formatDateToString, formatTime, getDayStart } from '../../util/dates/dateFormat'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import Button from '../ui/Button'; @@ -60,7 +60,7 @@ const CalendarModal: FC = ({ onSubmit, onSecondButtonClick, }) => { - const lang = useLang(); + const lang = useOldLang(); const now = new Date(); const minDate = useMemo(() => { diff --git a/src/components/common/ChatForumLastMessage.tsx b/src/components/common/ChatForumLastMessage.tsx index 7c191c7aa..0be542f8d 100644 --- a/src/components/common/ChatForumLastMessage.tsx +++ b/src/components/common/ChatForumLastMessage.tsx @@ -18,7 +18,7 @@ import renderText from './helpers/renderText'; import { getIsMobile } from '../../hooks/useAppLayout'; import { useFastClick } from '../../hooks/useFastClick'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import TopicIcon from './TopicIcon'; @@ -45,7 +45,7 @@ const ChatForumLastMessage: FC = ({ // eslint-disable-next-line no-null/no-null const mainColumnRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const [lastActiveTopic, ...otherTopics] = useMemo(() => { if (!chat.topics) { diff --git a/src/components/common/ChatOrUserPicker.tsx b/src/components/common/ChatOrUserPicker.tsx index e42c5680d..aa1e0592e 100644 --- a/src/components/common/ChatOrUserPicker.tsx +++ b/src/components/common/ChatOrUserPicker.tsx @@ -16,8 +16,8 @@ import renderText from './helpers/renderText'; import useInfiniteScroll from '../../hooks/useInfiniteScroll'; import useInputFocusOnOpen from '../../hooks/useInputFocusOnOpen'; import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import InfiniteScroll from '../ui/InfiniteScroll'; @@ -65,7 +65,7 @@ const ChatOrUserPicker: FC = ({ }) => { const { loadTopics } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); // eslint-disable-next-line no-null/no-null diff --git a/src/components/common/Composer.tsx b/src/components/common/Composer.tsx index 973f3b5fd..eb90da7d3 100644 --- a/src/components/common/Composer.tsx +++ b/src/components/common/Composer.tsx @@ -87,7 +87,7 @@ import { } from '../../global/selectors'; import { selectCurrentLimit } from '../../global/selectors/limits'; import buildClassName from '../../util/buildClassName'; -import { formatMediaDuration, formatVoiceRecordDuration } from '../../util/date/dateFormat'; +import { formatMediaDuration, formatVoiceRecordDuration } from '../../util/dates/dateFormat'; import deleteLastCharacterOutsideSelection from '../../util/deleteLastCharacterOutsideSelection'; import { processMessageInputForCustomEmoji } from '../../util/emoji/customEmojiManager'; import focusEditableElement from '../../util/focusEditableElement'; @@ -112,8 +112,8 @@ import useDerivedState from '../../hooks/useDerivedState'; import useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps'; import useFlag from '../../hooks/useFlag'; import useGetSelectionRange from '../../hooks/useGetSelectionRange'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import useSchedule from '../../hooks/useSchedule'; import useSendMessageAction from '../../hooks/useSendMessageAction'; @@ -380,7 +380,7 @@ const Composer: FC = ({ editMessage, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const inputRef = useRef(null); diff --git a/src/components/common/CountryPickerModal.tsx b/src/components/common/CountryPickerModal.tsx index d4994ebfb..58aed9072 100644 --- a/src/components/common/CountryPickerModal.tsx +++ b/src/components/common/CountryPickerModal.tsx @@ -8,8 +8,8 @@ import type { ApiCountry } from '../../api/types'; import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import Button from '../ui/Button'; @@ -36,7 +36,7 @@ const CountryPickerModal: FC = ({ }) => { const { showNotification } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [selectedCountryIds, setSelectedCountryIds] = useState([]); const prevSelectedCountryIds = usePrevious(selectedCountryIds); diff --git a/src/components/common/CustomEmojiPicker.tsx b/src/components/common/CustomEmojiPicker.tsx index 36d469f08..2674835fe 100644 --- a/src/components/common/CustomEmojiPicker.tsx +++ b/src/components/common/CustomEmojiPicker.tsx @@ -34,8 +34,8 @@ import { REM } from './helpers/mediaDimensions'; import useAppLayout from '../../hooks/useAppLayout'; import useHorizontalScroll from '../../hooks/useHorizontalScroll'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import useScrolledState from '../../hooks/useScrolledState'; import useAsyncRendering from '../right/hooks/useAsyncRendering'; import { useStickerPickerObservers } from './hooks/useStickerPickerObservers'; @@ -164,7 +164,7 @@ const CustomEmojiPicker: FC = ({ selectStickerSet, } = useStickerPickerObservers(containerRef, headerRef, prefix, isHidden); - const lang = useLang(); + const lang = useOldLang(); const areAddedLoaded = Boolean(addedCustomEmojiIds); diff --git a/src/components/common/CustomEmojiSetsModal.tsx b/src/components/common/CustomEmojiSetsModal.tsx index 3494d25b5..3051e9165 100644 --- a/src/components/common/CustomEmojiSetsModal.tsx +++ b/src/components/common/CustomEmojiSetsModal.tsx @@ -10,7 +10,7 @@ import { selectCanPlayAnimatedEmojis } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import Modal from '../ui/Modal'; @@ -34,7 +34,7 @@ const CustomEmojiSetsModal: FC = ({ onClose, }) => { const { openStickerSet } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const customEmojiModalRef = useRef(null); diff --git a/src/components/common/DeleteChatModal.tsx b/src/components/common/DeleteChatModal.tsx index 30bd401b8..6410740fe 100644 --- a/src/components/common/DeleteChatModal.tsx +++ b/src/components/common/DeleteChatModal.tsx @@ -17,7 +17,7 @@ import { import { selectIsChatWithSelf, selectUser } from '../../global/selectors'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Modal from '../ui/Modal'; @@ -70,7 +70,7 @@ const DeleteChatModal: FC = ({ blockUser, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const chatTitle = getChatTitle(lang, chat); const handleDeleteForAll = useCallback(() => { diff --git a/src/components/common/DeleteMessageModal.tsx b/src/components/common/DeleteMessageModal.tsx index 1409fb0e0..f60084ea5 100644 --- a/src/components/common/DeleteMessageModal.tsx +++ b/src/components/common/DeleteMessageModal.tsx @@ -21,7 +21,7 @@ import { } from '../../global/selectors'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Modal from '../ui/Modal'; @@ -84,7 +84,7 @@ const DeleteMessageModal: FC = ({ onClose(); }, [onConfirm, album, message.id, isSchedule, onClose, deleteScheduledMessages, deleteMessages]); - const lang = useLang(); + const lang = useOldLang(); return ( = ({ onClose(); }, [onConfirm, profileId, onClose, deleteProfilePhoto, photo, deleteChatPhoto]); - const lang = useLang(); + const lang = useOldLang(); return ( = ({ // eslint-disable-next-line no-null/no-null const ref = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const [isSvgDialogOpen, openSvgDialog, closeSvgDialog] = useFlag(); const [shouldNotWarnAboutSvg, setShouldNotWarnAboutSvg] = useState(false); diff --git a/src/components/common/DotAnimation.tsx b/src/components/common/DotAnimation.tsx index 39ab71e41..b676e0be2 100644 --- a/src/components/common/DotAnimation.tsx +++ b/src/components/common/DotAnimation.tsx @@ -4,7 +4,7 @@ import React from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import './DotAnimation.scss'; @@ -14,7 +14,7 @@ type OwnProps = { }; const DotAnimation: FC = ({ content, className }) => { - const lang = useLang(); + const lang = useOldLang(); return ( {renderText(content)} diff --git a/src/components/common/FakeIcon.tsx b/src/components/common/FakeIcon.tsx index 343093a21..8a7f32dff 100644 --- a/src/components/common/FakeIcon.tsx +++ b/src/components/common/FakeIcon.tsx @@ -3,7 +3,7 @@ import React, { memo } from '../../lib/teact/teact'; import type { ApiFakeType } from '../../api/types'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import './FakeIcon.scss'; @@ -14,7 +14,7 @@ type OwnProps = { const FakeIcon: FC = ({ fakeType, }) => { - const lang = useLang(); + const lang = useOldLang(); return ( diff --git a/src/components/common/File.tsx b/src/components/common/File.tsx index 5af734e3c..258734873 100644 --- a/src/components/common/File.tsx +++ b/src/components/common/File.tsx @@ -6,7 +6,7 @@ import React, { import type { IconName } from '../../types/icons'; import buildClassName from '../../util/buildClassName'; -import { formatMediaDateTime, formatPastTimeShort } from '../../util/date/dateFormat'; +import { formatMediaDateTime, formatPastTimeShort } from '../../util/dates/dateFormat'; import { IS_CANVAS_FILTER_SUPPORTED } from '../../util/windowEnvironment'; import { getColorFromExtension, getFileSizeString } from './helpers/documentInfo'; import { getDocumentThumbnailDimensions } from './helpers/mediaDimensions'; @@ -14,8 +14,8 @@ import renderText from './helpers/renderText'; import useAppLayout from '../../hooks/useAppLayout'; import useCanvasBlur from '../../hooks/useCanvasBlur'; -import useLang from '../../hooks/useLang'; import useMediaTransition from '../../hooks/useMediaTransition'; +import useOldLang from '../../hooks/useOldLang'; import useShowTransition from '../../hooks/useShowTransition'; import Link from '../ui/Link'; @@ -64,7 +64,7 @@ const File: FC = ({ onClick, onDateClick, }) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null let elementRef = useRef(null); if (ref) { diff --git a/src/components/common/FullNameTitle.tsx b/src/components/common/FullNameTitle.tsx index e3cc51d5b..ffc672201 100644 --- a/src/components/common/FullNameTitle.tsx +++ b/src/components/common/FullNameTitle.tsx @@ -17,8 +17,8 @@ import { copyTextToClipboard } from '../../util/clipboard'; import stopEvent from '../../util/stopEvent'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import CustomEmoji from './CustomEmoji'; import FakeIcon from './FakeIcon'; @@ -58,7 +58,7 @@ const FullNameTitle: FC = ({ observeIntersection, iconElement, }) => { - const lang = useLang(); + const lang = useOldLang(); const { showNotification } = getActions(); const realPeer = 'id' in peer ? peer : undefined; const customPeer = 'isCustomPeer' in peer ? peer : undefined; diff --git a/src/components/common/GifButton.tsx b/src/components/common/GifButton.tsx index caa9a2420..21af7e679 100644 --- a/src/components/common/GifButton.tsx +++ b/src/components/common/GifButton.tsx @@ -15,10 +15,10 @@ import useBuffering from '../../hooks/useBuffering'; import useCanvasBlur from '../../hooks/useCanvasBlur'; import useContextMenuHandlers from '../../hooks/useContextMenuHandlers'; import { useIsIntersecting } from '../../hooks/useIntersectionObserver'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMedia from '../../hooks/useMedia'; import useMenuPosition from '../../hooks/useMenuPosition'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Menu from '../ui/Menu'; @@ -50,7 +50,7 @@ const GifButton: FC = ({ // eslint-disable-next-line no-null/no-null const ref = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const localMediaHash = `gif${gif.id}`; const isIntersecting = useIsIntersecting(ref, observeIntersection); diff --git a/src/components/common/GroupChatInfo.tsx b/src/components/common/GroupChatInfo.tsx index d854f1e34..3d80d3641 100644 --- a/src/components/common/GroupChatInfo.tsx +++ b/src/components/common/GroupChatInfo.tsx @@ -5,7 +5,7 @@ import { getActions, withGlobal } from '../../global'; import type { ApiChat, ApiThreadInfo, ApiTopic, ApiTypingStatus, ApiUser, } from '../../api/types'; -import type { LangFn } from '../../hooks/useLang'; +import type { LangFn } from '../../hooks/useOldLang'; import type { IconName } from '../../types/icons'; import { MediaViewerOrigin, type StoryViewerOrigin, type ThreadId } from '../../types'; @@ -26,8 +26,8 @@ import buildClassName from '../../util/buildClassName'; import { REM } from './helpers/mediaDimensions'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Transition from '../ui/Transition'; import Avatar from './Avatar'; @@ -112,7 +112,7 @@ const GroupChatInfo: FC = ({ loadProfilePhotos, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const isSuperGroup = chat && isChatSuperGroup(chat); const isTopic = Boolean(chat?.isForum && threadInfo && topic); diff --git a/src/components/common/LastMessageMeta.tsx b/src/components/common/LastMessageMeta.tsx index ea71c9d26..55f74b87b 100644 --- a/src/components/common/LastMessageMeta.tsx +++ b/src/components/common/LastMessageMeta.tsx @@ -3,9 +3,9 @@ import React, { memo } from '../../lib/teact/teact'; import type { ApiMessage, ApiMessageOutgoingStatus } from '../../api/types'; -import { formatPastTimeShort } from '../../util/date/dateFormat'; +import { formatPastTimeShort } from '../../util/dates/dateFormat'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import MessageOutgoingStatus from './MessageOutgoingStatus'; @@ -18,7 +18,7 @@ type OwnProps = { }; const LastMessageMeta: FC = ({ message, outgoingStatus, draftDate }) => { - const lang = useLang(); + const lang = useOldLang(); const shouldUseDraft = draftDate && draftDate > message.date; return ( diff --git a/src/components/common/LinkField.tsx b/src/components/common/LinkField.tsx index 0ad2fdcd3..a47179742 100644 --- a/src/components/common/LinkField.tsx +++ b/src/components/common/LinkField.tsx @@ -6,8 +6,8 @@ import buildClassName from '../../util/buildClassName'; import { copyTextToClipboard } from '../../util/clipboard'; import useAppLayout from '../../hooks/useAppLayout'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import DropdownMenu from '../ui/DropdownMenu'; @@ -33,7 +33,7 @@ const InviteLink: FC = ({ withShare, onRevoke, }) => { - const lang = useLang(); + const lang = useOldLang(); const { showNotification, openChatWithDraft } = getActions(); const { isMobile } = useAppLayout(); diff --git a/src/components/common/ManageUsernames.tsx b/src/components/common/ManageUsernames.tsx index dea6fb9b7..bb3356945 100644 --- a/src/components/common/ManageUsernames.tsx +++ b/src/components/common/ManageUsernames.tsx @@ -10,7 +10,7 @@ import buildClassName from '../../util/buildClassName'; import { copyTextToClipboard } from '../../util/clipboard'; import { isBetween } from '../../util/math'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import ConfirmDialog from '../ui/ConfirmDialog'; @@ -45,7 +45,7 @@ const ManageUsernames: FC = ({ sortUsernames, sortChatUsernames, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [usernameForConfirm, setUsernameForConfirm] = useState(); const usernameList = useMemo(() => usernames.map(({ username }) => username), [usernames]); diff --git a/src/components/common/Media.tsx b/src/components/common/Media.tsx index 3fe5b7990..9e82bfcfb 100644 --- a/src/components/common/Media.tsx +++ b/src/components/common/Media.tsx @@ -12,7 +12,7 @@ import { getMessageVideo, } from '../../global/helpers'; import buildClassName from '../../util/buildClassName'; -import { formatMediaDuration } from '../../util/date/dateFormat'; +import { formatMediaDuration } from '../../util/dates/dateFormat'; import stopEvent from '../../util/stopEvent'; import useFlag from '../../hooks/useFlag'; diff --git a/src/components/common/MessageSummary.tsx b/src/components/common/MessageSummary.tsx index fea69ee39..ea7aebc0f 100644 --- a/src/components/common/MessageSummary.tsx +++ b/src/components/common/MessageSummary.tsx @@ -2,7 +2,7 @@ import React, { memo } from '../../lib/teact/teact'; import type { ApiFormattedText, ApiMessage } from '../../api/types'; import type { ObserveFn } from '../../hooks/useIntersectionObserver'; -import type { LangFn } from '../../hooks/useLang'; +import type { LangFn } from '../../hooks/useOldLang'; import { ApiMessageEntityTypes } from '../../api/types'; import { diff --git a/src/components/common/NothingFound.tsx b/src/components/common/NothingFound.tsx index 202ba5104..6d5230c6a 100644 --- a/src/components/common/NothingFound.tsx +++ b/src/components/common/NothingFound.tsx @@ -4,7 +4,7 @@ import React, { memo } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import useShowTransition from '../../hooks/useShowTransition'; import './NothingFound.scss'; @@ -17,7 +17,7 @@ interface OwnProps { const DEFAULT_TEXT = 'Nothing found.'; const NothingFound: FC = ({ text = DEFAULT_TEXT, description }) => { - const lang = useLang(); + const lang = useOldLang(); const { transitionClassNames } = useShowTransition(true); return ( diff --git a/src/components/common/PasswordForm.tsx b/src/components/common/PasswordForm.tsx index b69171303..ad5b17424 100644 --- a/src/components/common/PasswordForm.tsx +++ b/src/components/common/PasswordForm.tsx @@ -12,7 +12,7 @@ import { IS_TOUCH_ENV } from '../../util/windowEnvironment'; import useTimeout from '../../hooks/schedulers/useTimeout'; import useAppLayout from '../../hooks/useAppLayout'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; @@ -53,7 +53,7 @@ const PasswordForm: FC = ({ }) => { // eslint-disable-next-line no-null/no-null const inputRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); const [password, setPassword] = useState(''); diff --git a/src/components/common/Picker.tsx b/src/components/common/Picker.tsx index db1069b48..fac77a002 100644 --- a/src/components/common/Picker.tsx +++ b/src/components/common/Picker.tsx @@ -12,8 +12,8 @@ import buildClassName from '../../util/buildClassName'; import { buildCollectionByKey } from '../../util/iteratees'; import useInfiniteScroll from '../../hooks/useInfiniteScroll'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Checkbox from '../ui/Checkbox'; import InfiniteScroll from '../ui/InfiniteScroll'; @@ -173,7 +173,7 @@ const Picker: FC = ({ const [viewportIds, getMore] = useInfiniteScroll(onLoadMore, sortedItemIds, Boolean(filterValue)); - const lang = useLang(); + const lang = useOldLang(); const countriesByIso = useMemo(() => { if (!countryList) return undefined; diff --git a/src/components/common/PickerSelectedItem.tsx b/src/components/common/PickerSelectedItem.tsx index df7e8c922..d63b985c8 100644 --- a/src/components/common/PickerSelectedItem.tsx +++ b/src/components/common/PickerSelectedItem.tsx @@ -12,7 +12,7 @@ import buildClassName from '../../util/buildClassName'; import { getPeerColorClass } from './helpers/peerColor'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Avatar from './Avatar'; import Icon from './icons/Icon'; @@ -55,7 +55,7 @@ const PickerSelectedItem: FC = ({ withPeerColors, onClick, }) => { - const lang = useLang(); + const lang = useOldLang(); let iconElement: TeactNode | undefined; let titleText: any; diff --git a/src/components/common/PinMessageModal.tsx b/src/components/common/PinMessageModal.tsx index 0dc07ccdf..52d609ffc 100644 --- a/src/components/common/PinMessageModal.tsx +++ b/src/components/common/PinMessageModal.tsx @@ -13,7 +13,7 @@ import { import { selectChat, selectIsChatWithSelf, selectUser } from '../../global/selectors'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Modal from '../ui/Modal'; @@ -61,7 +61,7 @@ const PinMessageModal: FC = ({ onClose(); }, [messageId, onClose, pinMessage]); - const lang = useLang(); + const lang = useOldLang(); function renderMessage() { if (isChannel) { diff --git a/src/components/common/PremiumProgress.tsx b/src/components/common/PremiumProgress.tsx index b375d0964..7baf6a0f5 100644 --- a/src/components/common/PremiumProgress.tsx +++ b/src/components/common/PremiumProgress.tsx @@ -8,7 +8,7 @@ import type { IconName } from '../../types/icons'; import buildClassName from '../../util/buildClassName'; import buildStyle from '../../util/buildStyle'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import useResizeObserver from '../../hooks/useResizeObserver'; import Icon from './icons/Icon'; @@ -32,7 +32,7 @@ const LimitPreview: FC = ({ progress, className, }) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const floatingBadgeRef = useRef(null); // eslint-disable-next-line no-null/no-null diff --git a/src/components/common/PrivacySettingsNoticeModal.tsx b/src/components/common/PrivacySettingsNoticeModal.tsx index e12d09c18..10c0fa7a3 100644 --- a/src/components/common/PrivacySettingsNoticeModal.tsx +++ b/src/components/common/PrivacySettingsNoticeModal.tsx @@ -9,8 +9,8 @@ import { selectTabState, selectUser } from '../../global/selectors'; import { LOCAL_TGS_URLS } from './helpers/animatedAssets'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Modal, { ANIMATION_DURATION } from '../ui/Modal'; @@ -32,7 +32,7 @@ type StateProps = { const CLOSE_ANIMATION_DURATION = ANIMATION_DURATION + ANIMATION_END_DELAY; const PrivacySettingsNoticeModal = ({ isOpen, isReadDate, user }: OwnProps & StateProps) => { - const lang = useLang(); + const lang = useOldLang(); const { updateGlobalPrivacySettings, openPremiumModal, diff --git a/src/components/common/PrivateChatInfo.tsx b/src/components/common/PrivateChatInfo.tsx index 3b216411f..850c9a7b3 100644 --- a/src/components/common/PrivateChatInfo.tsx +++ b/src/components/common/PrivateChatInfo.tsx @@ -16,8 +16,8 @@ import { selectChatMessages, selectUser, selectUserStatus } from '../../global/s import buildClassName from '../../util/buildClassName'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import RippleEffect from '../ui/RippleEffect'; import Avatar from './Avatar'; @@ -105,7 +105,7 @@ const PrivateChatInfo: FC = ({ loadProfilePhotos, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { id: userId } = user || {}; diff --git a/src/components/common/ProfileInfo.tsx b/src/components/common/ProfileInfo.tsx index 578a8a61e..ae1228e75 100644 --- a/src/components/common/ProfileInfo.tsx +++ b/src/components/common/ProfileInfo.tsx @@ -27,8 +27,8 @@ import { MEMO_EMPTY_ARRAY } from '../../util/memo'; import { IS_TOUCH_ENV } from '../../util/windowEnvironment'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import { useStateRef } from '../../hooks/useStateRef'; import usePhotosPreload from './hooks/usePhotosPreload'; @@ -93,7 +93,7 @@ const ProfileInfo: FC = ({ openPrivacySettingsNoticeModal, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { id: userId } = user || {}; const { id: chatId } = chat || {}; diff --git a/src/components/common/ProfilePhoto.tsx b/src/components/common/ProfilePhoto.tsx index f06d7f223..f325b6246 100644 --- a/src/components/common/ProfilePhoto.tsx +++ b/src/components/common/ProfilePhoto.tsx @@ -24,9 +24,9 @@ import renderText from './helpers/renderText'; import useAppLayout from '../../hooks/useAppLayout'; import useCanvasBlur from '../../hooks/useCanvasBlur'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useMedia from '../../hooks/useMedia'; import useMediaTransition from '../../hooks/useMediaTransition'; +import useOldLang from '../../hooks/useOldLang'; import OptimizedVideo from '../ui/OptimizedVideo'; import Spinner from '../ui/Spinner'; @@ -56,7 +56,7 @@ const ProfilePhoto: FC = ({ // eslint-disable-next-line no-null/no-null const videoRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); const isDeleted = user && isDeletedUser(user); diff --git a/src/components/common/RecipientPicker.tsx b/src/components/common/RecipientPicker.tsx index ea021444b..366468bde 100644 --- a/src/components/common/RecipientPicker.tsx +++ b/src/components/common/RecipientPicker.tsx @@ -18,7 +18,7 @@ import { unique } from '../../util/iteratees'; import sortChatIds from './helpers/sortChatIds'; import useCurrentOrPrev from '../../hooks/useCurrentOrPrev'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import ChatOrUserPicker from './ChatOrUserPicker'; @@ -56,7 +56,7 @@ const RecipientPicker: FC = ({ onClose, onCloseAnimationEnd, }) => { - const lang = useLang(); + const lang = useOldLang(); const [search, setSearch] = useState(''); const ids = useMemo(() => { if (!isOpen) return undefined; diff --git a/src/components/common/ReportModal.tsx b/src/components/common/ReportModal.tsx index 4b7cba088..ef74b1da9 100644 --- a/src/components/common/ReportModal.tsx +++ b/src/components/common/ReportModal.tsx @@ -7,8 +7,8 @@ import type { ApiPhoto, ApiReportReason } from '../../api/types'; import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import InputText from '../ui/InputText'; @@ -77,7 +77,7 @@ const ReportModal: FC = ({ setDescription(e.target.value); }); - const lang = useLang(); + const lang = useOldLang(); const REPORT_OPTIONS: { value: ApiReportReason; label: string }[] = useMemo(() => [ { value: 'spam', label: lang('lng_report_reason_spam') }, diff --git a/src/components/common/SeenByModal.tsx b/src/components/common/SeenByModal.tsx index be03b81ad..8afdbbabf 100644 --- a/src/components/common/SeenByModal.tsx +++ b/src/components/common/SeenByModal.tsx @@ -3,11 +3,11 @@ import { getActions, withGlobal } from '../../global'; import { selectChatMessage, selectTabState } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; -import { formatDateAtTime } from '../../util/date/dateFormat'; +import { formatDateAtTime } from '../../util/dates/dateFormat'; import useCurrentOrPrev from '../../hooks/useCurrentOrPrev'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import ListItem from '../ui/ListItem'; @@ -35,7 +35,7 @@ function SeenByModal({ closeSeenByModal, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const renderingSeenByDates = useCurrentOrPrev(seenByDates, true); const memberIds = useMemo(() => { diff --git a/src/components/common/StickerButton.tsx b/src/components/common/StickerButton.tsx index bafca49f7..715604a55 100644 --- a/src/components/common/StickerButton.tsx +++ b/src/components/common/StickerButton.tsx @@ -15,9 +15,9 @@ import { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMe import useDynamicColorListener from '../../hooks/stickers/useDynamicColorListener'; import useContextMenuHandlers from '../../hooks/useContextMenuHandlers'; import { useIsIntersecting } from '../../hooks/useIntersectionObserver'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMenuPosition from '../../hooks/useMenuPosition'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Menu from '../ui/Menu'; @@ -96,7 +96,7 @@ const StickerButton = (null); // eslint-disable-next-line no-null/no-null const menuRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const hasCustomColor = sticker.shouldUseTextColor; const customColor = useDynamicColorListener(ref, !hasCustomColor); diff --git a/src/components/common/StickerSet.tsx b/src/components/common/StickerSet.tsx index f35fde3be..afe8619bc 100644 --- a/src/components/common/StickerSet.tsx +++ b/src/components/common/StickerSet.tsx @@ -24,9 +24,9 @@ import buildClassName from '../../util/buildClassName'; import useAppLayout from '../../hooks/useAppLayout'; import useFlag from '../../hooks/useFlag'; import { useIsIntersecting } from '../../hooks/useIntersectionObserver'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMediaTransition from '../../hooks/useMediaTransition'; +import useOldLang from '../../hooks/useOldLang'; import useResizeObserver from '../../hooks/useResizeObserver'; import useWindowSize from '../../hooks/window/useWindowSize'; @@ -127,7 +127,7 @@ const StickerSet: FC = ({ // eslint-disable-next-line no-null/no-null const sharedCanvasHqRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { width: windowWidth } = useWindowSize(); const [isConfirmModalOpen, openConfirmModal, closeConfirmModal] = useFlag(); const { isMobile } = useAppLayout(); diff --git a/src/components/common/StickerSetCard.tsx b/src/components/common/StickerSetCard.tsx index 3de8cc7e7..331feea46 100644 --- a/src/components/common/StickerSetCard.tsx +++ b/src/components/common/StickerSetCard.tsx @@ -7,7 +7,7 @@ import type { ObserveFn } from '../../hooks/useIntersectionObserver'; import { CHAT_HEIGHT_PX, STICKER_SIZE_GENERAL_SETTINGS } from '../../config'; import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import StickerSetCover from '../middle/composer/StickerSetCover'; import Button from '../ui/Button'; @@ -31,7 +31,7 @@ const StickerSetCard: FC = ({ observeIntersection, onClick, }) => { - const lang = useLang(); + const lang = useOldLang(); const firstSticker = stickerSet?.stickers?.[0]; diff --git a/src/components/common/StickerSetModal.tsx b/src/components/common/StickerSetModal.tsx index 7f6123b91..773c1af28 100644 --- a/src/components/common/StickerSetModal.tsx +++ b/src/components/common/StickerSetModal.tsx @@ -26,7 +26,7 @@ import renderText from './helpers/renderText'; import useAppLayout from '../../hooks/useAppLayout'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import useSchedule from '../../hooks/useSchedule'; import useScrolledState from '../../hooks/useScrolledState'; @@ -86,7 +86,7 @@ const StickerSetModal: FC = ({ // eslint-disable-next-line no-null/no-null const sharedCanvasRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); diff --git a/src/components/common/TopicChip.tsx b/src/components/common/TopicChip.tsx index 7d3bbb8a8..c52b73b76 100644 --- a/src/components/common/TopicChip.tsx +++ b/src/components/common/TopicChip.tsx @@ -8,7 +8,7 @@ import { getTopicColorCssVariable } from '../../util/forumColors'; import { REM } from './helpers/mediaDimensions'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import TopicIcon from './TopicIcon'; @@ -29,7 +29,7 @@ const TopicChip: FC = ({ className, onClick, }) => { - const lang = useLang(); + const lang = useOldLang(); return (
= ({ typingStatus, typingUser }) => { - const lang = useLang(); + const lang = useOldLang(); const typingUserName = typingUser && !typingUser.isSelf && getUserFirstOrLastName(typingUser); const content = lang(typingStatus.action) // Fix for translation "{user} is typing" diff --git a/src/components/common/UiLoader.tsx b/src/components/common/UiLoader.tsx index 85cc7e70a..fa69626f6 100644 --- a/src/components/common/UiLoader.tsx +++ b/src/components/common/UiLoader.tsx @@ -10,6 +10,7 @@ import { selectIsRightColumnShown, selectTabState } from '../../global/selectors import buildClassName from '../../util/buildClassName'; import { preloadImage } from '../../util/files'; import preloadFonts from '../../util/fonts'; +import { localizationReadyPromise } from '../../util/localization'; import * as mediaLoader from '../../util/mediaLoader'; import { Bundles, loadModule } from '../../util/moduleLoader'; import { pause } from '../../util/schedulers'; @@ -80,6 +81,7 @@ const preloadTasks = { .then(preloadFonts), preloadAvatars(), preloadImage(spoilerMaskPath), + localizationReadyPromise, ]), authPhoneNumber: () => Promise.all([ preloadFonts(), diff --git a/src/components/common/UnpinAllMessagesModal.tsx b/src/components/common/UnpinAllMessagesModal.tsx index c55028215..ed6ebaaa0 100644 --- a/src/components/common/UnpinAllMessagesModal.tsx +++ b/src/components/common/UnpinAllMessagesModal.tsx @@ -1,7 +1,7 @@ import type { FC } from '../../lib/teact/teact'; import React, { memo } from '../../lib/teact/teact'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Modal from '../ui/Modal'; @@ -20,7 +20,7 @@ const UnpinAllMessagesModal: FC = ({ onClose, onUnpin, }) => { - const lang = useLang(); + const lang = useOldLang(); return ( = ({ const { checkUsername, checkPublicLink } = getActions(); const [username, setUsername] = useState(currentUsername || ''); - const lang = useLang(); + const lang = useOldLang(); const langPrefix = asLink ? 'SetUrl' : 'Username'; const label = asLink ? lang('SetUrlPlaceholder') : lang('Username'); diff --git a/src/components/common/WebLink.tsx b/src/components/common/WebLink.tsx index cfaab6e68..5dd0e849b 100644 --- a/src/components/common/WebLink.tsx +++ b/src/components/common/WebLink.tsx @@ -10,13 +10,13 @@ import { getMessageWebPage, } from '../../global/helpers'; import buildClassName from '../../util/buildClassName'; -import { formatPastTimeShort } from '../../util/date/dateFormat'; +import { formatPastTimeShort } from '../../util/dates/dateFormat'; import trimText from '../../util/trimText'; import { renderMessageSummary } from './helpers/renderMessageText'; import renderText from './helpers/renderText'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Link from '../ui/Link'; import Media from './Media'; @@ -41,7 +41,7 @@ type ApiWebPageWithFormatted = const WebLink: FC = ({ message, senderTitle, isProtected, observeIntersection, onMessageClick, }) => { - const lang = useLang(); + const lang = useOldLang(); let linkData: ApiWebPageWithFormatted | undefined = getMessageWebPage(message); diff --git a/src/components/common/code/CodeOverlay.tsx b/src/components/common/code/CodeOverlay.tsx index a40714390..1bba85530 100644 --- a/src/components/common/code/CodeOverlay.tsx +++ b/src/components/common/code/CodeOverlay.tsx @@ -8,7 +8,7 @@ import buildClassName from '../../../util/buildClassName'; import { copyTextToClipboard } from '../../../util/clipboard'; import { areLinesWrapping } from '../helpers/renderText'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import useWindowSize from '../../../hooks/window/useWindowSize'; import styles from './CodeOverlay.module.scss'; @@ -27,7 +27,7 @@ const CodeOverlay: FC = ({ // eslint-disable-next-line no-null/no-null const ref = useRef(null); const windowSize = useWindowSize(); - const lang = useLang(); + const lang = useOldLang(); const [isWordWrap, setIsWordWrap] = useState(true); const [withWordWrapButton, setWithWordWrapButton] = useState(false); diff --git a/src/components/common/embedded/EmbeddedMessage.tsx b/src/components/common/embedded/EmbeddedMessage.tsx index 2710f3db3..04ab04da2 100644 --- a/src/components/common/embedded/EmbeddedMessage.tsx +++ b/src/components/common/embedded/EmbeddedMessage.tsx @@ -31,8 +31,8 @@ import { renderTextWithEntities } from '../helpers/renderTextWithEntities'; import { useFastClick } from '../../../hooks/useFastClick'; import { useIsIntersecting } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import useThumbnail from '../../../hooks/useThumbnail'; import useMessageTranslation from '../../middle/message/hooks/useMessageTranslation'; @@ -109,7 +109,7 @@ const EmbeddedMessage: FC = ({ chatTranslations, message?.chatId, shouldTranslate ? message?.id : undefined, requestedChatTranslationLanguage, ); - const lang = useLang(); + const lang = useOldLang(); const senderTitle = sender ? getSenderTitle(lang, sender) : (replyForwardInfo?.hiddenUserName || message?.forwardInfo?.hiddenUserName); diff --git a/src/components/common/embedded/EmbeddedStory.tsx b/src/components/common/embedded/EmbeddedStory.tsx index 7a3fe9b1e..49fd8c4d0 100644 --- a/src/components/common/embedded/EmbeddedStory.tsx +++ b/src/components/common/embedded/EmbeddedStory.tsx @@ -16,9 +16,9 @@ import renderText from '../helpers/renderText'; import { useFastClick } from '../../../hooks/useFastClick'; import { useIsIntersecting } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../icons/Icon'; @@ -45,7 +45,7 @@ const EmbeddedStory: FC = ({ }) => { const { showNotification } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); diff --git a/src/components/common/embedded/EmbeddedStoryForward.tsx b/src/components/common/embedded/EmbeddedStoryForward.tsx index 830da31cf..0148695e0 100644 --- a/src/components/common/embedded/EmbeddedStoryForward.tsx +++ b/src/components/common/embedded/EmbeddedStoryForward.tsx @@ -20,8 +20,8 @@ import renderText from '../helpers/renderText'; import { renderTextWithEntities } from '../helpers/renderTextWithEntities'; import { useFastClick } from '../../../hooks/useFastClick'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../icons/Icon'; import EmojiIconBackground from './EmojiIconBackground'; @@ -48,7 +48,7 @@ const EmbeddedStoryForward: FC = ({ // eslint-disable-next-line no-null/no-null const ref = useRef(null); - const lang = useLang(); + const lang = useOldLang(); useEffect(() => { if (!story && forwardInfo.fromPeerId && forwardInfo.storyId) { diff --git a/src/components/common/embedded/EmojiIconBackground.tsx b/src/components/common/embedded/EmojiIconBackground.tsx index e5e487ce4..a9a07304f 100644 --- a/src/components/common/embedded/EmojiIconBackground.tsx +++ b/src/components/common/embedded/EmojiIconBackground.tsx @@ -10,9 +10,9 @@ import { REM } from '../helpers/mediaDimensions'; import useDynamicColorListener from '../../../hooks/stickers/useDynamicColorListener'; import { useThrottleForHeavyAnimation } from '../../../hooks/useHeavyAnimationCheck'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import useResizeObserver from '../../../hooks/useResizeObserver'; import useDevicePixelRatio from '../../../hooks/window/useDevicePixelRatio'; import useCustomEmoji from '../hooks/useCustomEmoji'; @@ -75,7 +75,7 @@ const EmojiIconBackground = ({ const dpr = useDevicePixelRatio(); - const lang = useLang(); + const lang = useOldLang(); const { customEmoji } = useCustomEmoji(emojiDocumentId); const previewMediaHash = customEmoji ? getStickerPreviewHash(customEmoji.id) : undefined; diff --git a/src/components/common/helpers/renderActionMessageText.tsx b/src/components/common/helpers/renderActionMessageText.tsx index 053cf2ea8..bb0418c16 100644 --- a/src/components/common/helpers/renderActionMessageText.tsx +++ b/src/components/common/helpers/renderActionMessageText.tsx @@ -4,7 +4,7 @@ import type { ApiChat, ApiGroupCall, ApiMessage, ApiTopic, ApiUser, } from '../../../api/types'; import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; -import type { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useOldLang'; import type { TextPart } from '../../../types'; import { diff --git a/src/components/common/helpers/renderMessageText.ts b/src/components/common/helpers/renderMessageText.ts index 6d248b6ba..a2877e7e8 100644 --- a/src/components/common/helpers/renderMessageText.ts +++ b/src/components/common/helpers/renderMessageText.ts @@ -1,5 +1,5 @@ import type { ApiMessage } from '../../../api/types'; -import type { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useOldLang'; import type { TextPart } from '../../../types'; import { ApiMessageEntityTypes } from '../../../api/types'; diff --git a/src/components/common/helpers/renderText.tsx b/src/components/common/helpers/renderText.tsx index cb80ec8da..8f774fe2b 100644 --- a/src/components/common/helpers/renderText.tsx +++ b/src/components/common/helpers/renderText.tsx @@ -31,7 +31,7 @@ const SIMPLE_MARKDOWN_REGEX = /(\*\*|__).+?\1/g; export default function renderText( part: TextPart, filters: Array = ['emoji'], - params?: { highlight?: string; quote?: string }, + params?: { highlight?: string; quote?: string; markdownPostProcessor?: (part: string) => TeactNode }, ): TeactNode[] { if (typeof part !== 'string') { return [part]; @@ -73,7 +73,7 @@ export default function renderText( return addLinks(text, true); case 'simple_markdown': - return replaceSimpleMarkdown(text, 'jsx'); + return replaceSimpleMarkdown(text, 'jsx', params?.markdownPostProcessor); case 'simple_markdown_html': return replaceSimpleMarkdown(text, 'html'); @@ -266,7 +266,12 @@ function addLinks(textParts: TextPart[], allowOnlyTgLinks?: boolean): TextPart[] }, []); } -function replaceSimpleMarkdown(textParts: TextPart[], type: 'jsx' | 'html'): TextPart[] { +function replaceSimpleMarkdown( + textParts: TextPart[], type: 'jsx' | 'html', postProcessor?: (part: string) => TeactNode, +): TextPart[] { + // Currently supported only for JSX. If needed, add typings to support HTML as well. + const postProcess = postProcessor || ((part: string) => part); + return textParts.reduce((result, part) => { if (typeof part !== 'string') { result.push(part); @@ -275,14 +280,14 @@ function replaceSimpleMarkdown(textParts: TextPart[], type: 'jsx' | 'html'): Tex const parts = part.split(SIMPLE_MARKDOWN_REGEX); const entities: string[] = part.match(SIMPLE_MARKDOWN_REGEX) || []; - result.push(parts[0]); + result.push(postProcess(parts[0])); return entities.reduce((entityResult: TextPart[], entity, i) => { if (type === 'jsx') { entityResult.push( entity.startsWith('**') - ? {entity.replace(/\*\*/g, '')} - : {entity.replace(/__/g, '')}, + ? {postProcess(entity.replace(/\*\*/g, ''))} + : {postProcess(entity.replace(/__/g, ''))}, ); } else { entityResult.push( @@ -294,7 +299,7 @@ function replaceSimpleMarkdown(textParts: TextPart[], type: 'jsx' | 'html'): Tex const index = i * 2 + 2; if (parts[index]) { - entityResult.push(parts[index]); + entityResult.push(postProcess(parts[index])); } return entityResult; diff --git a/src/components/common/helpers/renderTextWithEntities.tsx b/src/components/common/helpers/renderTextWithEntities.tsx index ff2740778..d08c23d5f 100644 --- a/src/components/common/helpers/renderTextWithEntities.tsx +++ b/src/components/common/helpers/renderTextWithEntities.tsx @@ -9,7 +9,7 @@ import { ApiMessageEntityTypes } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import { copyTextToClipboard } from '../../../util/clipboard'; -import { translate } from '../../../util/langProvider'; +import { oldTranslate } from '../../../util/oldLangProvider'; import { buildCustomEmojiHtmlFromEntity } from '../../middle/composer/helpers/customEmoji'; import renderText from './renderText'; @@ -663,6 +663,6 @@ function handleHashtagClick(e: React.MouseEvent) { function handleCodeClick(e: React.MouseEvent) { copyTextToClipboard(e.currentTarget.innerText); getActions().showNotification({ - message: translate('TextCopied'), + message: oldTranslate('TextCopied'), }); } diff --git a/src/components/common/profile/BusinessHours.tsx b/src/components/common/profile/BusinessHours.tsx index 1c5b8d2cd..8f4ef6e29 100644 --- a/src/components/common/profile/BusinessHours.tsx +++ b/src/components/common/profile/BusinessHours.tsx @@ -6,18 +6,18 @@ import type { ApiBusinessWorkHours } from '../../../api/types'; import { requestMeasure, requestMutation } from '../../../lib/fasterdom/fasterdom'; import buildClassName from '../../../util/buildClassName'; -import { formatTime, formatWeekday } from '../../../util/date/dateFormat'; +import { formatTime, formatWeekday } from '../../../util/dates/dateFormat'; import { getUtcOffset, getWeekStart, shiftTimeRanges, splitDays, -} from '../../../util/date/workHours'; +} from '../../../util/dates/workHours'; import { IS_TOUCH_ENV } from '../../../util/windowEnvironment'; import useInterval from '../../../hooks/schedulers/useInterval'; import useDerivedState from '../../../hooks/useDerivedState'; import useFlag from '../../../hooks/useFlag'; import useForceUpdate from '../../../hooks/useForceUpdate'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useSelectorSignal from '../../../hooks/useSelectorSignal'; import ListItem from '../../ui/ListItem'; @@ -39,7 +39,7 @@ const BusinessHours = ({ const transitionRef = useRef(null); const [isExpanded, expand, collapse] = useFlag(false); const [isMyTime, showInMyTime, showInLocalTime] = useFlag(false); - const lang = useLang(); + const lang = useOldLang(); const forceUpdate = useForceUpdate(); useInterval(forceUpdate, 60 * 1000); diff --git a/src/components/common/profile/ChatExtra.tsx b/src/components/common/profile/ChatExtra.tsx index 743027de4..63f04aced 100644 --- a/src/components/common/profile/ChatExtra.tsx +++ b/src/components/common/profile/ChatExtra.tsx @@ -37,9 +37,9 @@ import formatUsername from '../helpers/formatUsername'; import renderText from '../helpers/renderText'; import useEffectWithPrevDeps from '../../../hooks/useEffectWithPrevDeps'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import useDevicePixelRatio from '../../../hooks/window/useDevicePixelRatio'; import Chat from '../../left/main/Chat'; @@ -120,7 +120,7 @@ const ChatExtra: FC = ({ personalChannelMessageId, birthday, } = userFullInfo || {}; - const lang = useLang(); + const lang = useOldLang(); const [areNotificationsEnabled, setAreNotificationsEnabled] = useState(!isMuted); diff --git a/src/components/common/profile/UserBirthday.tsx b/src/components/common/profile/UserBirthday.tsx index 77a52b021..934667ec4 100644 --- a/src/components/common/profile/UserBirthday.tsx +++ b/src/components/common/profile/UserBirthday.tsx @@ -11,7 +11,7 @@ import { requestMeasure } from '../../../lib/fasterdom/fasterdom'; import { getStickerMediaHash } from '../../../global/helpers'; import { selectIsPremiumPurchaseBlocked } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; -import { formatDateToString } from '../../../util/date/dateFormat'; +import { formatDateToString } from '../../../util/dates/dateFormat'; import { buildCollectionByKey } from '../../../util/iteratees'; import * as mediaLoader from '../../../util/mediaLoader'; import { IS_OFFSET_PATH_SUPPORTED } from '../../../util/windowEnvironment'; @@ -19,8 +19,8 @@ import renderText from '../helpers/renderText'; import useTimeout from '../../../hooks/schedulers/useTimeout'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import ListItem from '../../ui/ListItem'; import StickerView from '../StickerView'; @@ -59,7 +59,7 @@ const UserBirthday = ({ const animationPlayedRef = useRef(false); const [isPlayingAnimation, playAnimation, stopAnimation] = useFlag(); - const lang = useLang(); + const lang = useOldLang(); const { formattedDate, diff --git a/src/components/left/ArchivedChats.tsx b/src/components/left/ArchivedChats.tsx index 418bcb0e2..cde702e3c 100644 --- a/src/components/left/ArchivedChats.tsx +++ b/src/components/left/ArchivedChats.tsx @@ -12,8 +12,8 @@ import { ANIMATION_DURATION } from '../story/helpers/ribbonAnimation'; import useForumPanelRender from '../../hooks/useForumPanelRender'; import useHistoryBack from '../../hooks/useHistoryBack'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import useShowTransition from '../../hooks/useShowTransition'; import useLeftHeaderButtonRtlForumTransition from './main/hooks/useLeftHeaderButtonRtlForumTransition'; @@ -51,7 +51,7 @@ const ArchivedChats: FC = ({ foldersDispatch, }) => { const { updateArchiveSettings } = getActions(); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/ChatFolderModal.tsx b/src/components/left/ChatFolderModal.tsx index 46eeb1819..05f3573eb 100644 --- a/src/components/left/ChatFolderModal.tsx +++ b/src/components/left/ChatFolderModal.tsx @@ -8,7 +8,7 @@ import type { ApiChatFolder } from '../../api/types'; import { ALL_FOLDER_ID } from '../../config'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import CheckboxGroup from '../ui/CheckboxGroup'; @@ -36,7 +36,7 @@ const ChatFolderModal: FC = ({ }) => { const { editChatFolders } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const initialSelectedFolderIds = useMemo(() => { if (!foldersById) { diff --git a/src/components/left/ConnectionStatusOverlay.tsx b/src/components/left/ConnectionStatusOverlay.tsx index bb48fb9f3..77304eaf6 100644 --- a/src/components/left/ConnectionStatusOverlay.tsx +++ b/src/components/left/ConnectionStatusOverlay.tsx @@ -3,7 +3,7 @@ import React, { memo } from '../../lib/teact/teact'; import type { ConnectionStatus } from '../../hooks/useConnectionStatus'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Spinner from '../ui/Spinner'; @@ -22,7 +22,7 @@ const ConnectionStatusOverlay: FC = ({ connectionStatusText, onClick, }) => { - const lang = useLang(); + const lang = useOldLang(); return (
diff --git a/src/components/left/MuteChatModal.tsx b/src/components/left/MuteChatModal.tsx index 0eb1d8385..caba62969 100644 --- a/src/components/left/MuteChatModal.tsx +++ b/src/components/left/MuteChatModal.tsx @@ -6,7 +6,7 @@ import { getActions } from '../../global'; import { MAX_INT_32 } from '../../config'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Modal from '../ui/Modal'; @@ -39,7 +39,7 @@ const MuteChatModal: FC = ({ const [muteUntilOption, setMuteUntilOption] = useState(MuteDuration.Forever); const { updateChatMutedState, updateTopicMutedState } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const muteForOptions = useMemo(() => [ { label: lang('MuteFor.Hours', 1), value: MuteDuration.OneHour }, diff --git a/src/components/left/NewChatButton.tsx b/src/components/left/NewChatButton.tsx index 7ea00306c..7b4dcbb8a 100644 --- a/src/components/left/NewChatButton.tsx +++ b/src/components/left/NewChatButton.tsx @@ -5,7 +5,7 @@ import React, { import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Menu from '../ui/Menu'; @@ -34,7 +34,7 @@ const NewChatButton: FC = ({ } }, [isShown]); - const lang = useLang(); + const lang = useOldLang(); const fabClassName = buildClassName( 'NewChatButton', diff --git a/src/components/left/main/Archive.tsx b/src/components/left/main/Archive.tsx index 82c71f6c0..9a85c8de3 100644 --- a/src/components/left/main/Archive.tsx +++ b/src/components/left/main/Archive.tsx @@ -12,7 +12,7 @@ import { formatIntegerCompact } from '../../../util/textFormat'; import renderText from '../../common/helpers/renderText'; import { useFolderManagerForOrderedIds, useFolderManagerForUnreadCounters } from '../../../hooks/useFolderManager'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Badge from '../../ui/Badge'; import ListItem, { type MenuItemContextAction } from '../../ui/ListItem'; @@ -33,7 +33,7 @@ const Archive: FC = ({ onClick, }) => { const { updateArchiveSettings } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const orderedChatIds = useFolderManagerForOrderedIds(ARCHIVED_FOLDER_ID); const unreadCounters = useFolderManagerForUnreadCounters(); diff --git a/src/components/left/main/ChatFolders.tsx b/src/components/left/main/ChatFolders.tsx index 0b473540c..6370d3a5b 100644 --- a/src/components/left/main/ChatFolders.tsx +++ b/src/components/left/main/ChatFolders.tsx @@ -22,8 +22,8 @@ import { IS_TOUCH_ENV } from '../../../util/windowEnvironment'; import { useFolderManagerForUnreadCounters } from '../../../hooks/useFolderManager'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useShowTransition from '../../../hooks/useShowTransition'; import StoryRibbon from '../../story/StoryRibbon'; @@ -93,7 +93,7 @@ const ChatFolders: FC = ({ // eslint-disable-next-line no-null/no-null const transitionRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); useEffect(() => { loadChatFolders(); diff --git a/src/components/left/main/ContactList.tsx b/src/components/left/main/ContactList.tsx index 137fe9a52..9bdae448d 100644 --- a/src/components/left/main/ContactList.tsx +++ b/src/components/left/main/ContactList.tsx @@ -10,7 +10,7 @@ import { filterUsersByName, sortUserIds } from '../../../global/helpers'; import useAppLayout from '../../../hooks/useAppLayout'; import useHistoryBack from '../../../hooks/useHistoryBack'; import useInfiniteScroll from '../../../hooks/useInfiniteScroll'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import PrivateChatInfo from '../../common/PrivateChatInfo'; import FloatingActionButton from '../../ui/FloatingActionButton'; @@ -43,7 +43,7 @@ const ContactList: FC = ({ openNewContactDialog, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); useHistoryBack({ diff --git a/src/components/left/main/EmptyFolder.tsx b/src/components/left/main/EmptyFolder.tsx index 8b20a22b1..3b40e26d0 100644 --- a/src/components/left/main/EmptyFolder.tsx +++ b/src/components/left/main/EmptyFolder.tsx @@ -9,7 +9,7 @@ import { SettingsScreens } from '../../../types'; import { selectAnimatedEmoji, selectChatFolder } from '../../../global/selectors'; import useAppLayout from '../../../hooks/useAppLayout'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import AnimatedIconFromSticker from '../../common/AnimatedIconFromSticker'; import Button from '../../ui/Button'; @@ -33,7 +33,7 @@ const ICON_SIZE = 96; const EmptyFolder: FC = ({ chatFolder, animatedEmoji, foldersDispatch, onSettingsScreenSelect, }) => { - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); const handleEditFolder = useCallback(() => { diff --git a/src/components/left/main/EmptyForum.tsx b/src/components/left/main/EmptyForum.tsx index adbfee248..ea297e29e 100644 --- a/src/components/left/main/EmptyForum.tsx +++ b/src/components/left/main/EmptyForum.tsx @@ -10,7 +10,7 @@ import buildClassName from '../../../util/buildClassName'; import { REM } from '../../common/helpers/mediaDimensions'; import useAppLayout from '../../../hooks/useAppLayout'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import AnimatedIconFromSticker from '../../common/AnimatedIconFromSticker'; import Button from '../../ui/Button'; @@ -33,7 +33,7 @@ const EmptyForum: FC = ({ }) => { const { openCreateTopicPanel } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); const handleCreateTopic = useCallback(() => { diff --git a/src/components/left/main/ForumPanel.tsx b/src/components/left/main/ForumPanel.tsx index cfb132d54..904e33a05 100644 --- a/src/components/left/main/ForumPanel.tsx +++ b/src/components/left/main/ForumPanel.tsx @@ -26,8 +26,8 @@ import { dispatchHeavyAnimationEvent } from '../../../hooks/useHeavyAnimationChe import useHistoryBack from '../../../hooks/useHistoryBack'; import useInfiniteScroll from '../../../hooks/useInfiniteScroll'; import { useIntersectionObserver, useOnIntersect } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import useOrderDiff from './hooks/useOrderDiff'; @@ -88,7 +88,7 @@ const ForumPanel: FC = ({ }, [chat, loadTopics]); const [isScrolled, setIsScrolled] = useState(false); - const lang = useLang(); + const lang = useOldLang(); const handleClose = useLastCallback(() => { closeForumPanel(); diff --git a/src/components/left/main/LeftMain.tsx b/src/components/left/main/LeftMain.tsx index 353d5ff58..125d7e50f 100644 --- a/src/components/left/main/LeftMain.tsx +++ b/src/components/left/main/LeftMain.tsx @@ -13,8 +13,8 @@ import buildClassName from '../../../util/buildClassName'; import { IS_ELECTRON, IS_TOUCH_ENV } from '../../../util/windowEnvironment'; import useForumPanelRender from '../../../hooks/useForumPanelRender'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useShowTransition from '../../../hooks/useShowTransition'; import Button from '../../ui/Button'; @@ -162,7 +162,7 @@ const LeftMain: FC = ({ }; }, [content]); - const lang = useLang(); + const lang = useOldLang(); return (
= ({ requestNextSettingsScreen, } = getActions(); + const oldLang = useOldLang(); const lang = useLang(); const { isMobile } = useAppLayout(); @@ -126,7 +128,7 @@ const LeftMainHeader: FC = ({ }, [searchDate]); const { connectionStatus, connectionStatusText, connectionStatusPosition } = useConnectionStatus( - lang, + oldLang, connectionState, isSyncing || isFetchingDifference, isMessageListOpen, @@ -161,7 +163,7 @@ const LeftMainHeader: FC = ({ className={isOpen ? 'active' : ''} // eslint-disable-next-line react/jsx-no-bind onClick={hasMenu ? onTrigger : () => onReset()} - ariaLabel={hasMenu ? lang('AccDescrOpenMenu2') : 'Return to chat list'} + ariaLabel={hasMenu ? oldLang('AccDescrOpenMenu2') : 'Return to chat list'} >
= ({ /> ); - }, [hasMenu, isMobile, lang, onReset, shouldSkipTransition]); + }, [hasMenu, isMobile, oldLang, onReset, shouldSkipTransition]); const handleSearchFocus = useLastCallback(() => { if (!searchQuery) { @@ -242,20 +244,20 @@ const LeftMainHeader: FC = ({ return (
- {lang.isRtl &&
} + {oldLang.isRtl &&
} = ({ ripple={!isMobile} size="smaller" color="translucent" - ariaLabel={`${lang('ShortcutsController.Others.LockByPasscode')} (Ctrl+Shift+L)`} + ariaLabel={`${oldLang('ShortcutsController.Others.LockByPasscode')} (Ctrl+Shift+L)`} onClick={handleLockScreen} className={buildClassName(!isCurrentUserPremium && 'extra-spacing')} > diff --git a/src/components/left/main/LeftSideMenuItems.tsx b/src/components/left/main/LeftSideMenuItems.tsx index a7bc34c00..ae999bebe 100644 --- a/src/components/left/main/LeftSideMenuItems.tsx +++ b/src/components/left/main/LeftSideMenuItems.tsx @@ -28,6 +28,7 @@ import { IS_ELECTRON } from '../../../util/windowEnvironment'; import { useFolderManagerForUnreadCounters } from '../../../hooks/useFolderManager'; import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import AttachBotItem from '../../middle/composer/AttachBotItem'; import MenuItem from '../../ui/MenuItem'; @@ -70,6 +71,7 @@ const LeftSideMenuItems = ({ openUrl, openChatWithInfo, } = getActions(); + const oldLang = useOldLang(); const lang = useLang(); const animationLevelValue = animationLevel !== ANIMATION_LEVEL_MIN @@ -117,7 +119,7 @@ const LeftSideMenuItems = ({ }); const handleOpenTipsChat = useLastCallback(() => { - openChatByUsername({ username: lang('Settings.TipsUsername') }); + openChatByUsername({ username: oldLang('Settings.TipsUsername') }); }); const handleBugReportClick = useLastCallback(() => { @@ -134,14 +136,14 @@ const LeftSideMenuItems = ({ icon="saved-messages" onClick={handleSelectSaved} > - {lang('SavedMessages')} + {oldLang('SavedMessages')} {archiveSettings.isHidden && ( - {lang('ArchivedChats')} + {oldLang('ArchivedChats')} {archivedUnreadChatsCount > 0 && (
{archivedUnreadChatsCount}
)} @@ -151,7 +153,7 @@ const LeftSideMenuItems = ({ icon="user" onClick={onSelectContacts} > - {lang('Contacts')} + {oldLang('Contacts')}
{bots.map((bot) => ( - {lang('Settings.MyStories')} + {oldLang('Settings.MyStories')} - {lang('Settings')} + {oldLang('Settings')} - {lang('lng_menu_night_mode')} + {oldLang('lng_menu_night_mode')} @@ -191,27 +193,27 @@ const LeftSideMenuItems = ({ icon="animations" onClick={handleAnimationLevelChange} > - {lang('Appearance.Animations').toLowerCase()} + {oldLang('Appearance.Animations').toLowerCase()} - {lang('TelegramFeatures')} + {oldLang('TelegramFeatures')} - Report Bug + {lang('MenuReportBug')} {IS_BETA && ( - Beta Changelog + {lang('MenuBetaChangelog')} )} {withOtherVersions && ( @@ -221,7 +223,7 @@ const LeftSideMenuItems = ({ href={`${WEB_VERSION_BASE}k`} onClick={handleSwitchToWebK} > - Switch to K Version + {lang('MenuSwitchToK')} )} {canInstall && ( @@ -229,7 +231,7 @@ const LeftSideMenuItems = ({ icon="install" onClick={getPromptInstall()} > - Install App + {lang('MenuInstallApp')} )} diff --git a/src/components/left/main/Topic.tsx b/src/components/left/main/Topic.tsx index d6d5c98de..5be750603 100644 --- a/src/components/left/main/Topic.tsx +++ b/src/components/left/main/Topic.tsx @@ -30,8 +30,8 @@ import { IS_OPEN_IN_NEW_TAB_SUPPORTED } from '../../../util/windowEnvironment'; import renderText from '../../common/helpers/renderText'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useChatListEntry from './hooks/useChatListEntry'; import useTopicContextActions from './hooks/useTopicContextActions'; @@ -99,7 +99,7 @@ const Topic: FC = ({ setViewForumAsMessages, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag(); const [isMuteModalOpen, openMuteModal, closeMuteModal] = useFlag(); diff --git a/src/components/left/main/UnconfirmedSession.tsx b/src/components/left/main/UnconfirmedSession.tsx index 614ce99e1..6862ab463 100644 --- a/src/components/left/main/UnconfirmedSession.tsx +++ b/src/components/left/main/UnconfirmedSession.tsx @@ -3,8 +3,8 @@ import { getActions } from '../../../global'; import type { ApiSession } from '../../../api/types'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useResizeObserver from '../../../hooks/useResizeObserver'; import Button from '../../ui/Button'; @@ -20,7 +20,7 @@ const UnconfirmedSession = ({ sessions, onHeightChange } : OwnProps) => { const { changeSessionSettings, terminateAuthorization, showNotification } = getActions(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); - const lang = useLang(); + const lang = useOldLang(); useResizeObserver(ref, (entry) => { const height = entry.borderBoxSize?.[0]?.blockSize || entry.contentRect.height; diff --git a/src/components/left/main/hooks/useChatListEntry.tsx b/src/components/left/main/hooks/useChatListEntry.tsx index fb390f60e..9a67944e2 100644 --- a/src/components/left/main/hooks/useChatListEntry.tsx +++ b/src/components/left/main/hooks/useChatListEntry.tsx @@ -8,7 +8,7 @@ import type { } from '../../../../api/types'; import type { ApiDraft } from '../../../../global/types'; import type { ObserveFn } from '../../../../hooks/useIntersectionObserver'; -import type { LangFn } from '../../../../hooks/useLang'; +import type { LangFn } from '../../../../hooks/useOldLang'; import { ANIMATION_END_DELAY, CHAT_HEIGHT_PX } from '../../../../config'; import { requestMutation } from '../../../../lib/fasterdom/fasterdom'; @@ -33,8 +33,8 @@ import { renderTextWithEntities } from '../../../common/helpers/renderTextWithEn import { ChatAnimationTypes } from './useChatAnimationType'; import useEnsureMessage from '../../../../hooks/useEnsureMessage'; -import useLang from '../../../../hooks/useLang'; import useMedia from '../../../../hooks/useMedia'; +import useOldLang from '../../../../hooks/useOldLang'; import ChatForumLastMessage from '../../../common/ChatForumLastMessage'; import MessageSummary from '../../../common/MessageSummary'; @@ -80,7 +80,7 @@ export default function useChatListEntry({ orderDiff: number; withInterfaceAnimations?: boolean; }) { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); diff --git a/src/components/left/main/hooks/useTopicContextActions.ts b/src/components/left/main/hooks/useTopicContextActions.ts index 3a180f23e..c1a882a1e 100644 --- a/src/components/left/main/hooks/useTopicContextActions.ts +++ b/src/components/left/main/hooks/useTopicContextActions.ts @@ -8,7 +8,7 @@ import { getCanManageTopic, getHasAdminRight } from '../../../../global/helpers' import { compact } from '../../../../util/iteratees'; import { IS_OPEN_IN_NEW_TAB_SUPPORTED } from '../../../../util/windowEnvironment'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; export default function useTopicContextActions({ topic, @@ -25,7 +25,7 @@ export default function useTopicContextActions({ handleDelete?: NoneToVoidFunction; handleMute?: NoneToVoidFunction; }) { - const lang = useLang(); + const lang = useOldLang(); return useMemo(() => { const { diff --git a/src/components/left/newChat/NewChatStep1.tsx b/src/components/left/newChat/NewChatStep1.tsx index 89a953f5f..bea355c2f 100644 --- a/src/components/left/newChat/NewChatStep1.tsx +++ b/src/components/left/newChat/NewChatStep1.tsx @@ -8,7 +8,7 @@ import { unique } from '../../../util/iteratees'; import sortChatIds from '../../common/helpers/sortChatIds'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Picker from '../../common/Picker'; import Button from '../../ui/Button'; @@ -48,7 +48,7 @@ const NewChatStep1: FC = ({ setGlobalSearchQuery, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/newChat/NewChatStep2.tsx b/src/components/left/newChat/NewChatStep2.tsx index aa9f24143..6a1a3efc2 100644 --- a/src/components/left/newChat/NewChatStep2.tsx +++ b/src/components/left/newChat/NewChatStep2.tsx @@ -11,7 +11,7 @@ import { getUserFirstOrLastName } from '../../../global/helpers'; import { selectTabState } from '../../../global/selectors'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import PrivateChatInfo from '../../common/PrivateChatInfo'; import AvatarEditable from '../../ui/AvatarEditable'; @@ -50,7 +50,7 @@ const NewChatStep2: FC = ({ createChannel, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/search/AudioResults.tsx b/src/components/left/search/AudioResults.tsx index 56c789d3b..5d2a40af5 100644 --- a/src/components/left/search/AudioResults.tsx +++ b/src/components/left/search/AudioResults.tsx @@ -7,13 +7,13 @@ import { AudioOrigin, LoadMoreDirection } from '../../../types'; import { SLIDE_TRANSITION_DURATION } from '../../../config'; import buildClassName from '../../../util/buildClassName'; -import { formatMonthAndYear, toYearMonth } from '../../../util/date/dateFormat'; +import { formatMonthAndYear, toYearMonth } from '../../../util/dates/dateFormat'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; import { throttle } from '../../../util/schedulers'; import { createMapStateToProps } from './helpers/createMapStateToProps'; import { getSenderName } from './helpers/getSenderName'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import useAsyncRendering from '../../right/hooks/useAsyncRendering'; import Audio from '../../common/Audio'; @@ -45,7 +45,7 @@ const AudioResults: FC = ({ openAudioPlayer, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const currentType = isVoice ? 'voice' : 'audio'; const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => { if (direction === LoadMoreDirection.Backwards) { diff --git a/src/components/left/search/ChatMessage.tsx b/src/components/left/search/ChatMessage.tsx index 2619940b2..7a5c1a9f7 100644 --- a/src/components/left/search/ChatMessage.tsx +++ b/src/components/left/search/ChatMessage.tsx @@ -6,7 +6,7 @@ import type { ApiChat, ApiMessage, ApiMessageOutgoingStatus, ApiUser, } from '../../../api/types'; -import type { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useOldLang'; import { getMessageIsSpoiler, @@ -19,13 +19,13 @@ import { } from '../../../global/helpers'; import { selectChat, selectUser } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; -import { formatPastTimeShort } from '../../../util/date/dateFormat'; +import { formatPastTimeShort } from '../../../util/dates/dateFormat'; import { renderMessageSummary } from '../../common/helpers/renderMessageText'; import useAppLayout from '../../../hooks/useAppLayout'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import useSelectWithEnter from '../../../hooks/useSelectWithEnter'; import Avatar from '../../common/Avatar'; @@ -65,7 +65,7 @@ const ChatMessage: FC = ({ focusMessage({ chatId, messageId: message.id, shouldReplaceHistory: true }); }); - const lang = useLang(); + const lang = useOldLang(); const buttonRef = useSelectWithEnter(handleClick); diff --git a/src/components/left/search/ChatMessageResults.tsx b/src/components/left/search/ChatMessageResults.tsx index b4d5e0438..c4fcbba65 100644 --- a/src/components/left/search/ChatMessageResults.tsx +++ b/src/components/left/search/ChatMessageResults.tsx @@ -11,7 +11,7 @@ import { throttle } from '../../../util/schedulers'; import { renderMessageSummary } from '../../common/helpers/renderMessageText'; import useAppLayout from '../../../hooks/useAppLayout'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import NothingFound from '../../common/NothingFound'; import InfiniteScroll from '../../ui/InfiniteScroll'; @@ -52,7 +52,7 @@ const ChatMessageResults: FC = ({ }) => { const { searchMessagesGlobal, openThread } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); const handleLoadMore = useCallback(({ direction }: { direction: LoadMoreDirection }) => { diff --git a/src/components/left/search/ChatResults.tsx b/src/components/left/search/ChatResults.tsx index 496366b7f..6c2ab51c8 100644 --- a/src/components/left/search/ChatResults.tsx +++ b/src/components/left/search/ChatResults.tsx @@ -24,7 +24,7 @@ import sortChatIds from '../../common/helpers/sortChatIds'; import useAppLayout from '../../../hooks/useAppLayout'; import useEffectOnce from '../../../hooks/useEffectOnce'; import useHorizontalScroll from '../../../hooks/useHorizontalScroll'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import NothingFound from '../../common/NothingFound'; import PickerSelectedItem from '../../common/PickerSelectedItem'; @@ -87,7 +87,7 @@ const ChatResults: FC = ({ // eslint-disable-next-line no-null/no-null const chatSelectionRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); const [shouldShowMoreLocal, setShouldShowMoreLocal] = useState(false); diff --git a/src/components/left/search/DateSuggest.tsx b/src/components/left/search/DateSuggest.tsx index baf065c65..0c64aeae1 100644 --- a/src/components/left/search/DateSuggest.tsx +++ b/src/components/left/search/DateSuggest.tsx @@ -1,7 +1,7 @@ import type { FC } from '../../../lib/teact/teact'; import React, { memo, useMemo } from '../../../lib/teact/teact'; -import { formatDateToString } from '../../../util/date/dateFormat'; +import { formatDateToString } from '../../../util/dates/dateFormat'; import './DateSuggest.scss'; diff --git a/src/components/left/search/FileResults.tsx b/src/components/left/search/FileResults.tsx index bcca2f592..6a5fb6cfe 100644 --- a/src/components/left/search/FileResults.tsx +++ b/src/components/left/search/FileResults.tsx @@ -11,14 +11,14 @@ import { LoadMoreDirection } from '../../../types'; import { SLIDE_TRANSITION_DURATION } from '../../../config'; import { getMessageDocument } from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; -import { formatMonthAndYear, toYearMonth } from '../../../util/date/dateFormat'; +import { formatMonthAndYear, toYearMonth } from '../../../util/dates/dateFormat'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; import { throttle } from '../../../util/schedulers'; import { createMapStateToProps } from './helpers/createMapStateToProps'; import { getSenderName } from './helpers/getSenderName'; import { useIntersectionObserver } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import useAsyncRendering from '../../right/hooks/useAsyncRendering'; import Document from '../../common/Document'; @@ -53,7 +53,7 @@ const FileResults: FC = ({ // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { observe: observeIntersectionForMedia } = useIntersectionObserver({ rootRef: containerRef, diff --git a/src/components/left/search/LeftSearch.tsx b/src/components/left/search/LeftSearch.tsx index c1844f3c9..2ec21b4ed 100644 --- a/src/components/left/search/LeftSearch.tsx +++ b/src/components/left/search/LeftSearch.tsx @@ -10,12 +10,12 @@ import { getActions, withGlobal } from '../../../global'; import { GlobalSearchContent } from '../../../types'; import { selectTabState } from '../../../global/selectors'; -import { parseDateString } from '../../../util/date/dateFormat'; +import { parseDateString } from '../../../util/dates/dateFormat'; import useHistoryBack from '../../../hooks/useHistoryBack'; import useKeyboardListNavigation from '../../../hooks/useKeyboardListNavigation'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import TabList from '../../ui/TabList'; import Transition from '../../ui/Transition'; @@ -68,7 +68,7 @@ const LeftSearch: FC = ({ setGlobalSearchDate, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [activeTab, setActiveTab] = useState(currentContent); const dateSearchQuery = useMemo(() => parseDateString(searchQuery), [searchQuery]); diff --git a/src/components/left/search/LinkResults.tsx b/src/components/left/search/LinkResults.tsx index 638947415..0c2dc058e 100644 --- a/src/components/left/search/LinkResults.tsx +++ b/src/components/left/search/LinkResults.tsx @@ -9,14 +9,14 @@ import { LoadMoreDirection } from '../../../types'; import { SLIDE_TRANSITION_DURATION } from '../../../config'; import buildClassName from '../../../util/buildClassName'; -import { formatMonthAndYear, toYearMonth } from '../../../util/date/dateFormat'; +import { formatMonthAndYear, toYearMonth } from '../../../util/dates/dateFormat'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; import { throttle } from '../../../util/schedulers'; import { createMapStateToProps } from './helpers/createMapStateToProps'; import { getSenderName } from './helpers/getSenderName'; import { useIntersectionObserver } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import useAsyncRendering from '../../right/hooks/useAsyncRendering'; import NothingFound from '../../common/NothingFound'; @@ -50,7 +50,7 @@ const LinkResults: FC = ({ // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { observe: observeIntersectionForMedia } = useIntersectionObserver({ rootRef: containerRef, diff --git a/src/components/left/search/MediaResults.tsx b/src/components/left/search/MediaResults.tsx index f808465d1..5f99c384e 100644 --- a/src/components/left/search/MediaResults.tsx +++ b/src/components/left/search/MediaResults.tsx @@ -14,7 +14,7 @@ import { throttle } from '../../../util/schedulers'; import { createMapStateToProps } from './helpers/createMapStateToProps'; import { useIntersectionObserver } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import useAsyncRendering from '../../right/hooks/useAsyncRendering'; import Media from '../../common/Media'; @@ -47,7 +47,7 @@ const MediaResults: FC = ({ // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { observe: observeIntersectionForMedia } = useIntersectionObserver({ rootRef: containerRef, diff --git a/src/components/left/search/RecentContacts.tsx b/src/components/left/search/RecentContacts.tsx index 7a7783aa7..cedf7dad3 100644 --- a/src/components/left/search/RecentContacts.tsx +++ b/src/components/left/search/RecentContacts.tsx @@ -13,7 +13,7 @@ import { throttle } from '../../../util/schedulers'; import renderText from '../../common/helpers/renderText'; import useHorizontalScroll from '../../../hooks/useHorizontalScroll'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import Button from '../../ui/Button'; @@ -72,7 +72,7 @@ const RecentContacts: FC = ({ clearRecentlyFoundChats(); }, [clearRecentlyFoundChats]); - const lang = useLang(); + const lang = useOldLang(); return (
diff --git a/src/components/left/search/helpers/getSenderName.ts b/src/components/left/search/helpers/getSenderName.ts index ea4546e0f..8c98f883e 100644 --- a/src/components/left/search/helpers/getSenderName.ts +++ b/src/components/left/search/helpers/getSenderName.ts @@ -1,5 +1,5 @@ import type { ApiChat, ApiMessage, ApiUser } from '../../../../api/types'; -import type { LangFn } from '../../../../hooks/useLang'; +import type { LangFn } from '../../../../hooks/useOldLang'; import { getChatTitle, diff --git a/src/components/left/settings/BlockUserModal.tsx b/src/components/left/settings/BlockUserModal.tsx index ee218ba1e..adf2bfde8 100644 --- a/src/components/left/settings/BlockUserModal.tsx +++ b/src/components/left/settings/BlockUserModal.tsx @@ -11,7 +11,7 @@ import { filterUsersByName, getUserFullName } from '../../../global/helpers'; import { selectTabState } from '../../../global/selectors'; import { unique } from '../../../util/iteratees'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import ChatOrUserPicker from '../../common/ChatOrUserPicker'; @@ -42,7 +42,7 @@ const BlockUserModal: FC = ({ blockUser, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [search, setSearch] = useState(''); useEffect(() => { diff --git a/src/components/left/settings/PremiumStatusItem.tsx b/src/components/left/settings/PremiumStatusItem.tsx index a0e2f5c2b..bdd4ce9c6 100644 --- a/src/components/left/settings/PremiumStatusItem.tsx +++ b/src/components/left/settings/PremiumStatusItem.tsx @@ -3,8 +3,8 @@ import { getActions } from '../../../global'; import type { ApiPremiumSection } from '../../../global/types'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import StarIcon from '../../common/icons/StarIcon'; import ListItem from '../../ui/ListItem'; @@ -15,7 +15,7 @@ type OwnProps = { function PremiumStatusItem({ premiumSection }: OwnProps) { const { openPremiumModal } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const handleOpenPremiumModal = useLastCallback(() => openPremiumModal({ initialSection: premiumSection })); return ( diff --git a/src/components/left/settings/PrivacyLockedOption.tsx b/src/components/left/settings/PrivacyLockedOption.tsx index 1e2f26213..26c2a5eb1 100644 --- a/src/components/left/settings/PrivacyLockedOption.tsx +++ b/src/components/left/settings/PrivacyLockedOption.tsx @@ -1,7 +1,7 @@ import React, { memo } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; @@ -12,7 +12,7 @@ type OwnProps = { }; function PrivacyLockedOption({ label }: OwnProps) { - const lang = useLang(); + const lang = useOldLang(); const { showNotification } = getActions(); return ( diff --git a/src/components/left/settings/PrivacyMessages.tsx b/src/components/left/settings/PrivacyMessages.tsx index e4b6a1973..9f85359ff 100644 --- a/src/components/left/settings/PrivacyMessages.tsx +++ b/src/components/left/settings/PrivacyMessages.tsx @@ -4,8 +4,8 @@ import { getActions, withGlobal } from '../../../global'; import { selectIsCurrentUserPremium, selectNewNoncontactPeersRequirePremium } from '../../../global/selectors'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import RadioGroup from '../../ui/RadioGroup'; import PremiumStatusItem from './PremiumStatusItem'; @@ -30,7 +30,7 @@ function PrivacyMessages({ onReset, }: OwnProps & StateProps) { const { updateGlobalPrivacySettings } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const canChange = isCurrentUserPremium || canLimitNewMessagesWithoutPremium; diff --git a/src/components/left/settings/SettingsActiveSession.tsx b/src/components/left/settings/SettingsActiveSession.tsx index fc3bf6d35..7c54d5baf 100644 --- a/src/components/left/settings/SettingsActiveSession.tsx +++ b/src/components/left/settings/SettingsActiveSession.tsx @@ -5,11 +5,11 @@ import { getActions, withGlobal } from '../../../global'; import type { ApiSession } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; -import { formatDateTimeToString } from '../../../util/date/dateFormat'; +import { formatDateTimeToString } from '../../../util/dates/dateFormat'; import getSessionIcon from './helpers/getSessionIcon'; import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Button from '../../ui/Button'; import ListItem from '../../ui/ListItem'; @@ -32,7 +32,7 @@ const SettingsActiveSession: FC = ({ isOpen, session, onClose, }) => { const { changeSessionSettings, terminateAuthorization } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const renderingSession = useCurrentOrPrev(session, true); diff --git a/src/components/left/settings/SettingsActiveSessions.tsx b/src/components/left/settings/SettingsActiveSessions.tsx index 83e4e2a6c..37afe9f9c 100644 --- a/src/components/left/settings/SettingsActiveSessions.tsx +++ b/src/components/left/settings/SettingsActiveSessions.tsx @@ -7,12 +7,12 @@ import { getActions, withGlobal } from '../../../global'; import type { ApiSession } from '../../../api/types'; -import { formatPastTimeShort } from '../../../util/date/dateFormat'; +import { formatPastTimeShort } from '../../../util/dates/dateFormat'; import getSessionIcon from './helpers/getSessionIcon'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import ConfirmDialog from '../../ui/ConfirmDialog'; import ListItem from '../../ui/ListItem'; @@ -45,7 +45,7 @@ const SettingsActiveSessions: FC = ({ changeSessionTtl, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isConfirmTerminateAllDialogOpen, openConfirmTerminateAllDialog, closeConfirmTerminateAllDialog] = useFlag(); const [openedSessionHash, setOpenedSessionHash] = useState(); const [isModalOpen, openModal, closeModal] = useFlag(); diff --git a/src/components/left/settings/SettingsActiveWebsite.tsx b/src/components/left/settings/SettingsActiveWebsite.tsx index 3db9b5405..5a11a3b5f 100644 --- a/src/components/left/settings/SettingsActiveWebsite.tsx +++ b/src/components/left/settings/SettingsActiveWebsite.tsx @@ -7,7 +7,7 @@ import type { ApiUser, ApiWebSession } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import FullNameTitle from '../../common/FullNameTitle'; @@ -34,7 +34,7 @@ const SettingsActiveWebsite: FC = ({ onClose, }) => { const { terminateWebAuthorization } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const renderingSession = useCurrentOrPrev(session, true); const renderingBot = useCurrentOrPrev(bot, true); diff --git a/src/components/left/settings/SettingsActiveWebsites.tsx b/src/components/left/settings/SettingsActiveWebsites.tsx index 5f1280d06..4186c215b 100644 --- a/src/components/left/settings/SettingsActiveWebsites.tsx +++ b/src/components/left/settings/SettingsActiveWebsites.tsx @@ -7,11 +7,11 @@ import { getActions, getGlobal, withGlobal } from '../../../global'; import type { ApiWebSession } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; -import { formatPastTimeShort } from '../../../util/date/dateFormat'; +import { formatPastTimeShort } from '../../../util/dates/dateFormat'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import FullNameTitle from '../../common/FullNameTitle'; @@ -42,7 +42,7 @@ const SettingsActiveWebsites: FC = ({ terminateAllWebAuthorizations, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isConfirmTerminateAllDialogOpen, openConfirmTerminateAllDialog, closeConfirmTerminateAllDialog] = useFlag(); const [openedWebsiteHash, setOpenedWebsiteHash] = useState(); const [isModalOpen, openModal, closeModal] = useFlag(); diff --git a/src/components/left/settings/SettingsCustomEmoji.tsx b/src/components/left/settings/SettingsCustomEmoji.tsx index 286841e80..18bd67837 100644 --- a/src/components/left/settings/SettingsCustomEmoji.tsx +++ b/src/components/left/settings/SettingsCustomEmoji.tsx @@ -13,7 +13,7 @@ import renderText from '../../common/helpers/renderText'; import useHistoryBack from '../../../hooks/useHistoryBack'; import { useIntersectionObserver } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import StickerSetCard from '../../common/StickerSetCard'; import Checkbox from '../../ui/Checkbox'; @@ -40,7 +40,7 @@ const SettingsCustomEmoji: FC = ({ onReset, }) => { const { openStickerSet, setSettingOption } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const stickerSettingsRef = useRef(null); diff --git a/src/components/left/settings/SettingsDataStorage.tsx b/src/components/left/settings/SettingsDataStorage.tsx index eeaf546a9..24e07dacc 100644 --- a/src/components/left/settings/SettingsDataStorage.tsx +++ b/src/components/left/settings/SettingsDataStorage.tsx @@ -8,7 +8,7 @@ import { AUTODOWNLOAD_FILESIZE_MB_LIMITS } from '../../../config'; import { pick } from '../../../util/iteratees'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Checkbox from '../../ui/Checkbox'; import RangeSlider from '../../ui/RangeSlider'; @@ -53,7 +53,7 @@ const SettingsDataStorage: FC = ({ }) => { const { setSettingOption } = getActions(); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/settings/SettingsDoNotTranslate.tsx b/src/components/left/settings/SettingsDoNotTranslate.tsx index aedd41896..a0827833b 100644 --- a/src/components/left/settings/SettingsDoNotTranslate.tsx +++ b/src/components/left/settings/SettingsDoNotTranslate.tsx @@ -13,7 +13,7 @@ import { partition, unique } from '../../../util/iteratees'; import useEffectWithPrevDeps from '../../../hooks/useEffectWithPrevDeps'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Checkbox from '../../ui/Checkbox'; import InputText from '../../ui/InputText'; @@ -61,7 +61,7 @@ const SettingsDoNotTranslate: FC = ({ }) => { const { setSettingOption } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [displayedOptions, setDisplayedOptions] = useState([]); const [search, setSearch] = useState(''); diff --git a/src/components/left/settings/SettingsEditProfile.tsx b/src/components/left/settings/SettingsEditProfile.tsx index 9ee03f523..54d0b416c 100644 --- a/src/components/left/settings/SettingsEditProfile.tsx +++ b/src/components/left/settings/SettingsEditProfile.tsx @@ -18,8 +18,8 @@ import { throttle } from '../../../util/schedulers'; import renderText from '../../common/helpers/renderText'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import ManageUsernames from '../../common/ManageUsernames'; @@ -72,7 +72,7 @@ const SettingsEditProfile: FC = ({ updateProfile, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const firstEditableUsername = useMemo(() => usernames?.find(({ isEditable }) => isEditable), [usernames]); const currentUsername = firstEditableUsername?.username || ''; diff --git a/src/components/left/settings/SettingsExperimental.tsx b/src/components/left/settings/SettingsExperimental.tsx index 48bf911f4..7ac49b4a1 100644 --- a/src/components/left/settings/SettingsExperimental.tsx +++ b/src/components/left/settings/SettingsExperimental.tsx @@ -11,8 +11,8 @@ import { IS_ELECTRON } from '../../../util/windowEnvironment'; import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import AnimatedIcon from '../../common/AnimatedIcon'; import Checkbox from '../../ui/Checkbox'; @@ -41,7 +41,7 @@ const SettingsExperimental: FC = ({ shouldDebugExportedSenders, }) => { const { requestConfetti, setSettingOption } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isAutoUpdateEnabled, setIsAutoUpdateEnabled] = useState(false); useEffect(() => { diff --git a/src/components/left/settings/SettingsGeneral.tsx b/src/components/left/settings/SettingsGeneral.tsx index 6d6bd5aa2..92a370525 100644 --- a/src/components/left/settings/SettingsGeneral.tsx +++ b/src/components/left/settings/SettingsGeneral.tsx @@ -9,7 +9,7 @@ import type { IRadioOption } from '../../ui/RadioGroup'; import { SettingsScreens } from '../../../types'; import { pick } from '../../../util/iteratees'; -import { setTimeFormat } from '../../../util/langProvider'; +import { setTimeFormat } from '../../../util/oldLangProvider'; import { getSystemTheme } from '../../../util/systemTheme'; import { IS_ANDROID, IS_ELECTRON, IS_IOS, IS_MAC_OS, IS_WINDOWS, @@ -17,7 +17,7 @@ import { import useAppLayout from '../../../hooks/useAppLayout'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Checkbox from '../../ui/Checkbox'; import ListItem from '../../ui/ListItem'; @@ -63,7 +63,7 @@ const SettingsGeneral: FC = ({ setSettingOption, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); const isMobileDevice = isMobile && (IS_IOS || IS_ANDROID); diff --git a/src/components/left/settings/SettingsGeneralBackground.tsx b/src/components/left/settings/SettingsGeneralBackground.tsx index cecc8c2a2..60f01f086 100644 --- a/src/components/left/settings/SettingsGeneralBackground.tsx +++ b/src/components/left/settings/SettingsGeneralBackground.tsx @@ -16,7 +16,7 @@ import { throttle } from '../../../util/schedulers'; import { openSystemFilesDialog } from '../../../util/systemFilesDialog'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Checkbox from '../../ui/Checkbox'; import ListItem from '../../ui/ListItem'; @@ -111,7 +111,7 @@ const SettingsGeneralBackground: FC = ({ setThemeSettings({ theme: themeRef.current!, isBlurred: e.target.checked }); }, [setThemeSettings]); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/settings/SettingsHeader.tsx b/src/components/left/settings/SettingsHeader.tsx index 62a4451e1..9d331c864 100644 --- a/src/components/left/settings/SettingsHeader.tsx +++ b/src/components/left/settings/SettingsHeader.tsx @@ -7,8 +7,8 @@ import { getActions } from '../../../global'; import { SettingsScreens } from '../../../types'; import useAppLayout from '../../../hooks/useAppLayout'; -import useLang from '../../../hooks/useLang'; import useMultiClick from '../../../hooks/useMultiClick'; +import useOldLang from '../../../hooks/useOldLang'; import Button from '../../ui/Button'; import ConfirmDialog from '../../ui/ConfirmDialog'; @@ -75,7 +75,7 @@ const SettingsHeader: FC = ({ ); }, [isMobile]); - const lang = useLang(); + const lang = useOldLang(); function renderHeaderContent() { switch (currentScreen) { diff --git a/src/components/left/settings/SettingsLanguage.tsx b/src/components/left/settings/SettingsLanguage.tsx index f41c45f87..0cf97ed22 100644 --- a/src/components/left/settings/SettingsLanguage.tsx +++ b/src/components/left/settings/SettingsLanguage.tsx @@ -9,13 +9,13 @@ import type { ISettings, LangCode } from '../../../types'; import { SettingsScreens } from '../../../types'; import { selectIsCurrentUserPremium } from '../../../global/selectors'; -import { setLanguage } from '../../../util/langProvider'; +import { oldSetLanguage } from '../../../util/oldLangProvider'; import { IS_TRANSLATION_SUPPORTED } from '../../../util/windowEnvironment'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Checkbox from '../../ui/Checkbox'; import ListItem from '../../ui/ListItem'; @@ -55,7 +55,7 @@ const SettingsLanguage: FC = ({ const canTranslateChatsEnabled = isCurrentUserPremium && canTranslateChats; - const lang = useLang(); + const lang = useOldLang(); useEffect(() => { if (!languages?.length) { @@ -67,7 +67,7 @@ const SettingsLanguage: FC = ({ setSelectedLanguage(langCode); markIsLoading(); - void setLanguage(langCode as LangCode, () => { + void oldSetLanguage(langCode as LangCode, () => { unmarkIsLoading(); setSettingOption({ language: langCode as LangCode }); diff --git a/src/components/left/settings/SettingsMain.tsx b/src/components/left/settings/SettingsMain.tsx index f433b4432..7fddade19 100644 --- a/src/components/left/settings/SettingsMain.tsx +++ b/src/components/left/settings/SettingsMain.tsx @@ -13,8 +13,8 @@ import { formatInteger } from '../../../util/textFormat'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import StarIcon from '../../common/icons/StarIcon'; import ChatExtra from '../../common/profile/ChatExtra'; @@ -59,7 +59,7 @@ const SettingsMain: FC = ({ const [isSupportDialogOpen, openSupportDialog, closeSupportDialog] = useFlag(false); - const lang = useLang(); + const lang = useOldLang(); useEffect(() => { if (currentUserId) { diff --git a/src/components/left/settings/SettingsNotifications.tsx b/src/components/left/settings/SettingsNotifications.tsx index e1e3a2614..101f6d7a7 100644 --- a/src/components/left/settings/SettingsNotifications.tsx +++ b/src/components/left/settings/SettingsNotifications.tsx @@ -10,7 +10,7 @@ import { } from '../../../util/notifications'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import useRunDebounced from '../../../hooks/useRunDebounced'; import Checkbox from '../../ui/Checkbox'; @@ -139,7 +139,7 @@ const SettingsNotifications: FC = ({ runDebounced(() => playNotifySound(undefined, volume)); }, [runDebounced, updateWebNotificationSettings]); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/settings/SettingsPasswordForm.tsx b/src/components/left/settings/SettingsPasswordForm.tsx index 34af2e3cb..ffd4f6e15 100644 --- a/src/components/left/settings/SettingsPasswordForm.tsx +++ b/src/components/left/settings/SettingsPasswordForm.tsx @@ -2,7 +2,7 @@ import type { FC } from '../../../lib/teact/teact'; import React, { memo, useCallback, useState } from '../../../lib/teact/teact'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import PasswordForm from '../../common/PasswordForm'; import PasswordMonkey from '../../common/PasswordMonkey'; @@ -54,7 +54,7 @@ const SettingsPasswordForm: FC = ({ setValidationError(''); }, [clearError]); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/settings/SettingsPerformance.tsx b/src/components/left/settings/SettingsPerformance.tsx index 609fbb59c..d8657bd2b 100644 --- a/src/components/left/settings/SettingsPerformance.tsx +++ b/src/components/left/settings/SettingsPerformance.tsx @@ -18,7 +18,7 @@ import { areDeepEqual } from '../../../util/areDeepEqual'; import { IS_BACKDROP_BLUR_SUPPORTED } from '../../../util/windowEnvironment'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Checkbox from '../../ui/Checkbox'; import RangeSlider from '../../ui/RangeSlider'; @@ -88,7 +88,7 @@ function SettingsPerformance({ onBack: onReset, }); - const lang = useLang(); + const lang = useOldLang(); const [sectionExpandedStates, setSectionExpandedStates] = useState>({}); const sectionCheckedStates = useMemo(() => { diff --git a/src/components/left/settings/SettingsPrivacy.tsx b/src/components/left/settings/SettingsPrivacy.tsx index 563d573d5..520f83617 100644 --- a/src/components/left/settings/SettingsPrivacy.tsx +++ b/src/components/left/settings/SettingsPrivacy.tsx @@ -9,7 +9,7 @@ import { SettingsScreens } from '../../../types'; import { selectCanSetPasscode, selectIsCurrentUserPremium } from '../../../global/selectors'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import StarIcon from '../../common/icons/StarIcon'; import Checkbox from '../../ui/Checkbox'; @@ -79,7 +79,7 @@ const SettingsPrivacy: FC = ({ } }, [isActive, loadGlobalPrivacySettings]); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx b/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx index f8cdc4df3..384cfd33d 100644 --- a/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx +++ b/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx @@ -11,7 +11,7 @@ import { formatPhoneNumberWithCode } from '../../../util/phoneNumber'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import FullNameTitle from '../../common/FullNameTitle'; @@ -42,7 +42,7 @@ const SettingsPrivacyBlockedUsers: FC = ({ }) => { const { unblockUser } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isBlockUserModalOpen, openBlockUserModal, closeBlockUserModal] = useFlag(); const handleUnblockClick = useCallback((userId: string) => { unblockUser({ userId }); diff --git a/src/components/left/settings/SettingsPrivacyLastSeen.tsx b/src/components/left/settings/SettingsPrivacyLastSeen.tsx index 3726204a7..570b128bc 100644 --- a/src/components/left/settings/SettingsPrivacyLastSeen.tsx +++ b/src/components/left/settings/SettingsPrivacyLastSeen.tsx @@ -6,8 +6,8 @@ import type { PrivacyVisibility } from '../../../types'; import { selectIsCurrentUserPremium, selectShouldHideReadMarks } from '../../../global/selectors'; import renderText from '../../common/helpers/renderText'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import StarIcon from '../../common/icons/StarIcon'; import Checkbox from '../../ui/Checkbox'; @@ -26,7 +26,7 @@ const SettingsPrivacyLastSeen = ({ isCurrentUserPremium, shouldHideReadMarks, visibility, }: OwnProps & StateProps) => { const { updateGlobalPrivacySettings, openPremiumModal } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const canShowHideReadTime = visibility === 'nobody' || visibility === 'contacts'; const handleChangeShouldHideReadMarks = useLastCallback( diff --git a/src/components/left/settings/SettingsPrivacyPublicProfilePhoto.tsx b/src/components/left/settings/SettingsPrivacyPublicProfilePhoto.tsx index 641fbb7b0..51d7bb579 100644 --- a/src/components/left/settings/SettingsPrivacyPublicProfilePhoto.tsx +++ b/src/components/left/settings/SettingsPrivacyPublicProfilePhoto.tsx @@ -7,7 +7,7 @@ import { getActions } from '../../../global'; import type { ApiPhoto } from '../../../api/types'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import ConfirmDialog from '../../ui/ConfirmDialog'; @@ -31,7 +31,7 @@ const SettingsPrivacyPublicProfilePhoto: FC = ({ loadFullUser, uploadProfilePhoto, deleteProfilePhoto, showNotification, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isDeleteFallbackPhotoModalOpen, openDeleteFallbackPhotoModal, closeDeleteFallbackPhotoModal] = useFlag(false); diff --git a/src/components/left/settings/SettingsPrivacyVisibility.tsx b/src/components/left/settings/SettingsPrivacyVisibility.tsx index 09cf2ddb1..042c023c6 100644 --- a/src/components/left/settings/SettingsPrivacyVisibility.tsx +++ b/src/components/left/settings/SettingsPrivacyVisibility.tsx @@ -10,8 +10,8 @@ import { selectIsCurrentUserPremium, selectUserFullInfo } from '../../../global/ import { getPrivacyKey } from './helpers/privacy'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import ListItem from '../../ui/ListItem'; import RadioGroup from '../../ui/RadioGroup'; @@ -106,7 +106,7 @@ function PrivacySubsection({ onScreenSelect: (screen: SettingsScreens) => void; }) { const { setPrivacyVisibility } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const visibilityOptions = useMemo(() => { const hasNobody = screen !== SettingsScreens.PrivacyAddByPhone; diff --git a/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx b/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx index a2e04047e..4a6b8ad5d 100644 --- a/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx +++ b/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx @@ -18,7 +18,7 @@ import { getPrivacyKey } from './helpers/privacy'; import { useFolderManagerForOrderedIds } from '../../../hooks/useFolderManager'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Picker from '../../common/Picker'; import FloatingActionButton from '../../ui/FloatingActionButton'; @@ -51,7 +51,7 @@ const SettingsPrivacyVisibilityExceptionList: FC = ({ }) => { const { setPrivacySettings } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const selectedContactIds = useMemo(() => { if (!settings) { diff --git a/src/components/left/settings/SettingsStickers.tsx b/src/components/left/settings/SettingsStickers.tsx index 1c0b5319a..d1a1fee19 100644 --- a/src/components/left/settings/SettingsStickers.tsx +++ b/src/components/left/settings/SettingsStickers.tsx @@ -20,7 +20,7 @@ import renderText from '../../common/helpers/renderText'; import useHistoryBack from '../../../hooks/useHistoryBack'; import { useIntersectionObserver } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import ReactionStaticEmoji from '../../common/ReactionStaticEmoji'; import StickerSetCard from '../../common/StickerSetCard'; @@ -64,7 +64,7 @@ const SettingsStickers: FC = ({ setSettingOption, openStickerSet, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const stickerSettingsRef = useRef(null); diff --git a/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx b/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx index 10342b5c0..cc6f7c8f5 100644 --- a/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx +++ b/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx @@ -16,7 +16,7 @@ import { } from '../../../../hooks/reducers/useFoldersReducer'; import { useFolderManagerForOrderedIds } from '../../../../hooks/useFolderManager'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import Loading from '../../../ui/Loading'; import SettingsFoldersChatsPicker from './SettingsFoldersChatsPicker'; @@ -41,7 +41,7 @@ const SettingsFoldersChatFilters: FC = ({ const { chatFilter } = state; const { selectedChatIds, selectedChatTypes } = selectChatFilters(state, mode, true); - const lang = useLang(); + const lang = useOldLang(); const folderAllOrderedIds = useFolderManagerForOrderedIds(ALL_FOLDER_ID); const folderArchivedOrderedIds = useFolderManagerForOrderedIds(ARCHIVED_FOLDER_ID); diff --git a/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx b/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx index 1e3bf22bb..a23e3703a 100644 --- a/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx +++ b/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx @@ -16,7 +16,7 @@ import { INCLUDED_CHAT_TYPES, } from '../../../../hooks/reducers/useFoldersReducer'; import useInfiniteScroll from '../../../../hooks/useInfiniteScroll'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import GroupChatInfo from '../../../common/GroupChatInfo'; import PickerSelectedItem from '../../../common/PickerSelectedItem'; @@ -123,7 +123,7 @@ const SettingsFoldersChatsPicker: FC = ({ onFilterChange(value); }, [onFilterChange]); - const lang = useLang(); + const lang = useOldLang(); function renderSelectedChatType(key: string) { const selectedType = chatTypes.find(({ key: typeKey }) => key === typeKey); diff --git a/src/components/left/settings/folders/SettingsFoldersEdit.tsx b/src/components/left/settings/folders/SettingsFoldersEdit.tsx index 9bf7e39d5..d5ad6fd67 100644 --- a/src/components/left/settings/folders/SettingsFoldersEdit.tsx +++ b/src/components/left/settings/folders/SettingsFoldersEdit.tsx @@ -24,7 +24,7 @@ import { selectChatFilters, } from '../../../../hooks/reducers/useFoldersReducer'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import AnimatedIcon from '../../../common/AnimatedIcon'; import GroupChatInfo from '../../../common/GroupChatInfo'; @@ -147,7 +147,7 @@ const SettingsFoldersEdit: FC = ({ loadedActiveChatIds, loadedArchivedChatIds, ]); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/settings/folders/SettingsFoldersMain.tsx b/src/components/left/settings/folders/SettingsFoldersMain.tsx index 079def0b3..708ceb5d1 100644 --- a/src/components/left/settings/folders/SettingsFoldersMain.tsx +++ b/src/components/left/settings/folders/SettingsFoldersMain.tsx @@ -18,7 +18,7 @@ import renderText from '../../../common/helpers/renderText'; import { useFolderManagerForChatsCount } from '../../../../hooks/useFolderManager'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import usePrevious from '../../../../hooks/usePrevious'; import AnimatedIcon from '../../../common/AnimatedIcon'; @@ -109,7 +109,7 @@ const SettingsFoldersMain: FC = ({ onCreateFolder(); }, [foldersById, maxFolders, onCreateFolder, openLimitReachedModal]); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/settings/folders/SettingsShareChatlist.tsx b/src/components/left/settings/folders/SettingsShareChatlist.tsx index a0ac72a2c..579d2e82c 100644 --- a/src/components/left/settings/folders/SettingsShareChatlist.tsx +++ b/src/components/left/settings/folders/SettingsShareChatlist.tsx @@ -17,8 +17,8 @@ import renderText from '../../../common/helpers/renderText'; import useEffectWithPrevDeps from '../../../../hooks/useEffectWithPrevDeps'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; import useLastCallback from '../../../../hooks/useLastCallback'; +import useOldLang from '../../../../hooks/useOldLang'; import AnimatedIcon from '../../../common/AnimatedIcon'; import LinkField from '../../../common/LinkField'; @@ -55,7 +55,7 @@ const SettingsShareChatlist: FC = ({ const { createChatlistInvite, deleteChatlistInvite, editChatlistInvite, showNotification, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isTouched, setIsTouched] = useState(false); diff --git a/src/components/left/settings/passcode/SettingsPasscode.tsx b/src/components/left/settings/passcode/SettingsPasscode.tsx index 9f2ae83f0..6eeb128db 100644 --- a/src/components/left/settings/passcode/SettingsPasscode.tsx +++ b/src/components/left/settings/passcode/SettingsPasscode.tsx @@ -7,7 +7,7 @@ import { SettingsScreens } from '../../../../types'; import { decryptSession } from '../../../../util/passcode'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import SettingsPasscodeForm from '../SettingsPasswordForm'; import SettingsPasscodeCongratulations from './SettingsPasscodeCongratulations'; @@ -44,7 +44,7 @@ const SettingsPasscode: FC = ({ clearPasscodeError, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const handleStartWizard = useCallback(() => { onSetPasscode(''); diff --git a/src/components/left/settings/passcode/SettingsPasscodeCongratulations.tsx b/src/components/left/settings/passcode/SettingsPasscodeCongratulations.tsx index 3745f4efd..f6e3fcd18 100644 --- a/src/components/left/settings/passcode/SettingsPasscodeCongratulations.tsx +++ b/src/components/left/settings/passcode/SettingsPasscodeCongratulations.tsx @@ -5,7 +5,7 @@ import { STICKER_SIZE_PASSCODE } from '../../../../config'; import { LOCAL_TGS_URLS } from '../../../common/helpers/animatedAssets'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import AnimatedIcon from '../../../common/AnimatedIcon'; import Button from '../../../ui/Button'; @@ -18,7 +18,7 @@ type OwnProps = { const SettingsPasscodeCongratulations: FC = ({ isActive, onReset, }) => { - const lang = useLang(); + const lang = useOldLang(); const fullReset = useCallback(() => { onReset(true); diff --git a/src/components/left/settings/passcode/SettingsPasscodeEnabled.tsx b/src/components/left/settings/passcode/SettingsPasscodeEnabled.tsx index a66faed1b..448cf7105 100644 --- a/src/components/left/settings/passcode/SettingsPasscodeEnabled.tsx +++ b/src/components/left/settings/passcode/SettingsPasscodeEnabled.tsx @@ -6,7 +6,7 @@ import { SettingsScreens } from '../../../../types'; import { LOCAL_TGS_URLS } from '../../../common/helpers/animatedAssets'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import AnimatedIconWithPreview from '../../../common/AnimatedIconWithPreview'; import ListItem from '../../../ui/ListItem'; @@ -22,7 +22,7 @@ type OwnProps = { const SettingsPasscodeEnabled: FC = ({ isActive, onReset, onScreenSelect, }) => { - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, onBack: onReset }); diff --git a/src/components/left/settings/passcode/SettingsPasscodeStart.tsx b/src/components/left/settings/passcode/SettingsPasscodeStart.tsx index c66d8fc8d..46fe6b950 100644 --- a/src/components/left/settings/passcode/SettingsPasscodeStart.tsx +++ b/src/components/left/settings/passcode/SettingsPasscodeStart.tsx @@ -5,7 +5,7 @@ import { STICKER_SIZE_PASSCODE } from '../../../../config'; import { LOCAL_TGS_URLS } from '../../../common/helpers/animatedAssets'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import AnimatedIconWithPreview from '../../../common/AnimatedIconWithPreview'; import Button from '../../../ui/Button'; @@ -21,7 +21,7 @@ type OwnProps = { const SettingsPasscodeStart: FC = ({ isActive, onReset, onStart, }) => { - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, onBack: onReset }); diff --git a/src/components/left/settings/twoFa/SettingsTwoFa.tsx b/src/components/left/settings/twoFa/SettingsTwoFa.tsx index 2f4733bb8..0d3502622 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFa.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFa.tsx @@ -6,7 +6,7 @@ import type { GlobalState } from '../../../../global/types'; import type { TwoFaDispatch, TwoFaState } from '../../../../hooks/reducers/useTwoFaReducer'; import { SettingsScreens } from '../../../../types'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import SettingsTwoFaPassword from '../SettingsPasswordForm'; import SettingsTwoFaCongratulations from './SettingsTwoFaCongratulations'; @@ -153,7 +153,7 @@ const SettingsTwoFa: FC = ({ provideTwoFaEmailCode({ code }); }, [provideTwoFaEmailCode]); - const lang = useLang(); + const lang = useOldLang(); switch (currentScreen) { case SettingsScreens.TwoFaDisabled: diff --git a/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx b/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx index 0472f1367..5e659c23f 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx @@ -7,7 +7,7 @@ import { STICKER_SIZE_TWO_FA } from '../../../../config'; import { LOCAL_TGS_URLS } from '../../../common/helpers/animatedAssets'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import AnimatedIcon from '../../../common/AnimatedIcon'; import Button from '../../../ui/Button'; @@ -21,7 +21,7 @@ type OwnProps = { const SettingsTwoFaCongratulations: FC = ({ isActive, onReset, onScreenSelect, }) => { - const lang = useLang(); + const lang = useOldLang(); const handleClick = useCallback(() => { onScreenSelect(SettingsScreens.Privacy); diff --git a/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx b/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx index 8adeaf1af..8acebc9a5 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx @@ -11,7 +11,7 @@ import { IS_TOUCH_ENV } from '../../../../util/windowEnvironment'; import useAppLayout from '../../../../hooks/useAppLayout'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import AnimatedIconFromSticker from '../../../common/AnimatedIconFromSticker'; import InputText from '../../../ui/InputText'; @@ -58,7 +58,7 @@ const SettingsTwoFaEmailCode: FC = ({ } }, [focusDelayTimeoutMs]); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx b/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx index 67cc1f26e..11b36b616 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx @@ -7,7 +7,7 @@ import { LOCAL_TGS_URLS } from '../../../common/helpers/animatedAssets'; import renderText from '../../../common/helpers/renderText'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import AnimatedIconWithPreview from '../../../common/AnimatedIconWithPreview'; import ListItem from '../../../ui/ListItem'; @@ -23,7 +23,7 @@ type OwnProps = { const SettingsTwoFaEnabled: FC = ({ isActive, onReset, onScreenSelect, }) => { - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx b/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx index 8e38001c0..d7b0c6da3 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx @@ -13,7 +13,7 @@ import renderText from '../../../common/helpers/renderText'; import useAppLayout from '../../../../hooks/useAppLayout'; import useFlag from '../../../../hooks/useFlag'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import AnimatedIconFromSticker from '../../../common/AnimatedIconFromSticker'; import Button from '../../../ui/Button'; @@ -94,7 +94,7 @@ const SettingsTwoFaSkippableForm: FC = ({ onSubmit(); }, [onSubmit, unmarkIsConfirmShown]); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx b/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx index dfa68c4ff..28c40aacc 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx @@ -4,7 +4,7 @@ import React, { memo } from '../../../../lib/teact/teact'; import { LOCAL_TGS_URLS } from '../../../common/helpers/animatedAssets'; import useHistoryBack from '../../../../hooks/useHistoryBack'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import AnimatedIconWithPreview from '../../../common/AnimatedIconWithPreview'; import Button from '../../../ui/Button'; @@ -20,7 +20,7 @@ type OwnProps = { const SettingsTwoFaStart: FC = ({ isActive, onReset, onStart, }) => { - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/main/AppendEntityPickerModal.tsx b/src/components/main/AppendEntityPickerModal.tsx index c1fccb4af..172458c2f 100644 --- a/src/components/main/AppendEntityPickerModal.tsx +++ b/src/components/main/AppendEntityPickerModal.tsx @@ -18,8 +18,8 @@ import { unique } from '../../util/iteratees'; import sortChatIds from '../common/helpers/sortChatIds'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Icon from '../common/icons/Icon'; import Picker from '../common/Picker'; @@ -65,7 +65,7 @@ const AppendEntityPickerModal: FC = ({ }) => { const { showNotification } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isConfirmModalOpen, openConfirmModal, closeConfirmModal] = useFlag(); const [selectedIds, setSelectedIds] = useState([]); diff --git a/src/components/main/AttachBotRecipientPicker.tsx b/src/components/main/AttachBotRecipientPicker.tsx index 11b544f18..34723aade 100644 --- a/src/components/main/AttachBotRecipientPicker.tsx +++ b/src/components/main/AttachBotRecipientPicker.tsx @@ -5,7 +5,7 @@ import { getActions } from '../../global'; import type { TabState } from '../../global/types'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import RecipientPicker from '../common/RecipientPicker'; @@ -17,7 +17,7 @@ const AttachBotRecipientPicker: FC = ({ requestedAttachBotInChat, }) => { const { cancelAttachBotInChat, callAttachBot } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const isOpen = Boolean(requestedAttachBotInChat); const [isShown, markIsShown, unmarkIsShown] = useFlag(); diff --git a/src/components/main/BotTrustModal.tsx b/src/components/main/BotTrustModal.tsx index be3ab34ba..6df4bd95c 100644 --- a/src/components/main/BotTrustModal.tsx +++ b/src/components/main/BotTrustModal.tsx @@ -9,7 +9,7 @@ import type { ApiUser } from '../../api/types'; import { getUserFullName } from '../../global/helpers'; import renderText from '../common/helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Checkbox from '../ui/Checkbox'; import ConfirmDialog from '../ui/ConfirmDialog'; @@ -25,7 +25,7 @@ const BotTrustModal: FC = ({ bot, type, shouldRequestWriteAccess }) => const [isWriteAllowed, setIsWriteAllowed] = useState(shouldRequestWriteAccess || false); - const lang = useLang(); + const lang = useOldLang(); const handleBotTrustAccept = useCallback(() => { markBotTrusted({ botId: bot!.id, isWriteAllowed }); diff --git a/src/components/main/DeleteFolderDialog.tsx b/src/components/main/DeleteFolderDialog.tsx index ced2cee5a..b7f497bcf 100644 --- a/src/components/main/DeleteFolderDialog.tsx +++ b/src/components/main/DeleteFolderDialog.tsx @@ -4,7 +4,7 @@ import { getActions } from '../../global'; import type { ApiChatFolder } from '../../api/types'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import ConfirmDialog from '../ui/ConfirmDialog'; @@ -17,7 +17,7 @@ const DeleteFolderDialog: FC = ({ folder, }) => { const { closeDeleteChatFolderModal, deleteChatFolder, openDeleteChatFolderModal } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const isOpen = Boolean(folder); diff --git a/src/components/main/Dialogs.tsx b/src/components/main/Dialogs.tsx index 2c0c8590e..d798c2359 100644 --- a/src/components/main/Dialogs.tsx +++ b/src/components/main/Dialogs.tsx @@ -13,7 +13,7 @@ import { pick } from '../../util/iteratees'; import renderText from '../common/helpers/renderText'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Avatar from '../common/Avatar'; import Button from '../ui/Button'; @@ -33,7 +33,7 @@ const Dialogs: FC = ({ dialogs, currentMessageList }) => { } = getActions(); const [isModalOpen, openModal, closeModal] = useFlag(); - const lang = useLang(); + const lang = useOldLang(); useEffect(() => { if (dialogs.length > 0) { diff --git a/src/components/main/DraftRecipientPicker.tsx b/src/components/main/DraftRecipientPicker.tsx index e059d4085..a4d2c1c91 100644 --- a/src/components/main/DraftRecipientPicker.tsx +++ b/src/components/main/DraftRecipientPicker.tsx @@ -8,7 +8,7 @@ import type { TabState } from '../../global/types'; import type { ThreadId } from '../../types'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import RecipientPicker from '../common/RecipientPicker'; @@ -25,7 +25,7 @@ const DraftRecipientPicker: FC = ({ resetOpenChatWithDraft, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isShown, markIsShown, unmarkIsShown] = useFlag(); useEffect(() => { diff --git a/src/components/main/ForwardRecipientPicker.tsx b/src/components/main/ForwardRecipientPicker.tsx index 367e9e171..9d054ea22 100644 --- a/src/components/main/ForwardRecipientPicker.tsx +++ b/src/components/main/ForwardRecipientPicker.tsx @@ -14,7 +14,7 @@ import { } from '../../global/selectors'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import RecipientPicker from '../common/RecipientPicker'; @@ -46,7 +46,7 @@ const ForwardRecipientPicker: FC = ({ showNotification, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const renderingIsStory = usePrevious(isStory, true); const [isShown, markIsShown, unmarkIsShown] = useFlag(); diff --git a/src/components/main/GameModal.tsx b/src/components/main/GameModal.tsx index 9722b219e..aff998f11 100644 --- a/src/components/main/GameModal.tsx +++ b/src/components/main/GameModal.tsx @@ -10,7 +10,7 @@ import { getCanPostInChat } from '../../global/helpers'; import { selectChat, selectChatFullInfo } from '../../global/selectors'; import useInterval from '../../hooks/schedulers/useInterval'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import useSendMessageAction from '../../hooks/useSendMessageAction'; import Modal from '../ui/Modal'; @@ -32,7 +32,7 @@ type StateProps = { const GameModal: FC = ({ openedGame, gameTitle, canPost }) => { const { closeGame, openForwardMenu } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { url, chatId, messageId } = openedGame || {}; const isOpen = Boolean(url); diff --git a/src/components/main/HistoryCalendar.tsx b/src/components/main/HistoryCalendar.tsx index 6435b32bd..a9b16889e 100644 --- a/src/components/main/HistoryCalendar.tsx +++ b/src/components/main/HistoryCalendar.tsx @@ -4,7 +4,7 @@ import { getActions, withGlobal } from '../../global'; import { selectTabState } from '../../global/selectors'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import CalendarModal from '../common/CalendarModal'; @@ -26,7 +26,7 @@ const HistoryCalendar: FC = ({ closeHistoryCalendar(); }, [closeHistoryCalendar, searchMessagesByDate]); - const lang = useLang(); + const lang = useOldLang(); return ( = ({ isLoading, } = passcodeSettings; - const lang = useLang(); + const lang = useOldLang(); const [validationError, setValidationError] = useState(''); const [shouldShowPasscode, setShouldShowPasscode] = useState(false); const [isSignOutDialogOpen, openSignOutConfirmation, closeSignOutConfirmation] = useFlag(false); diff --git a/src/components/main/NewContactModal.tsx b/src/components/main/NewContactModal.tsx index a6f707aa5..8ec273e57 100644 --- a/src/components/main/NewContactModal.tsx +++ b/src/components/main/NewContactModal.tsx @@ -14,7 +14,7 @@ import renderText from '../common/helpers/renderText'; import useCurrentOrPrev from '../../hooks/useCurrentOrPrev'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Avatar from '../common/Avatar'; import Button from '../ui/Button'; @@ -48,7 +48,7 @@ const NewContactModal: FC = ({ }) => { const { updateContact, importContact, closeNewContactDialog } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const renderingUser = useCurrentOrPrev(user); const renderingIsByPhoneNumber = useCurrentOrPrev(isByPhoneNumber); // eslint-disable-next-line no-null/no-null diff --git a/src/components/main/SafeLinkModal.tsx b/src/components/main/SafeLinkModal.tsx index 6746f2d4b..fca3e96ad 100644 --- a/src/components/main/SafeLinkModal.tsx +++ b/src/components/main/SafeLinkModal.tsx @@ -6,7 +6,7 @@ import { ensureProtocol } from '../../util/ensureProtocol'; import renderText from '../common/helpers/renderText'; import useCurrentOrPrev from '../../hooks/useCurrentOrPrev'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import ConfirmDialog from '../ui/ConfirmDialog'; @@ -17,7 +17,7 @@ export type OwnProps = { const SafeLinkModal: FC = ({ url }) => { const { toggleSafeLinkModal } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const handleOpen = useCallback(() => { window.open(ensureProtocol(url), '_blank', 'noopener'); diff --git a/src/components/main/premium/GiftPremiumModal.tsx b/src/components/main/premium/GiftPremiumModal.tsx index a86294fb0..c4f9d9892 100644 --- a/src/components/main/premium/GiftPremiumModal.tsx +++ b/src/components/main/premium/GiftPremiumModal.tsx @@ -18,8 +18,8 @@ import buildClassName from '../../../util/buildClassName'; import { formatCurrency } from '../../../util/formatCurrency'; import renderText from '../../common/helpers/renderText'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import AvatarList from '../../common/AvatarList'; import Icon from '../../common/icons/Icon'; @@ -55,7 +55,7 @@ const GiftPremiumModal: FC = ({ openPremiumModal, closeGiftPremiumModal, openInvoice, requestConfetti, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [selectedMonthOption, setSelectedMonthOption] = useState(); const selectedUserQuantity = forUserIds && forUserIds.length * boostPerSentGift; diff --git a/src/components/main/premium/GiveawayModal.tsx b/src/components/main/premium/GiveawayModal.tsx index 9103ed179..315affbe1 100644 --- a/src/components/main/premium/GiveawayModal.tsx +++ b/src/components/main/premium/GiveawayModal.tsx @@ -21,12 +21,12 @@ import { selectTabState, } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; -import { formatDateTimeToString } from '../../../util/date/dateFormat'; +import { formatDateTimeToString } from '../../../util/dates/dateFormat'; import renderText from '../../common/helpers/renderText'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import CalendarModal from '../../common/CalendarModal'; import CountryPickerModal from '../../common/CountryPickerModal'; @@ -117,7 +117,7 @@ const GiveawayModal: FC = ({ launchPrepaidGiveaway, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isCalendarOpened, openCalendar, closeCalendar] = useFlag(); const [isCountryPickerModalOpen, openCountryPickerModal, closeCountryPickerModal] = useFlag(); const [isConfirmModalOpen, openConfirmModal, closeConfirmModal] = useFlag(); diff --git a/src/components/main/premium/GiveawayTypeOption.tsx b/src/components/main/premium/GiveawayTypeOption.tsx index bc301fc5a..ae13b35ad 100644 --- a/src/components/main/premium/GiveawayTypeOption.tsx +++ b/src/components/main/premium/GiveawayTypeOption.tsx @@ -4,8 +4,8 @@ import React, { memo } from '../../../lib/teact/teact'; import buildClassName from '../../../util/buildClassName'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; @@ -33,7 +33,7 @@ const GiveawayTypeOption: FC = ({ isLink, onChange, onClickAction, className, userNames, selectedMemberIds, }) => { - const lang = useLang(); + const lang = useOldLang(); let displayText: string | undefined = lang(text); if (isLink && selectedMemberIds?.length) { diff --git a/src/components/main/premium/PremiumFeatureModal.tsx b/src/components/main/premium/PremiumFeatureModal.tsx index 81a50869a..92e7ea594 100644 --- a/src/components/main/premium/PremiumFeatureModal.tsx +++ b/src/components/main/premium/PremiumFeatureModal.tsx @@ -15,8 +15,8 @@ import { formatCurrency } from '../../../util/formatCurrency'; import renderText from '../../common/helpers/renderText'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import SliderDots from '../../common/SliderDots'; @@ -117,7 +117,7 @@ const PremiumFeatureModal: FC = ({ onBack, onClickSubscribe, }) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const scrollContainerRef = useRef(null); const [currentSlideIndex, setCurrentSlideIndex] = useState(PREMIUM_FEATURE_SECTIONS.indexOf(initialSection)); diff --git a/src/components/main/premium/PremiumGiftingModal.tsx b/src/components/main/premium/PremiumGiftingModal.tsx index 2e53ec410..52371c120 100644 --- a/src/components/main/premium/PremiumGiftingModal.tsx +++ b/src/components/main/premium/PremiumGiftingModal.tsx @@ -12,8 +12,8 @@ import buildClassName from '../../../util/buildClassName'; import { unique } from '../../../util/iteratees'; import sortChatIds from '../../common/helpers/sortChatIds'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; import Picker from '../../common/Picker'; @@ -40,7 +40,7 @@ const PremiumGiftingModal: FC = ({ }) => { const { closePremiumGiftingModal, openGiftPremiumModal, showNotification } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [selectedUserIds, setSelectedUserIds] = useState([]); const [searchQuery, setSearchQuery] = useState(''); diff --git a/src/components/main/premium/PremiumMainModal.tsx b/src/components/main/premium/PremiumMainModal.tsx index 3117c93c9..6c442f7d8 100644 --- a/src/components/main/premium/PremiumMainModal.tsx +++ b/src/components/main/premium/PremiumMainModal.tsx @@ -22,8 +22,8 @@ import { REM } from '../../common/helpers/mediaDimensions'; import renderText from '../../common/helpers/renderText'; import { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useSyncEffect from '../../../hooks/useSyncEffect'; import CustomEmoji from '../../common/CustomEmoji'; @@ -134,7 +134,7 @@ const PremiumMainModal: FC = ({ closePremiumModal, openInvoice, requestConfetti, openTelegramLink, loadStickers, openStickerSet, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isHeaderHidden, setHeaderHidden] = useState(true); const [currentSection, setCurrentSection] = useState(initialSection); const [selectedSubscriptionOption, setSubscriptionOption] = useState(); diff --git a/src/components/main/premium/PremiumSubscriptionOption.tsx b/src/components/main/premium/PremiumSubscriptionOption.tsx index 96576bc4c..71b9bddfc 100644 --- a/src/components/main/premium/PremiumSubscriptionOption.tsx +++ b/src/components/main/premium/PremiumSubscriptionOption.tsx @@ -7,7 +7,7 @@ import type { ApiPremiumGiftCodeOption, ApiPremiumGiftOption } from '../../../ap import buildClassName from '../../../util/buildClassName'; import { formatCurrency } from '../../../util/formatCurrency'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import styles from './PremiumSubscriptionOption.module.scss'; @@ -24,7 +24,7 @@ const PremiumSubscriptionOption: FC = ({ option, checked, fullMonthlyAmount, onChange, className, isGiveaway, }) => { - const lang = useLang(); + const lang = useOldLang(); const { months, amount, currency, diff --git a/src/components/main/premium/common/PremiumLimitReachedModal.tsx b/src/components/main/premium/common/PremiumLimitReachedModal.tsx index d2a059075..950974540 100644 --- a/src/components/main/premium/common/PremiumLimitReachedModal.tsx +++ b/src/components/main/premium/common/PremiumLimitReachedModal.tsx @@ -3,7 +3,7 @@ import React, { memo, useCallback, useEffect } from '../../../../lib/teact/teact import { getActions, withGlobal } from '../../../../global'; import type { ApiLimitTypeWithModal } from '../../../../global/types'; -import type { LangFn } from '../../../../hooks/useLang'; +import type { LangFn } from '../../../../hooks/useOldLang'; import type { IconName } from '../../../../types/icons'; import { MAX_UPLOAD_FILEPART_SIZE } from '../../../../config'; @@ -13,7 +13,7 @@ import { formatFileSize } from '../../../../util/textFormat'; import renderText from '../../../common/helpers/renderText'; import useFlag from '../../../../hooks/useFlag'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import Icon from '../../../common/icons/Icon'; import Button from '../../../ui/Button'; @@ -132,7 +132,7 @@ const PremiumLimitReachedModal: FC = ({ canBuyPremium, }) => { const { closeLimitReachedModal, openPremiumModal } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isClosing, startClosing, stopClosing] = useFlag(); diff --git a/src/components/main/premium/common/PremiumLimitsCompare.tsx b/src/components/main/premium/common/PremiumLimitsCompare.tsx index d7595468a..020cc2344 100644 --- a/src/components/main/premium/common/PremiumLimitsCompare.tsx +++ b/src/components/main/premium/common/PremiumLimitsCompare.tsx @@ -5,7 +5,7 @@ import type { IconName } from '../../../../types/icons'; import buildClassName from '../../../../util/buildClassName'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import styles from './PremiumLimitsCompare.module.scss'; @@ -24,7 +24,7 @@ const PremiumLimitsCompare: FC = ({ floatingBadgeIcon, rightStyle, }) => { - const lang = useLang(); + const lang = useOldLang(); return (
diff --git a/src/components/main/premium/previews/PremiumFeaturePreviewStories.tsx b/src/components/main/premium/previews/PremiumFeaturePreviewStories.tsx index 31b7a1a77..acca9da34 100644 --- a/src/components/main/premium/previews/PremiumFeaturePreviewStories.tsx +++ b/src/components/main/premium/previews/PremiumFeaturePreviewStories.tsx @@ -7,7 +7,7 @@ import { selectUser } from '../../../../global/selectors'; import buildClassName from '../../../../util/buildClassName'; import { REM } from '../../../common/helpers/mediaDimensions'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; import useScrolledState from '../../../../hooks/useScrolledState'; import useDevicePixelRatio from '../../../../hooks/window/useDevicePixelRatio'; @@ -63,7 +63,7 @@ const PremiumFeaturePreviewVideo = ({ // eslint-disable-next-line no-null/no-null const circleRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const dpr = useDevicePixelRatio(); diff --git a/src/components/mediaViewer/MediaViewer.tsx b/src/components/mediaViewer/MediaViewer.tsx index dd3954682..d06193739 100644 --- a/src/components/mediaViewer/MediaViewer.tsx +++ b/src/components/mediaViewer/MediaViewer.tsx @@ -39,8 +39,8 @@ import useElectronDrag from '../../hooks/useElectronDrag'; import useFlag from '../../hooks/useFlag'; import useForceUpdate from '../../hooks/useForceUpdate'; import { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import { exitPictureInPictureIfNeeded, usePictureInPictureSignal } from '../../hooks/usePictureInPicture'; import usePrevious from '../../hooks/usePrevious'; import { dispatchPriorityPlaybackEvent } from '../../hooks/usePriorityPlaybackCheck'; @@ -304,7 +304,7 @@ const MediaViewer: FC = ({ selectMedia(mediaIds[index]); }); - const lang = useLang(); + const lang = useOldLang(); function renderSenderInfo() { return avatarOwner ? ( diff --git a/src/components/mediaViewer/MediaViewerActions.tsx b/src/components/mediaViewer/MediaViewerActions.tsx index 74946a6e1..4fe2e1ce6 100644 --- a/src/components/mediaViewer/MediaViewerActions.tsx +++ b/src/components/mediaViewer/MediaViewerActions.tsx @@ -19,9 +19,9 @@ import { import useAppLayout from '../../hooks/useAppLayout'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress'; +import useOldLang from '../../hooks/useOldLang'; import useZoomChange from './hooks/useZoomChangeSignal'; import DeleteMessageModal from '../common/DeleteMessageModal'; @@ -127,7 +127,7 @@ const MediaViewerActions: FC = ({ selectMedia(0); }); - const lang = useLang(); + const lang = useOldLang(); const MenuButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => { return ({ onTrigger, isOpen }) => ( diff --git a/src/components/mediaViewer/MediaViewerContent.tsx b/src/components/mediaViewer/MediaViewerContent.tsx index af92a5c75..95b798618 100644 --- a/src/components/mediaViewer/MediaViewerContent.tsx +++ b/src/components/mediaViewer/MediaViewerContent.tsx @@ -17,8 +17,8 @@ import { calculateMediaViewerDimensions } from '../common/helpers/mediaDimension import { renderMessageText } from '../common/helpers/renderMessageText'; import useAppLayout from '../../hooks/useAppLayout'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import useControlsSignal from './hooks/useControlsSignal'; import { useMediaProps } from './hooks/useMediaProps'; @@ -78,7 +78,7 @@ const MediaViewerContent: FC = (props) => { isMoving, } = props; - const lang = useLang(); + const lang = useOldLang(); const { isVideo, diff --git a/src/components/mediaViewer/MediaViewerSlides.tsx b/src/components/mediaViewer/MediaViewerSlides.tsx index f629fc7ee..03a036ee7 100644 --- a/src/components/mediaViewer/MediaViewerSlides.tsx +++ b/src/components/mediaViewer/MediaViewerSlides.tsx @@ -22,8 +22,8 @@ import useTimeout from '../../hooks/schedulers/useTimeout'; import useDebouncedCallback from '../../hooks/useDebouncedCallback'; import useDerivedState from '../../hooks/useDerivedState'; import useHistoryBack from '../../hooks/useHistoryBack'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import useSignal from '../../hooks/useSignal'; import { useSignalRef } from '../../hooks/useSignalRef'; import { useFullscreenStatus } from '../../hooks/window/useFullscreen'; @@ -126,7 +126,7 @@ const MediaViewerSlides: FC = ({ const [getControlsVisible, setControlsVisible, lockControls] = useControlsSignal(); const { onClose } = rest; - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive: isOpen, diff --git a/src/components/mediaViewer/SeekLine.tsx b/src/components/mediaViewer/SeekLine.tsx index c621d1dcf..6973635e5 100644 --- a/src/components/mediaViewer/SeekLine.tsx +++ b/src/components/mediaViewer/SeekLine.tsx @@ -11,7 +11,7 @@ import { createVideoPreviews, getPreviewDimensions, renderVideoPreview } from '. import { animateNumber } from '../../util/animation'; import buildClassName from '../../util/buildClassName'; import { captureEvents } from '../../util/captureEvents'; -import { formatMediaDuration } from '../../util/date/dateFormat'; +import { formatMediaDuration } from '../../util/dates/dateFormat'; import { clamp, round } from '../../util/math'; import { IS_TOUCH_ENV } from '../../util/windowEnvironment'; diff --git a/src/components/mediaViewer/SenderInfo.tsx b/src/components/mediaViewer/SenderInfo.tsx index 1d81eb2f7..be0d4cc74 100644 --- a/src/components/mediaViewer/SenderInfo.tsx +++ b/src/components/mediaViewer/SenderInfo.tsx @@ -10,12 +10,12 @@ import { selectPeer, selectSender, } from '../../global/selectors'; -import { formatMediaDateTime } from '../../util/date/dateFormat'; +import { formatMediaDateTime } from '../../util/dates/dateFormat'; import renderText from '../common/helpers/renderText'; import useAppLayout from '../../hooks/useAppLayout'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Avatar from '../common/Avatar'; @@ -66,7 +66,7 @@ const SenderInfo: FC = ({ } }); - const lang = useLang(); + const lang = useOldLang(); if (!sender || (!message && !isAvatar)) { return undefined; diff --git a/src/components/mediaViewer/VideoPlayerControls.tsx b/src/components/mediaViewer/VideoPlayerControls.tsx index 8dd60e09a..d5218aac1 100644 --- a/src/components/mediaViewer/VideoPlayerControls.tsx +++ b/src/components/mediaViewer/VideoPlayerControls.tsx @@ -8,7 +8,7 @@ import type { ApiDimensions } from '../../api/types'; import type { BufferedRange } from '../../hooks/useBuffering'; import buildClassName from '../../util/buildClassName'; -import { formatMediaDuration } from '../../util/date/dateFormat'; +import { formatMediaDuration } from '../../util/dates/dateFormat'; import { formatFileSize } from '../../util/textFormat'; import { IS_IOS, IS_TOUCH_ENV } from '../../util/windowEnvironment'; @@ -16,8 +16,8 @@ import useAppLayout from '../../hooks/useAppLayout'; import useCurrentTimeSignal from '../../hooks/useCurrentTimeSignal'; import useDerivedState from '../../hooks/useDerivedState'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import useSignal from '../../hooks/useSignal'; import useControlsSignal from './hooks/useControlsSignal'; @@ -136,7 +136,7 @@ const VideoPlayerControls: FC = ({ } }, [closePlaybackMenu, isVisible]); - const lang = useLang(); + const lang = useOldLang(); const handleSeek = useLastCallback((position: number) => { setIsSeeking(false); diff --git a/src/components/middle/ActionMessage.tsx b/src/components/middle/ActionMessage.tsx index 13971e415..d68efa835 100644 --- a/src/components/middle/ActionMessage.tsx +++ b/src/components/middle/ActionMessage.tsx @@ -35,7 +35,7 @@ import useContextMenuHandlers from '../../hooks/useContextMenuHandlers'; import useEnsureMessage from '../../hooks/useEnsureMessage'; import useFlag from '../../hooks/useFlag'; import { useIsIntersecting, useOnIntersect } from '../../hooks/useIntersectionObserver'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import useShowTransition from '../../hooks/useShowTransition'; import useFocusMessage from './message/hooks/useFocusMessage'; @@ -106,7 +106,7 @@ const ActionMessage: FC = ({ openPremiumModal, requestConfetti, checkGiftCode, getReceipt, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); diff --git a/src/components/middle/ActionMessageSuggestedAvatar.tsx b/src/components/middle/ActionMessageSuggestedAvatar.tsx index 6c45b93bf..d7692b4d1 100644 --- a/src/components/middle/ActionMessageSuggestedAvatar.tsx +++ b/src/components/middle/ActionMessageSuggestedAvatar.tsx @@ -11,9 +11,9 @@ import { getMessageMediaHash } from '../../global/helpers'; import * as mediaLoader from '../../util/mediaLoader'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMedia from '../../hooks/useMedia'; +import useOldLang from '../../hooks/useOldLang'; import Avatar from '../common/Avatar'; import ConfirmDialog from '../ui/ConfirmDialog'; @@ -34,7 +34,7 @@ const ActionMessageSuggestedAvatar: FC = ({ const { isOutgoing } = message; - const lang = useLang(); + const lang = useOldLang(); const [cropModalBlob, setCropModalBlob] = useState(); const [isVideoModalOpen, openVideoModal, closeVideoModal] = useFlag(false); const suggestedPhotoUrl = useMedia(getMessageMediaHash(message, 'full')); diff --git a/src/components/middle/AudioPlayer.tsx b/src/components/middle/AudioPlayer.tsx index 1a561c7d2..ef1a538a2 100644 --- a/src/components/middle/AudioPlayer.tsx +++ b/src/components/middle/AudioPlayer.tsx @@ -22,9 +22,9 @@ import renderText from '../common/helpers/renderText'; import useAppLayout from '../../hooks/useAppLayout'; import useAudioPlayer from '../../hooks/useAudioPlayer'; import useContextMenuHandlers from '../../hooks/useContextMenuHandlers'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMessageMediaMetadata from '../../hooks/useMessageMediaMetadata'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import DropdownMenu from '../ui/DropdownMenu'; @@ -83,7 +83,7 @@ const AudioPlayer: FC = ({ // eslint-disable-next-line no-null/no-null const ref = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); const { audio, voice, video } = getMessageContent(message); const isVoice = Boolean(voice || video); diff --git a/src/components/middle/ChatLanguageModal.tsx b/src/components/middle/ChatLanguageModal.tsx index 7e9323060..f8b42c9c0 100644 --- a/src/components/middle/ChatLanguageModal.tsx +++ b/src/components/middle/ChatLanguageModal.tsx @@ -14,8 +14,8 @@ import { import buildClassName from '../../util/buildClassName'; import renderText from '../common/helpers/renderText'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import InputText from '../ui/InputText'; import ListItem from '../ui/ListItem'; @@ -55,7 +55,7 @@ const ChatLanguageModal: FC = ({ } = getActions(); const [search, setSearch] = useState(''); - const lang = useLang(); + const lang = useOldLang(); const handleSelect = useLastCallback((langCode: string) => { if (!chatId) return; diff --git a/src/components/middle/ChatReportPanel.tsx b/src/components/middle/ChatReportPanel.tsx index 70485c195..2d7ef08b1 100644 --- a/src/components/middle/ChatReportPanel.tsx +++ b/src/components/middle/ChatReportPanel.tsx @@ -11,8 +11,8 @@ import { selectChat, selectUser } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Checkbox from '../ui/Checkbox'; @@ -47,7 +47,7 @@ const ChatReportPanel: FC = ({ hideChatReportPanel, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isBlockUserModalOpen, openBlockUserModal, closeBlockUserModal] = useFlag(); const [shouldReportSpam, setShouldReportSpam] = useState(true); const [shouldDeleteChat, setShouldDeleteChat] = useState(true); diff --git a/src/components/middle/ContactGreeting.tsx b/src/components/middle/ContactGreeting.tsx index abb085c0d..55cc601ed 100644 --- a/src/components/middle/ContactGreeting.tsx +++ b/src/components/middle/ContactGreeting.tsx @@ -18,8 +18,8 @@ import { selectUserFullInfo, } from '../../global/selectors'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import StickerView from '../common/StickerView'; @@ -52,7 +52,7 @@ const ContactGreeting: FC = ({ markMessageListRead, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); diff --git a/src/components/middle/DeleteSelectedMessageModal.tsx b/src/components/middle/DeleteSelectedMessageModal.tsx index e6a412f45..55140a124 100644 --- a/src/components/middle/DeleteSelectedMessageModal.tsx +++ b/src/components/middle/DeleteSelectedMessageModal.tsx @@ -14,8 +14,8 @@ import { } from '../../global/selectors'; import renderText from '../common/helpers/renderText'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import Button from '../ui/Button'; @@ -68,7 +68,7 @@ const DeleteSelectedMessageModal: FC = ({ onClose(); }); - const lang = useLang(); + const lang = useOldLang(); // Returning `undefined` from FC instead of `` doesn't trigger useHistoryBack useEffect(() => { diff --git a/src/components/middle/HeaderActions.tsx b/src/components/middle/HeaderActions.tsx index a8f7b9421..36b54d3da 100644 --- a/src/components/middle/HeaderActions.tsx +++ b/src/components/middle/HeaderActions.tsx @@ -35,8 +35,8 @@ import { import { ARE_CALLS_SUPPORTED, IS_APP } from '../../util/windowEnvironment'; import { useHotkeys } from '../../hooks/useHotkeys'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import DropdownMenu from '../ui/DropdownMenu'; @@ -138,7 +138,7 @@ const HeaderActions: FC = ({ } = getActions(); // eslint-disable-next-line no-null/no-null const menuButtonRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const [isMenuOpen, setIsMenuOpen] = useState(false); const [menuPosition, setMenuPosition] = useState(undefined); diff --git a/src/components/middle/HeaderMenuContainer.tsx b/src/components/middle/HeaderMenuContainer.tsx index 4444afc6e..f315b4aaa 100644 --- a/src/components/middle/HeaderMenuContainer.tsx +++ b/src/components/middle/HeaderMenuContainer.tsx @@ -40,8 +40,8 @@ import { disableScrolling, enableScrolling } from '../../util/scrollLock'; import useAppLayout from '../../hooks/useAppLayout'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import usePrevDuringAnimation from '../../hooks/usePrevDuringAnimation'; import useShowTransition from '../../hooks/useShowTransition'; @@ -389,7 +389,7 @@ const HeaderMenuContainer: FC = ({ return enableScrolling; }, []); - const lang = useLang(); + const lang = useOldLang(); const botButtons = useMemo(() => { return botCommands?.map(({ command }) => { diff --git a/src/components/middle/HeaderPinnedMessage.tsx b/src/components/middle/HeaderPinnedMessage.tsx index aa4c85cf7..67be88b86 100644 --- a/src/components/middle/HeaderPinnedMessage.tsx +++ b/src/components/middle/HeaderPinnedMessage.tsx @@ -15,9 +15,9 @@ import renderText from '../common/helpers/renderText'; import { useFastClick } from '../../hooks/useFastClick'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMedia from '../../hooks/useMedia'; +import useOldLang from '../../hooks/useOldLang'; import useThumbnail from '../../hooks/useThumbnail'; import useAsyncRendering from '../right/hooks/useAsyncRendering'; @@ -54,7 +54,7 @@ const HeaderPinnedMessage: FC = ({ isLoading, isFullWidth, }) => { const { clickBotInlineButton } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const mediaThumbnail = useThumbnail(message); const mediaBlobUrl = useMedia(getMessageMediaHash(message, 'pictogram')); diff --git a/src/components/middle/MessageListBotInfo.tsx b/src/components/middle/MessageListBotInfo.tsx index 952ad35b8..4dd51f2a2 100644 --- a/src/components/middle/MessageListBotInfo.tsx +++ b/src/components/middle/MessageListBotInfo.tsx @@ -15,8 +15,8 @@ import buildClassName from '../../util/buildClassName'; import buildStyle from '../../util/buildStyle'; import renderText from '../common/helpers/renderText'; -import useLang from '../../hooks/useLang'; import useMedia from '../../hooks/useMedia'; +import useOldLang from '../../hooks/useOldLang'; import useDevicePixelRatio from '../../hooks/window/useDevicePixelRatio'; import OptimizedVideo from '../ui/OptimizedVideo'; @@ -39,7 +39,7 @@ const MessageListBotInfo: FC = ({ isLoadingBotInfo, isInMessageList, }) => { - const lang = useLang(); + const lang = useOldLang(); const dpr = useDevicePixelRatio(); const botInfoPhotoUrl = useMedia(botInfo?.photo ? getBotCoverMediaHash(botInfo.photo) : undefined); diff --git a/src/components/middle/MessageListContent.tsx b/src/components/middle/MessageListContent.tsx index 380b3ff47..12c67e188 100644 --- a/src/components/middle/MessageListContent.tsx +++ b/src/components/middle/MessageListContent.tsx @@ -15,13 +15,13 @@ import { getMessageHtmlId, getMessageOriginalId, isActionMessage, isOwnMessage, isServiceNotificationMessage, } from '../../global/helpers'; import buildClassName from '../../util/buildClassName'; -import { formatHumanDate } from '../../util/date/dateFormat'; +import { formatHumanDate } from '../../util/dates/dateFormat'; import { compact } from '../../util/iteratees'; import { isAlbum } from './helpers/groupMessages'; import { preventMessageInputBlur } from './helpers/preventMessageInputBlur'; import useDerivedSignal from '../../hooks/useDerivedSignal'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import useMessageObservers from './hooks/useMessageObservers'; import useScrollHooks from './hooks/useScrollHooks'; @@ -120,7 +120,7 @@ const MessageListContent: FC = ({ isReady, ); - const lang = useLang(); + const lang = useOldLang(); const unreadDivider = (
diff --git a/src/components/middle/MessageSelectToolbar.tsx b/src/components/middle/MessageSelectToolbar.tsx index cf7e4f7c1..fb4ec84f4 100644 --- a/src/components/middle/MessageSelectToolbar.tsx +++ b/src/components/middle/MessageSelectToolbar.tsx @@ -18,8 +18,8 @@ import buildClassName from '../../util/buildClassName'; import captureKeyboardListeners from '../../util/captureKeyboardListeners'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import useCopySelectedMessages from './hooks/useCopySelectedMessages'; @@ -68,7 +68,7 @@ const MessageSelectToolbar: FC = ({ copySelectedMessages, showNotification, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag(); const [isReportModalOpen, openReportModal, closeReportModal] = useFlag(); diff --git a/src/components/middle/MiddleColumn.tsx b/src/components/middle/MiddleColumn.tsx index 1686f2407..e70dc0140 100644 --- a/src/components/middle/MiddleColumn.tsx +++ b/src/components/middle/MiddleColumn.tsx @@ -69,8 +69,8 @@ import useAppLayout from '../../hooks/useAppLayout'; import useCustomBackground from '../../hooks/useCustomBackground'; import useForceUpdate from '../../hooks/useForceUpdate'; import useHistoryBack from '../../hooks/useHistoryBack'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import usePrevDuringAnimation from '../../hooks/usePrevDuringAnimation'; import usePrevious from '../../hooks/usePrevious'; import { useResize } from '../../hooks/useResize'; @@ -236,7 +236,7 @@ function MiddleColumn({ const { width: windowWidth } = useWindowSize(); const { isTablet, isDesktop } = useAppLayout(); - const lang = useLang(); + const lang = useOldLang(); const [dropAreaState, setDropAreaState] = useState(DropAreaState.None); const [isScrollDownShown, setIsScrollDownShown] = useState(false); const [isNotchShown, setIsNotchShown] = useState(); diff --git a/src/components/middle/MiddleHeader.tsx b/src/components/middle/MiddleHeader.tsx index f061ee06e..69a5d5c67 100644 --- a/src/components/middle/MiddleHeader.tsx +++ b/src/components/middle/MiddleHeader.tsx @@ -59,8 +59,8 @@ import useDerivedState from '../../hooks/useDerivedState'; import useElectronDrag from '../../hooks/useElectronDrag'; import useEnsureMessage from '../../hooks/useEnsureMessage'; import { useFastClick } from '../../hooks/useFastClick'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import useShowTransition from '../../hooks/useShowTransition'; import useWindowSize from '../../hooks/window/useWindowSize'; @@ -164,7 +164,7 @@ const MiddleHeader: FC = ({ openStickerSet, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const isBackButtonActive = useRef(true); const { isTablet } = useAppLayout(); diff --git a/src/components/middle/MobileSearch.tsx b/src/components/middle/MobileSearch.tsx index fb42e24de..71775e3aa 100644 --- a/src/components/middle/MobileSearch.tsx +++ b/src/components/middle/MobileSearch.tsx @@ -21,7 +21,7 @@ import { selectIsCurrentUserPremium, selectTabState, } from '../../global/selectors'; -import { getDayStartAt } from '../../util/date/dateFormat'; +import { getDayStartAt } from '../../util/dates/dateFormat'; import { debounce } from '../../util/schedulers'; import { IS_IOS } from '../../util/windowEnvironment'; diff --git a/src/components/middle/NoMessages.tsx b/src/components/middle/NoMessages.tsx index f28cec9d1..21534a971 100644 --- a/src/components/middle/NoMessages.tsx +++ b/src/components/middle/NoMessages.tsx @@ -3,12 +3,12 @@ import React, { memo } from '../../lib/teact/teact'; import type { ApiTopic } from '../../api/types'; import type { MessageListType } from '../../global/types'; -import type { LangFn } from '../../hooks/useLang'; +import type { LangFn } from '../../hooks/useOldLang'; import { REM } from '../common/helpers/mediaDimensions'; import renderText from '../common/helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import TopicIcon from '../common/TopicIcon'; @@ -30,7 +30,7 @@ const NoMessages: FC = ({ isGroupChatJustCreated, topic, }) => { - const lang = useLang(); + const lang = useOldLang(); if (type === 'scheduled') { return renderScheduled(lang); diff --git a/src/components/middle/PremiumRequiredMessage.tsx b/src/components/middle/PremiumRequiredMessage.tsx index 8479e36f0..ac5a21c5a 100644 --- a/src/components/middle/PremiumRequiredMessage.tsx +++ b/src/components/middle/PremiumRequiredMessage.tsx @@ -6,8 +6,8 @@ import { selectTheme, selectUser } from '../../global/selectors'; import { LOCAL_TGS_URLS } from '../common/helpers/animatedAssets'; import renderText from '../common/helpers/renderText'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import AnimatedIconWithPreview from '../common/AnimatedIconWithPreview'; import Icon from '../common/icons/Icon'; @@ -25,7 +25,7 @@ type StateProps = { }; function PremiumRequiredMessage({ patternColor, userName }: StateProps) { - const lang = useLang(); + const lang = useOldLang(); const { openPremiumModal } = getActions(); const handleOpenPremiumModal = useLastCallback(() => openPremiumModal()); diff --git a/src/components/middle/PremiumRequiredPlaceholder.tsx b/src/components/middle/PremiumRequiredPlaceholder.tsx index 5dacebe1a..b840cbd5c 100644 --- a/src/components/middle/PremiumRequiredPlaceholder.tsx +++ b/src/components/middle/PremiumRequiredPlaceholder.tsx @@ -4,8 +4,8 @@ import { getActions, withGlobal } from '../../global'; import { getUserFirstOrLastName } from '../../global/helpers'; import { selectUser } from '../../global/selectors'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Link from '../ui/Link'; @@ -18,7 +18,7 @@ type StateProps = { }; function PremiumRequiredPlaceholder({ userName }: StateProps) { - const lang = useLang(); + const lang = useOldLang(); const { openPremiumModal } = getActions(); const handleOpenPremiumModal = useLastCallback(() => openPremiumModal()); diff --git a/src/components/middle/ReactorListModal.tsx b/src/components/middle/ReactorListModal.tsx index 57e8901e6..404dff167 100644 --- a/src/components/middle/ReactorListModal.tsx +++ b/src/components/middle/ReactorListModal.tsx @@ -14,14 +14,14 @@ import { selectTabState, } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; -import { formatDateAtTime } from '../../util/date/dateFormat'; +import { formatDateAtTime } from '../../util/dates/dateFormat'; import { unique } from '../../util/iteratees'; import { formatIntegerCompact } from '../../util/textFormat'; import useFlag from '../../hooks/useFlag'; import useInfiniteScroll from '../../hooks/useInfiniteScroll'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Avatar from '../common/Avatar'; import FullNameTitle from '../common/FullNameTitle'; @@ -66,7 +66,7 @@ const ReactorListModal: FC = ({ const chatsById = getGlobal().chats.byId; const usersById = getGlobal().users.byId; - const lang = useLang(); + const lang = useOldLang(); const [isClosing, startClosing, stopClosing] = useFlag(false); const [chosenTab, setChosenTab] = useState(undefined); const canShowFilters = reactors && reactions && reactors.count >= MIN_REACTIONS_COUNT_FOR_FILTERS diff --git a/src/components/middle/ScrollDownButton.tsx b/src/components/middle/ScrollDownButton.tsx index 73ed48759..a3d220516 100644 --- a/src/components/middle/ScrollDownButton.tsx +++ b/src/components/middle/ScrollDownButton.tsx @@ -7,7 +7,7 @@ import buildClassName from '../../util/buildClassName'; import { formatIntegerCompact } from '../../util/textFormat'; import useContextMenuHandlers from '../../hooks/useContextMenuHandlers'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import Menu from '../ui/Menu'; @@ -32,7 +32,7 @@ const ScrollDownButton: FC = ({ onReadAll, className, }) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); diff --git a/src/components/middle/composer/AttachBotItem.tsx b/src/components/middle/composer/AttachBotItem.tsx index 943aa8a05..fa0f528b9 100644 --- a/src/components/middle/composer/AttachBotItem.tsx +++ b/src/components/middle/composer/AttachBotItem.tsx @@ -8,8 +8,8 @@ import type { ApiAttachBot } from '../../../api/types'; import type { IAnchorPosition, ISettings, ThreadId } from '../../../types'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Menu from '../../ui/Menu'; import MenuItem from '../../ui/MenuItem'; @@ -38,7 +38,7 @@ const AttachBotItem: FC = ({ }) => { const { callAttachBot, toggleAttachBot } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const icon = useMemo(() => { return bot.icons.find(({ name }) => name === 'default_static')?.document; diff --git a/src/components/middle/composer/AttachMenu.tsx b/src/components/middle/composer/AttachMenu.tsx index 1fc8316b1..212d9914c 100644 --- a/src/components/middle/composer/AttachMenu.tsx +++ b/src/components/middle/composer/AttachMenu.tsx @@ -26,9 +26,9 @@ import { openSystemFilesDialog } from '../../../util/systemFilesDialog'; import { IS_TOUCH_ENV } from '../../../util/windowEnvironment'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMouseInside from '../../../hooks/useMouseInside'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; import Menu from '../../ui/Menu'; @@ -162,7 +162,7 @@ const AttachMenu: FC = ({ : undefined; }, [attachBots, chatId, peerType]); - const lang = useLang(); + const lang = useOldLang(); if (!isButtonVisible) { return undefined; diff --git a/src/components/middle/composer/AttachmentModal.tsx b/src/components/middle/composer/AttachmentModal.tsx index f48dba5ea..600265f24 100644 --- a/src/components/middle/composer/AttachmentModal.tsx +++ b/src/components/middle/composer/AttachmentModal.tsx @@ -35,8 +35,8 @@ import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers'; import useDerivedState from '../../../hooks/useDerivedState'; import useFlag from '../../../hooks/useFlag'; import useGetSelectionRange from '../../../hooks/useGetSelectionRange'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import useScrolledState from '../../../hooks/useScrolledState'; import useCustomEmojiTooltip from './hooks/useCustomEmojiTooltip'; @@ -141,7 +141,7 @@ const AttachmentModal: FC = ({ }) => { const { addRecentCustomEmoji, addRecentEmoji, updateAttachmentSettings } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const mainButtonRef = useRef(null); diff --git a/src/components/middle/composer/AttachmentModalItem.tsx b/src/components/middle/composer/AttachmentModalItem.tsx index daf7d6755..c5c3a2119 100644 --- a/src/components/middle/composer/AttachmentModalItem.tsx +++ b/src/components/middle/composer/AttachmentModalItem.tsx @@ -5,7 +5,7 @@ import type { ApiAttachment } from '../../../api/types'; import { SUPPORTED_IMAGE_CONTENT_TYPES, SUPPORTED_VIDEO_CONTENT_TYPES } from '../../../config'; import buildClassName from '../../../util/buildClassName'; -import { formatMediaDuration } from '../../../util/date/dateFormat'; +import { formatMediaDuration } from '../../../util/dates/dateFormat'; import { getFileExtension } from '../../common/helpers/documentInfo'; import { REM } from '../../common/helpers/mediaDimensions'; diff --git a/src/components/middle/composer/ComposerEmbeddedMessage.tsx b/src/components/middle/composer/ComposerEmbeddedMessage.tsx index 4b85459ea..37c324e32 100644 --- a/src/components/middle/composer/ComposerEmbeddedMessage.tsx +++ b/src/components/middle/composer/ComposerEmbeddedMessage.tsx @@ -32,9 +32,9 @@ import { getPeerColorClass } from '../../common/helpers/peerColor'; import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers'; import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMenuPosition from '../../../hooks/useMenuPosition'; +import useOldLang from '../../../hooks/useOldLang'; import useShowTransition from '../../../hooks/useShowTransition'; import { ClosableEmbeddedMessage } from '../../common/embedded/EmbeddedMessage'; @@ -106,7 +106,7 @@ const ComposerEmbeddedMessage: FC = ({ } = getActions(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const isReplyToTopicStart = message?.content.action?.type === 'topicCreate'; const isShowingReply = replyInfo && !shouldForceShowEditing; diff --git a/src/components/middle/composer/CustomSendMenu.tsx b/src/components/middle/composer/CustomSendMenu.tsx index e1e62251f..5ff6c49a5 100644 --- a/src/components/middle/composer/CustomSendMenu.tsx +++ b/src/components/middle/composer/CustomSendMenu.tsx @@ -4,8 +4,8 @@ import React, { memo, useState } from '../../../lib/teact/teact'; import { IS_TOUCH_ENV } from '../../../util/windowEnvironment'; import useEffectWithPrevDeps from '../../../hooks/useEffectWithPrevDeps'; -import useLang from '../../../hooks/useLang'; import useMouseInside from '../../../hooks/useMouseInside'; +import useOldLang from '../../../hooks/useOldLang'; import Menu from '../../ui/Menu'; import MenuItem from '../../ui/MenuItem'; @@ -40,7 +40,7 @@ const CustomSendMenu: FC = ({ const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose); const [displayScheduleUntilOnline, setDisplayScheduleUntilOnline] = useState(false); - const lang = useLang(); + const lang = useOldLang(); useEffectWithPrevDeps(([prevIsOpen]) => { // Avoid context menu item shuffling when opened diff --git a/src/components/middle/composer/DropArea.tsx b/src/components/middle/composer/DropArea.tsx index 340670ddd..252d26638 100644 --- a/src/components/middle/composer/DropArea.tsx +++ b/src/components/middle/composer/DropArea.tsx @@ -10,8 +10,8 @@ import captureEscKeyListener from '../../../util/captureEscKeyListener'; import buildAttachment from './helpers/buildAttachment'; import getFilesFromDataTransferItems from './helpers/getFilesFromDataTransferItems'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import useShowTransition from '../../../hooks/useShowTransition'; @@ -39,7 +39,7 @@ const DROP_LEAVE_TIMEOUT_MS = 150; const DropArea: FC = ({ isOpen, withQuick, onHide, onFileSelect, editingMessage, }) => { - const lang = useLang(); + const lang = useOldLang(); const { showNotification } = getActions(); // eslint-disable-next-line no-null/no-null const hideTimeoutRef = useRef(null); diff --git a/src/components/middle/composer/EmojiCategory.tsx b/src/components/middle/composer/EmojiCategory.tsx index 7e7402235..a5763a4ca 100644 --- a/src/components/middle/composer/EmojiCategory.tsx +++ b/src/components/middle/composer/EmojiCategory.tsx @@ -10,8 +10,8 @@ import { REM } from '../../common/helpers/mediaDimensions'; import useAppLayout from '../../../hooks/useAppLayout'; import { useOnIntersect } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; import useMediaTransition from '../../../hooks/useMediaTransition'; +import useOldLang from '../../../hooks/useOldLang'; import EmojiButton from './EmojiButton'; @@ -40,7 +40,7 @@ const EmojiCategory: FC = ({ const transitionClassNames = useMediaTransition(shouldRender); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); const emojisPerRow = isMobile diff --git a/src/components/middle/composer/EmojiPicker.tsx b/src/components/middle/composer/EmojiPicker.tsx index 04d674e5c..495677b73 100644 --- a/src/components/middle/composer/EmojiPicker.tsx +++ b/src/components/middle/composer/EmojiPicker.tsx @@ -25,8 +25,8 @@ import { REM } from '../../common/helpers/mediaDimensions'; import useAppLayout from '../../../hooks/useAppLayout'; import useHorizontalScroll from '../../../hooks/useHorizontalScroll'; import { useIntersectionObserver } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useScrolledState from '../../../hooks/useScrolledState'; import useAsyncRendering from '../../right/hooks/useAsyncRendering'; @@ -134,7 +134,7 @@ const EmojiPicker: FC = ({ animateHorizontalScroll(header, newLeft); }, [categories, activeCategoryIndex]); - const lang = useLang(); + const lang = useOldLang(); const allCategories = useMemo(() => { if (!categories) { diff --git a/src/components/middle/composer/MessageInput.tsx b/src/components/middle/composer/MessageInput.tsx index bfb65ddfa..a50d8115d 100644 --- a/src/components/middle/composer/MessageInput.tsx +++ b/src/components/middle/composer/MessageInput.tsx @@ -29,8 +29,8 @@ import useAppLayout from '../../../hooks/useAppLayout'; import useDerivedState from '../../../hooks/useDerivedState'; import useFlag from '../../../hooks/useFlag'; import { isHeavyAnimating } from '../../../hooks/useHeavyAnimationCheck'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useInputCustomEmojis from './hooks/useInputCustomEmojis'; import TextTimer from '../../ui/TextTimer'; @@ -163,7 +163,7 @@ const MessageInput: FC = ({ // eslint-disable-next-line no-null/no-null const absoluteContainerRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const isContextMenuOpenRef = useRef(false); const [isTextFormatterOpen, openTextFormatter, closeTextFormatter] = useFlag(); const [textFormatterAnchorPosition, setTextFormatterAnchorPosition] = useState(); diff --git a/src/components/middle/composer/PollModal.tsx b/src/components/middle/composer/PollModal.tsx index 0129c2469..5fc16c941 100644 --- a/src/components/middle/composer/PollModal.tsx +++ b/src/components/middle/composer/PollModal.tsx @@ -10,8 +10,8 @@ import { requestMeasure, requestNextMutation } from '../../../lib/fasterdom/fast import captureEscKeyListener from '../../../util/captureEscKeyListener'; import parseHtmlAsFormattedText from '../../../util/parseHtmlAsFormattedText'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Button from '../../ui/Button'; import Checkbox from '../../ui/Checkbox'; @@ -53,7 +53,7 @@ const PollModal: FC = ({ const [correctOption, setCorrectOption] = useState(); const [hasErrors, setHasErrors] = useState(false); - const lang = useLang(); + const lang = useOldLang(); const handleSolutionChange = useLastCallback((e: ChangeEvent) => { setSolution(e.target.value); diff --git a/src/components/middle/composer/SendAsMenu.tsx b/src/components/middle/composer/SendAsMenu.tsx index 90fc22698..82798e548 100644 --- a/src/components/middle/composer/SendAsMenu.tsx +++ b/src/components/middle/composer/SendAsMenu.tsx @@ -8,9 +8,9 @@ import buildClassName from '../../../util/buildClassName'; import setTooltipItemVisible from '../../../util/setTooltipItemVisible'; import { IS_TOUCH_ENV } from '../../../util/windowEnvironment'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMouseInside from '../../../hooks/useMouseInside'; +import useOldLang from '../../../hooks/useOldLang'; import { useKeyboardNavigation } from './hooks/useKeyboardNavigation'; import Avatar from '../../common/Avatar'; @@ -43,7 +43,7 @@ const SendAsMenu: FC = ({ const usersById = getGlobal().users.byId; const chatsById = getGlobal().chats.byId; - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); diff --git a/src/components/middle/composer/StickerPicker.tsx b/src/components/middle/composer/StickerPicker.tsx index e56169879..e50e56e46 100644 --- a/src/components/middle/composer/StickerPicker.tsx +++ b/src/components/middle/composer/StickerPicker.tsx @@ -28,8 +28,8 @@ import { IS_TOUCH_ENV } from '../../../util/windowEnvironment'; import { REM } from '../../common/helpers/mediaDimensions'; import useHorizontalScroll from '../../../hooks/useHorizontalScroll'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useScrolledState from '../../../hooks/useScrolledState'; import useSendMessageAction from '../../../hooks/useSendMessageAction'; import { useStickerPickerObservers } from '../../common/hooks/useStickerPickerObservers'; @@ -125,7 +125,7 @@ const StickerPicker: FC = ({ selectStickerSet, } = useStickerPickerObservers(containerRef, headerRef, prefix, isHidden); - const lang = useLang(); + const lang = useOldLang(); const areAddedLoaded = Boolean(addedSetIds); diff --git a/src/components/middle/composer/SymbolMenu.tsx b/src/components/middle/composer/SymbolMenu.tsx index 9bfcb1d6c..d67d67fd8 100644 --- a/src/components/middle/composer/SymbolMenu.tsx +++ b/src/components/middle/composer/SymbolMenu.tsx @@ -14,9 +14,9 @@ import buildClassName from '../../../util/buildClassName'; import { IS_TOUCH_ENV } from '../../../util/windowEnvironment'; import useAppLayout from '../../../hooks/useAppLayout'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMouseInside from '../../../hooks/useMouseInside'; +import useOldLang from '../../../hooks/useOldLang'; import useShowTransition from '../../../hooks/useShowTransition'; import CustomEmojiPicker from '../../common/CustomEmojiPicker'; @@ -112,7 +112,7 @@ const SymbolMenu: FC = ({ const [handleMouseEnter, handleMouseLeave] = useMouseInside(isOpen, onClose, undefined, isMobile); const { shouldRender, transitionClassNames } = useShowTransition(isOpen, onClose, false, false); - const lang = useLang(); + const lang = useOldLang(); if (!isActivated && isOpen) { isActivated = true; diff --git a/src/components/middle/composer/SymbolMenuFooter.tsx b/src/components/middle/composer/SymbolMenuFooter.tsx index 23c598894..de01197bc 100644 --- a/src/components/middle/composer/SymbolMenuFooter.tsx +++ b/src/components/middle/composer/SymbolMenuFooter.tsx @@ -3,8 +3,8 @@ import React, { memo } from '../../../lib/teact/teact'; import buildClassName from '../../../util/buildClassName'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Button from '../../ui/Button'; @@ -43,7 +43,7 @@ const SymbolMenuFooter: FC = ({ activeTab, onSwitchTab, onRemoveSymbol, onSearchOpen, isAttachmentModal, canSendPlainText, canSearch, }) => { - const lang = useLang(); + const lang = useOldLang(); function renderTabButton(tab: SymbolMenuTabs) { return ( diff --git a/src/components/middle/composer/TextFormatter.tsx b/src/components/middle/composer/TextFormatter.tsx index 02eb40bd1..822718849 100644 --- a/src/components/middle/composer/TextFormatter.tsx +++ b/src/components/middle/composer/TextFormatter.tsx @@ -15,8 +15,8 @@ import stopEvent from '../../../util/stopEvent'; import { INPUT_CUSTOM_EMOJI_SELECTOR } from './helpers/customEmoji'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useShowTransition from '../../../hooks/useShowTransition'; import useVirtualBackdrop from '../../../hooks/useVirtualBackdrop'; @@ -377,7 +377,7 @@ const TextFormatter: FC = ({ return () => document.removeEventListener('keydown', handleKeyDown); }, [isOpen, handleKeyDown]); - const lang = useLang(); + const lang = useOldLang(); function handleContainerKeyDown(e: React.KeyboardEvent) { if (e.key === 'Enter' && isLinkControlOpen) { diff --git a/src/components/middle/composer/hooks/useAttachmentModal.ts b/src/components/middle/composer/hooks/useAttachmentModal.ts index f4187e1d9..aef1c9d9f 100644 --- a/src/components/middle/composer/hooks/useAttachmentModal.ts +++ b/src/components/middle/composer/hooks/useAttachmentModal.ts @@ -7,8 +7,8 @@ import { canReplaceMessageMedia, getAttachmentType } from '../../../../global/he import { MEMO_EMPTY_ARRAY } from '../../../../util/memo'; import buildAttachment from '../helpers/buildAttachment'; -import useLang from '../../../../hooks/useLang'; import useLastCallback from '../../../../hooks/useLastCallback'; +import useOldLang from '../../../../hooks/useOldLang'; export default function useAttachmentModal({ attachments, @@ -35,7 +35,7 @@ export default function useAttachmentModal({ insertNextText: VoidFunction; editedMessage: ApiMessage | undefined; }) { - const lang = useLang(); + const lang = useOldLang(); const { openLimitReachedModal, showAllowedMessageTypesNotification, showNotification } = getActions(); const [shouldForceAsFile, setShouldForceAsFile] = useState(false); const [shouldForceCompression, setShouldForceCompression] = useState(false); diff --git a/src/components/middle/composer/hooks/useClipboardPaste.ts b/src/components/middle/composer/hooks/useClipboardPaste.ts index a2667505e..2ea6bf400 100644 --- a/src/components/middle/composer/hooks/useClipboardPaste.ts +++ b/src/components/middle/composer/hooks/useClipboardPaste.ts @@ -14,7 +14,7 @@ import buildAttachment from '../helpers/buildAttachment'; import { preparePastedHtml } from '../helpers/cleanHtml'; import getFilesFromDataTransferItems from '../helpers/getFilesFromDataTransferItems'; -import useLang from '../../../../hooks/useLang'; +import useOldLang from '../../../../hooks/useOldLang'; const MAX_MESSAGE_LENGTH = 4096; @@ -32,7 +32,7 @@ const useClipboardPaste = ( onCustomEmojiStripped?: VoidFunction, ) => { const { showNotification } = getActions(); - const lang = useLang(); + const lang = useOldLang(); useEffect(() => { if (!isActive) { diff --git a/src/components/middle/helpers/groupMessages.ts b/src/components/middle/helpers/groupMessages.ts index 12db830f3..ed0044d29 100644 --- a/src/components/middle/helpers/groupMessages.ts +++ b/src/components/middle/helpers/groupMessages.ts @@ -2,7 +2,7 @@ import type { ApiMessage } from '../../../api/types'; import type { IAlbum } from '../../../types'; import { isActionMessage } from '../../../global/helpers'; -import { getDayStartAt } from '../../../util/date/dateFormat'; +import { getDayStartAt } from '../../../util/dates/dateFormat'; type SenderGroup = (ApiMessage | IAlbum)[]; diff --git a/src/components/middle/message/BaseStory.tsx b/src/components/middle/message/BaseStory.tsx index dcaa74f18..e67c20685 100644 --- a/src/components/middle/message/BaseStory.tsx +++ b/src/components/middle/message/BaseStory.tsx @@ -5,15 +5,15 @@ import type { ApiMessageStoryData, ApiTypeStory } from '../../../api/types'; import { getStoryMediaHash } from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; -import { formatMediaDuration } from '../../../util/date/dateFormat'; +import { formatMediaDuration } from '../../../util/dates/dateFormat'; import { IS_CANVAS_FILTER_SUPPORTED } from '../../../util/windowEnvironment'; import useAppLayout from '../../../hooks/useAppLayout'; import useCanvasBlur from '../../../hooks/useCanvasBlur'; import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import useShowTransition from '../../../hooks/useShowTransition'; import MediaAreaOverlay from '../../story/mediaArea/MediaAreaOverlay'; @@ -32,7 +32,7 @@ function BaseStory({ }: OwnProps) { const { openStoryViewer, loadPeerStoriesByIds, showNotification } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); const isExpired = story && 'isDeleted' in story; const isLoaded = story && 'content' in story; diff --git a/src/components/middle/message/CommentButton.tsx b/src/components/middle/message/CommentButton.tsx index b6602146c..5a9014322 100644 --- a/src/components/middle/message/CommentButton.tsx +++ b/src/components/middle/message/CommentButton.tsx @@ -8,8 +8,8 @@ import { selectPeer } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; import { formatIntegerCompact } from '../../../util/textFormat'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useAsyncRendering from '../../right/hooks/useAsyncRendering'; import AnimatedCounter from '../../common/AnimatedCounter'; @@ -37,7 +37,7 @@ const CommentButton: FC = ({ const shouldRenderLoading = useAsyncRendering([isLoading], SHOW_LOADER_DELAY); - const lang = useLang(); + const lang = useOldLang(); const { originMessageId, chatId, messagesCount, lastMessageId, lastReadInboxMessageId, recentReplierIds, originChannelId, } = threadInfo; diff --git a/src/components/middle/message/Contact.tsx b/src/components/middle/message/Contact.tsx index d8fe5a46a..581c494cf 100644 --- a/src/components/middle/message/Contact.tsx +++ b/src/components/middle/message/Contact.tsx @@ -9,8 +9,8 @@ import { selectUser } from '../../../global/selectors'; import { copyTextToClipboard } from '../../../util/clipboard'; import { formatPhoneNumberWithCode } from '../../../util/phoneNumber'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import PeerColorWrapper from '../../common/PeerColorWrapper'; @@ -33,7 +33,7 @@ const UNREGISTERED_CONTACT_ID = '0'; const Contact: FC = ({ contact, user, phoneCodeList, noUserColors, }) => { - const lang = useLang(); + const lang = useOldLang(); const { openChat, openAddContactDialog, showNotification, openChatWithInfo, } = getActions(); diff --git a/src/components/middle/message/ContextMenuContainer.tsx b/src/components/middle/message/ContextMenuContainer.tsx index 713739603..fee820889 100644 --- a/src/components/middle/message/ContextMenuContainer.tsx +++ b/src/components/middle/message/ContextMenuContainer.tsx @@ -57,8 +57,8 @@ import { getSelectionAsFormattedText } from './helpers/getSelectionAsFormattedTe import { isSelectionRangeInsideMessage } from './helpers/isSelectionRangeInsideMessage'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useSchedule from '../../../hooks/useSchedule'; import useShowTransition from '../../../hooks/useShowTransition'; @@ -222,7 +222,7 @@ const ContextMenuContainer: FC = ({ copyMessageLink, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { transitionClassNames } = useShowTransition(isOpen, onCloseAnimationEnd, undefined, false); const [isMenuOpen, setIsMenuOpen] = useState(true); const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); diff --git a/src/components/middle/message/FactCheck.tsx b/src/components/middle/message/FactCheck.tsx index 27a410e52..7e4fdec43 100644 --- a/src/components/middle/message/FactCheck.tsx +++ b/src/components/middle/message/FactCheck.tsx @@ -6,8 +6,8 @@ import buildClassName from '../../../util/buildClassName'; import { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities'; import useCollapsibleLines from '../../../hooks/element/useCollapsibleLines'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; import PeerColorWrapper from '../../common/PeerColorWrapper'; @@ -26,7 +26,7 @@ const COLOR = { const MAX_LINES = 4; const FactCheck = ({ factCheck, isToggleDisabled }: OwnProps) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); diff --git a/src/components/middle/message/Giveaway.tsx b/src/components/middle/message/Giveaway.tsx index 493e6d7ae..25c525e0d 100644 --- a/src/components/middle/message/Giveaway.tsx +++ b/src/components/middle/message/Giveaway.tsx @@ -17,15 +17,15 @@ import { selectGiftStickerForDuration, } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; -import { formatDateAtTime, formatDateTimeToString } from '../../../util/date/dateFormat'; +import { formatDateAtTime, formatDateTimeToString } from '../../../util/dates/dateFormat'; import { isoToEmoji } from '../../../util/emoji/emoji'; import { getServerTime } from '../../../util/serverTime'; import { callApi } from '../../../api/gramjs'; import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets'; import renderText from '../../common/helpers/renderText'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import AnimatedIconFromSticker from '../../common/AnimatedIconFromSticker'; import AnimatedIconWithPreview from '../../common/AnimatedIconWithPreview'; @@ -63,7 +63,7 @@ const Giveaway = ({ const isLoadingInfo = useRef(false); const [giveawayInfo, setGiveawayInfo] = useState(); - const lang = useLang(); + const lang = useOldLang(); const { giveaway, giveawayResults } = message.content; const isResults = Boolean(giveawayResults); const { diff --git a/src/components/middle/message/InlineButtons.tsx b/src/components/middle/message/InlineButtons.tsx index ab3edb1b5..c43d43780 100644 --- a/src/components/middle/message/InlineButtons.tsx +++ b/src/components/middle/message/InlineButtons.tsx @@ -6,7 +6,7 @@ import type { ApiKeyboardButton, ApiMessage } from '../../../api/types'; import { RE_TME_LINK } from '../../../config'; import renderText from '../../common/helpers/renderText'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Button from '../../ui/Button'; @@ -18,7 +18,7 @@ type OwnProps = { }; const InlineButtons: FC = ({ message, onClick }) => { - const lang = useLang(); + const lang = useOldLang(); const renderIcon = (button: ApiKeyboardButton) => { const { type } = button; diff --git a/src/components/middle/message/Invoice.tsx b/src/components/middle/message/Invoice.tsx index e557f7ee1..baae3449d 100644 --- a/src/components/middle/message/Invoice.tsx +++ b/src/components/middle/message/Invoice.tsx @@ -12,9 +12,9 @@ import { formatCurrency } from '../../../util/formatCurrency'; import renderText from '../../common/helpers/renderText'; import getCustomAppendixBg from './helpers/getCustomAppendixBg'; -import useLang from '../../../hooks/useLang'; import useLayoutEffectWithPrevDeps from '../../../hooks/useLayoutEffectWithPrevDeps'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef'; import Skeleton from '../../ui/placeholder/Skeleton'; @@ -41,7 +41,7 @@ const Invoice: FC = ({ // eslint-disable-next-line no-null/no-null const ref = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const invoice = getMessageInvoice(message); const { diff --git a/src/components/middle/message/InvoiceMediaPreview.tsx b/src/components/middle/message/InvoiceMediaPreview.tsx index 5660b314c..305917951 100644 --- a/src/components/middle/message/InvoiceMediaPreview.tsx +++ b/src/components/middle/message/InvoiceMediaPreview.tsx @@ -6,12 +6,12 @@ import type { ApiMessage } from '../../../api/types'; import { getMessageInvoice } from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; -import { formatMediaDuration } from '../../../util/date/dateFormat'; +import { formatMediaDuration } from '../../../util/dates/dateFormat'; import { formatCurrency } from '../../../util/formatCurrency'; import useInterval from '../../../hooks/schedulers/useInterval'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import MediaSpoiler from '../../common/MediaSpoiler'; @@ -29,7 +29,7 @@ const InvoiceMediaPreview: FC = ({ isConnected, }) => { const { openInvoice, loadExtendedMedia } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const invoice = getMessageInvoice(message); const { chatId, id } = message; diff --git a/src/components/middle/message/Location.tsx b/src/components/middle/message/Location.tsx index 3c7ebc1ae..61db1af90 100644 --- a/src/components/middle/message/Location.tsx +++ b/src/components/middle/message/Location.tsx @@ -14,7 +14,7 @@ import { isGeoLiveExpired, } from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; -import { formatCountdownShort, formatLastUpdated } from '../../../util/date/dateFormat'; +import { formatCountdownShort, formatLastUpdated } from '../../../util/dates/dateFormat'; import { getMetersPerPixel, getVenueColor, getVenueIconUrl, } from '../../../util/map'; @@ -23,9 +23,9 @@ import { getServerTime } from '../../../util/serverTime'; import useInterval from '../../../hooks/schedulers/useInterval'; import useTimeout from '../../../hooks/schedulers/useTimeout'; import useForceUpdate from '../../../hooks/useForceUpdate'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import useDevicePixelRatio from '../../../hooks/window/useDevicePixelRatio'; @@ -62,7 +62,7 @@ const Location: FC = ({ const ref = useRef(null); // eslint-disable-next-line no-null/no-null const countdownRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const forceUpdate = useForceUpdate(); const location = getMessageLocation(message)!; diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx index 747392adc..d1a29d1f3 100644 --- a/src/components/middle/message/Message.tsx +++ b/src/components/middle/message/Message.tsx @@ -124,8 +124,8 @@ import useEnsureStory from '../../../hooks/useEnsureStory'; import useFlag from '../../../hooks/useFlag'; import { dispatchHeavyAnimationEvent } from '../../../hooks/useHeavyAnimationCheck'; import { useOnIntersect } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import useResizeObserver from '../../../hooks/useResizeObserver'; import useShowTransition from '../../../hooks/useShowTransition'; @@ -423,7 +423,7 @@ const Message: FC = ({ const messageHeightRef = useRef(0); - const lang = useLang(); + const lang = useOldLang(); const [isTranscriptionHidden, setTranscriptionHidden] = useState(false); const [hasActiveStickerEffect, startStickerEffect, stopStickerEffect] = useFlag(); diff --git a/src/components/middle/message/MessageContextMenu.tsx b/src/components/middle/message/MessageContextMenu.tsx index 4ccd95fe1..10b7efbdc 100644 --- a/src/components/middle/message/MessageContextMenu.tsx +++ b/src/components/middle/message/MessageContextMenu.tsx @@ -27,9 +27,9 @@ import { getMessageCopyOptions } from './helpers/copyOptions'; import useAppLayout from '../../../hooks/useAppLayout'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMenuPosition from '../../../hooks/useMenuPosition'; +import useOldLang from '../../../hooks/useOldLang'; import AvatarList from '../../common/AvatarList'; import Menu from '../../ui/Menu'; @@ -219,7 +219,7 @@ const MessageContextMenu: FC = ({ const menuRef = useRef(null); // eslint-disable-next-line no-null/no-null const scrollableRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const noReactions = !isPrivate && !enabledReactions; const withReactions = canShowReactionList && !noReactions; const isSponsoredMessage = !('id' in message); diff --git a/src/components/middle/message/MessageMeta.tsx b/src/components/middle/message/MessageMeta.tsx index 8de90e32b..912ab339d 100644 --- a/src/components/middle/message/MessageMeta.tsx +++ b/src/components/middle/message/MessageMeta.tsx @@ -7,12 +7,12 @@ import type { } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; -import { formatDateTimeToString, formatPastTimeShort, formatTime } from '../../../util/date/dateFormat'; +import { formatDateTimeToString, formatPastTimeShort, formatTime } from '../../../util/dates/dateFormat'; import { formatIntegerCompact } from '../../../util/textFormat'; import renderText from '../../common/helpers/renderText'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import AnimatedCounter from '../../common/AnimatedCounter'; import MessageOutgoingStatus from '../../common/MessageOutgoingStatus'; @@ -52,7 +52,7 @@ const MessageMeta: FC = ({ onOpenThread, }) => { const { showNotification } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isActivated, markActivated] = useFlag(); function handleImportedClick(e: React.MouseEvent) { diff --git a/src/components/middle/message/MessagePhoneCall.tsx b/src/components/middle/message/MessagePhoneCall.tsx index d4d90baea..c5c8e9335 100644 --- a/src/components/middle/message/MessagePhoneCall.tsx +++ b/src/components/middle/message/MessagePhoneCall.tsx @@ -5,11 +5,11 @@ import { getActions } from '../../../global'; import type { ApiMessage, PhoneCallAction } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; -import { formatTime, formatTimeDuration } from '../../../util/date/dateFormat'; +import { formatTime, formatTimeDuration } from '../../../util/dates/dateFormat'; import { ARE_CALLS_SUPPORTED } from '../../../util/windowEnvironment'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Button from '../../ui/Button'; @@ -28,7 +28,7 @@ const MessagePhoneCall: FC = ({ }) => { const { requestMasterAndRequestCall } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { isOutgoing, isVideo, reason, duration, } = phoneCall; diff --git a/src/components/middle/message/Poll.tsx b/src/components/middle/message/Poll.tsx index fbc15de91..900197d19 100644 --- a/src/components/middle/message/Poll.tsx +++ b/src/components/middle/message/Poll.tsx @@ -13,14 +13,14 @@ import type { ApiMessage, ApiPeer, ApiPoll, ApiPollAnswer, } from '../../../api/types'; import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; -import type { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useOldLang'; -import { formatMediaDuration } from '../../../util/date/dateFormat'; +import { formatMediaDuration } from '../../../util/dates/dateFormat'; import { getServerTime } from '../../../util/serverTime'; import { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import Button from '../../ui/Button'; @@ -202,7 +202,7 @@ const Poll: FC = ({ } }, [hasVoted, wasSubmitted, results.results, summary.quiz, poll.results.solution]); - const lang = useLang(); + const lang = useOldLang(); function renderResultOption(answer: ApiPollAnswer) { return ( diff --git a/src/components/middle/message/ReadTimeMenuItem.tsx b/src/components/middle/message/ReadTimeMenuItem.tsx index 828a5f437..49f5c8a75 100644 --- a/src/components/middle/message/ReadTimeMenuItem.tsx +++ b/src/components/middle/message/ReadTimeMenuItem.tsx @@ -3,9 +3,9 @@ import { getActions } from '../../../lib/teact/teactn'; import type { ApiMessage } from '../../../api/types'; -import { formatDateAtTime } from '../../../util/date/dateFormat'; +import { formatDateAtTime } from '../../../util/dates/dateFormat'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import MenuItem from '../../ui/MenuItem'; import MenuSeparator from '../../ui/MenuSeparator'; @@ -26,7 +26,7 @@ function ReadTimeMenuItem({ message, shouldRenderShowWhen, canLoadReadDate, closeContextMenu, menuSeparatorSize, }: OwnProps) { const { openPrivacySettingsNoticeModal } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { readDate } = message; const shouldRenderSkeleton = canLoadReadDate && !readDate && !shouldRenderShowWhen; diff --git a/src/components/middle/message/RoundVideo.tsx b/src/components/middle/message/RoundVideo.tsx index c403f39ae..7a5069927 100644 --- a/src/components/middle/message/RoundVideo.tsx +++ b/src/components/middle/message/RoundVideo.tsx @@ -16,7 +16,7 @@ import { } from '../../../global/helpers'; import { stopCurrentAudio } from '../../../util/audioPlayer'; import buildClassName from '../../../util/buildClassName'; -import { formatMediaDuration } from '../../../util/date/dateFormat'; +import { formatMediaDuration } from '../../../util/dates/dateFormat'; import safePlay from '../../../util/safePlay'; import { ROUND_VIDEO_DIMENSIONS_PX } from '../../common/helpers/mediaDimensions'; diff --git a/src/components/middle/message/SimilarChannels.tsx b/src/components/middle/message/SimilarChannels.tsx index 6304dde83..048ea958a 100644 --- a/src/components/middle/message/SimilarChannels.tsx +++ b/src/components/middle/message/SimilarChannels.tsx @@ -17,8 +17,8 @@ import useTimeout from '../../../hooks/schedulers/useTimeout'; import useAverageColor from '../../../hooks/useAverageColor'; import useFlag from '../../../hooks/useFlag'; import useHorizontalScroll from '../../../hooks/useHorizontalScroll'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import Icon from '../../common/icons/Icon'; @@ -50,7 +50,7 @@ const SimilarChannels = ({ count, isCurrentUserPremium, }: StateProps & OwnProps) => { - const lang = useLang(); + const lang = useOldLang(); const { toggleChannelRecommendations } = getActions(); const [isShowing, markShowing, markNotShowing] = useFlag(false); const [isHiding, markHiding, markNotHiding] = useFlag(false); @@ -197,7 +197,7 @@ function MoreChannels({ isCurrentUserPremium: boolean; }) { const { openPremiumModal, openChatWithInfo } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const handleClickMore = () => { if (isCurrentUserPremium) { diff --git a/src/components/middle/message/SponsoredMessage.tsx b/src/components/middle/message/SponsoredMessage.tsx index fdc75ada3..e65af78a8 100644 --- a/src/components/middle/message/SponsoredMessage.tsx +++ b/src/components/middle/message/SponsoredMessage.tsx @@ -14,8 +14,8 @@ import { preventMessageInputBlur } from '../helpers/preventMessageInputBlur'; import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers'; import useFlag from '../../../hooks/useFlag'; import { useIntersectionObserver } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import AboutAdsModal from '../../common/AboutAdsModal.async'; import Avatar from '../../common/Avatar'; @@ -51,7 +51,7 @@ const SponsoredMessage: FC = ({ reportSponsoredMessage, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); // eslint-disable-next-line no-null/no-null diff --git a/src/components/middle/message/Sticker.tsx b/src/components/middle/message/Sticker.tsx index fdf799f69..431f12174 100644 --- a/src/components/middle/message/Sticker.tsx +++ b/src/components/middle/message/Sticker.tsx @@ -14,9 +14,9 @@ import { getStickerDimensions } from '../../common/helpers/mediaDimensions'; import useAppLayout from '../../../hooks/useAppLayout'; import useFlag from '../../../hooks/useFlag'; import { useIsIntersecting } from '../../../hooks/useIntersectionObserver'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import AnimatedSticker from '../../common/AnimatedSticker'; @@ -44,7 +44,7 @@ const Sticker: FC = ({ }) => { const { showNotification, openStickerSet } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); // eslint-disable-next-line no-null/no-null diff --git a/src/components/middle/message/StoryMention.tsx b/src/components/middle/message/StoryMention.tsx index 9bcc2e58c..3decf68d5 100644 --- a/src/components/middle/message/StoryMention.tsx +++ b/src/components/middle/message/StoryMention.tsx @@ -16,9 +16,9 @@ import buildClassName from '../../../util/buildClassName'; import renderText from '../../common/helpers/renderText'; import useEnsureStory from '../../../hooks/useEnsureStory'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; interface OwnProps { message: ApiMessage; @@ -36,7 +36,7 @@ function StoryMention({ }: OwnProps & StateProps) { const { openStoryViewer } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { storyData } = message.content; diff --git a/src/components/middle/message/Video.tsx b/src/components/middle/message/Video.tsx index 8d9996aff..c1972f9b0 100644 --- a/src/components/middle/message/Video.tsx +++ b/src/components/middle/message/Video.tsx @@ -16,7 +16,7 @@ import { isOwnMessage, } from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; -import { formatMediaDuration } from '../../../util/date/dateFormat'; +import { formatMediaDuration } from '../../../util/dates/dateFormat'; import * as mediaLoader from '../../../util/mediaLoader'; import { calculateVideoDimensions } from '../../common/helpers/mediaDimensions'; import { MIN_MEDIA_HEIGHT } from './helpers/mediaDimensions'; diff --git a/src/components/middle/message/WebPage.tsx b/src/components/middle/message/WebPage.tsx index 46d6aed04..2fb6235ca 100644 --- a/src/components/middle/message/WebPage.tsx +++ b/src/components/middle/message/WebPage.tsx @@ -16,8 +16,8 @@ import { getWebpageButtonText } from './helpers/webpageType'; import useDynamicColorListener from '../../../hooks/stickers/useDynamicColorListener'; import useAppLayout from '../../../hooks/useAppLayout'; import useEnsureStory from '../../../hooks/useEnsureStory'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Audio from '../../common/Audio'; import Document from '../../common/Document'; @@ -87,7 +87,7 @@ const WebPage: FC = ({ // eslint-disable-next-line no-null/no-null const stickersRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const handleMediaClick = useLastCallback(() => { onMediaClick!(); diff --git a/src/components/middle/message/hooks/useInnerHandlers.ts b/src/components/middle/message/hooks/useInnerHandlers.ts index 1bb8746b5..5d2012612 100644 --- a/src/components/middle/message/hooks/useInnerHandlers.ts +++ b/src/components/middle/message/hooks/useInnerHandlers.ts @@ -4,7 +4,7 @@ import { getActions } from '../../../../global'; import type { ApiMessage, ApiPeer, ApiStory, ApiTopic, ApiUser, } from '../../../../api/types'; -import type { LangFn } from '../../../../hooks/useLang'; +import type { LangFn } from '../../../../hooks/useOldLang'; import type { IAlbum, ThreadId } from '../../../../types'; import { MAIN_THREAD_ID } from '../../../../api/types'; import { MediaViewerOrigin } from '../../../../types'; diff --git a/src/components/middle/message/reactions/ReactionPicker.tsx b/src/components/middle/message/reactions/ReactionPicker.tsx index 54c0fcd53..b553ae6e4 100644 --- a/src/components/middle/message/reactions/ReactionPicker.tsx +++ b/src/components/middle/message/reactions/ReactionPicker.tsx @@ -20,9 +20,9 @@ import { buildCustomEmojiHtml } from '../../composer/helpers/customEmoji'; import { getIsMobile } from '../../../../hooks/useAppLayout'; import useCurrentOrPrev from '../../../../hooks/useCurrentOrPrev'; -import useLang from '../../../../hooks/useLang'; import useLastCallback from '../../../../hooks/useLastCallback'; import useMenuPosition from '../../../../hooks/useMenuPosition'; +import useOldLang from '../../../../hooks/useOldLang'; import CustomEmojiPicker from '../../../common/CustomEmojiPicker'; import Menu from '../../../ui/Menu'; @@ -62,7 +62,7 @@ const ReactionPicker: FC = ({ toggleReaction, closeReactionPicker, sendMessage, showNotification, sendStoryReaction, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const renderedMessageId = useCurrentOrPrev(message?.id, true); const renderedChatId = useCurrentOrPrev(message?.chatId, true); diff --git a/src/components/middle/message/reactions/ReactionSelector.tsx b/src/components/middle/message/reactions/ReactionSelector.tsx index 72b0a4ed2..04ee8edd8 100644 --- a/src/components/middle/message/reactions/ReactionSelector.tsx +++ b/src/components/middle/message/reactions/ReactionSelector.tsx @@ -12,8 +12,8 @@ import { } from '../../../../global/helpers'; import buildClassName, { createClassNameBuilder } from '../../../../util/buildClassName'; -import useLang from '../../../../hooks/useLang'; import useLastCallback from '../../../../hooks/useLastCallback'; +import useOldLang from '../../../../hooks/useOldLang'; import Button from '../../../ui/Button'; import Link from '../../../ui/Link'; @@ -67,7 +67,7 @@ const ReactionSelector: FC = ({ const { openPremiumModal } = getActions(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const areReactionsLocked = isInSavedMessages && !isCurrentUserPremium && !isInStoryViewer; diff --git a/src/components/middle/message/reactions/Reactions.tsx b/src/components/middle/message/reactions/Reactions.tsx index fddf165ee..f38f460a6 100644 --- a/src/components/middle/message/reactions/Reactions.tsx +++ b/src/components/middle/message/reactions/Reactions.tsx @@ -18,8 +18,8 @@ import buildClassName from '../../../../util/buildClassName'; import { getMessageKey } from '../../../../util/messageKey'; import useDerivedState from '../../../../hooks/useDerivedState'; -import useLang from '../../../../hooks/useLang'; import useLastCallback from '../../../../hooks/useLastCallback'; +import useOldLang from '../../../../hooks/useOldLang'; import ReactionButton from './ReactionButton'; import SavedTagButton from './SavedTagButton'; @@ -57,7 +57,7 @@ const Reactions: FC = ({ searchTextMessagesLocal, openPremiumModal, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { results, areTags, recentReactions } = message.reactions!; diff --git a/src/components/middle/message/reactions/SavedTagButton.tsx b/src/components/middle/message/reactions/SavedTagButton.tsx index 957045289..1e605d7a7 100644 --- a/src/components/middle/message/reactions/SavedTagButton.tsx +++ b/src/components/middle/message/reactions/SavedTagButton.tsx @@ -11,9 +11,9 @@ import { REM } from '../../../common/helpers/mediaDimensions'; import useContextMenuHandlers from '../../../../hooks/useContextMenuHandlers'; import useFlag from '../../../../hooks/useFlag'; -import useLang from '../../../../hooks/useLang'; import useLastCallback from '../../../../hooks/useLastCallback'; import useMenuPosition from '../../../../hooks/useMenuPosition'; +import useOldLang from '../../../../hooks/useOldLang'; import ReactionAnimatedEmoji from '../../../common/reactions/ReactionAnimatedEmoji'; import PromptDialog from '../../../modals/prompt/PromptDialog'; @@ -66,7 +66,7 @@ const SavedTagButton = ({ // eslint-disable-next-line no-null/no-null const menuRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const [isRenamePromptOpen, openRenamePrompt, closeRenamePrompt] = useFlag(); const { title, count } = tag || {}; diff --git a/src/components/modals/attachBotInstall/AttachBotInstallModal.tsx b/src/components/modals/attachBotInstall/AttachBotInstallModal.tsx index 2a8343d1a..340afd1c5 100644 --- a/src/components/modals/attachBotInstall/AttachBotInstallModal.tsx +++ b/src/components/modals/attachBotInstall/AttachBotInstallModal.tsx @@ -9,7 +9,7 @@ import type { TabState } from '../../../global/types'; import { MINI_APP_TOS_URL } from '../../../config'; import renderText from '../../common/helpers/renderText'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Checkbox from '../../ui/Checkbox'; import ConfirmDialog from '../../ui/ConfirmDialog'; @@ -26,7 +26,7 @@ const AttachBotInstallModal: FC = ({ const [isTosAccepted, setIsTosAccepted] = useState(false); - const lang = useLang(); + const lang = useOldLang(); const handleConfirm = useCallback(() => { confirmAttachBotInstall({ diff --git a/src/components/modals/boost/BoostModal.tsx b/src/components/modals/boost/BoostModal.tsx index 829b9451c..dc82dc326 100644 --- a/src/components/modals/boost/BoostModal.tsx +++ b/src/components/modals/boost/BoostModal.tsx @@ -7,14 +7,14 @@ import type { TabState } from '../../../global/types'; import { getChatTitle, isChatAdmin, isChatChannel } from '../../../global/helpers'; import { selectChat, selectChatFullInfo, selectIsCurrentUserPremium } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; -import { formatDateInFuture } from '../../../util/date/dateFormat'; +import { formatDateInFuture } from '../../../util/dates/dateFormat'; import { getServerTime } from '../../../util/serverTime'; import { getBoostProgressInfo } from '../../common/helpers/boostInfo'; import renderText from '../../common/helpers/renderText'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import Icon from '../../common/icons/Icon'; @@ -79,7 +79,7 @@ const BoostModal = ({ const isOpen = Boolean(modal); - const lang = useLang(); + const lang = useOldLang(); useEffect(() => { if (chat && !chatFullInfo) { diff --git a/src/components/modals/chatlist/ChatlistAlready.tsx b/src/components/modals/chatlist/ChatlistAlready.tsx index 3a50df18e..b0d58ab5f 100644 --- a/src/components/modals/chatlist/ChatlistAlready.tsx +++ b/src/components/modals/chatlist/ChatlistAlready.tsx @@ -7,7 +7,7 @@ import type { ApiChatFolder, ApiChatlistInviteAlready } from '../../../api/types import buildClassName from '../../../util/buildClassName'; import renderText from '../../common/helpers/renderText'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Picker from '../../common/Picker'; import Badge from '../../ui/Badge'; @@ -23,7 +23,7 @@ type OwnProps = { const ChatlistAlready: FC = ({ invite, folder }) => { const { closeChatlistModal, joinChatlistInvite } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [selectedPeerIds, setSelectedPeerIds] = useState(invite.missingPeerIds); diff --git a/src/components/modals/chatlist/ChatlistDelete.tsx b/src/components/modals/chatlist/ChatlistDelete.tsx index 86f79b42a..98f6daaf5 100644 --- a/src/components/modals/chatlist/ChatlistDelete.tsx +++ b/src/components/modals/chatlist/ChatlistDelete.tsx @@ -8,7 +8,7 @@ import buildClassName from '../../../util/buildClassName'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; import renderText from '../../common/helpers/renderText'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Picker from '../../common/Picker'; import Badge from '../../ui/Badge'; @@ -27,7 +27,7 @@ const ChatlistDelete: FC = ({ }) => { const { closeChatlistModal, leaveChatlist } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [selectedPeerIds, setSelectedPeerIds] = useState(suggestedPeerIds); diff --git a/src/components/modals/chatlist/ChatlistModal.tsx b/src/components/modals/chatlist/ChatlistModal.tsx index 81fdc1d74..c0feea9ba 100644 --- a/src/components/modals/chatlist/ChatlistModal.tsx +++ b/src/components/modals/chatlist/ChatlistModal.tsx @@ -7,7 +7,7 @@ import type { TabState } from '../../../global/types'; import { selectChatFolder } from '../../../global/selectors'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import Modal from '../../ui/Modal'; @@ -32,7 +32,7 @@ const ChatlistInviteModal: FC = ({ }) => { const { closeChatlistModal } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const isOpen = Boolean(modal); const renderingInfo = usePrevious(modal) || modal; diff --git a/src/components/modals/chatlist/ChatlistNew.tsx b/src/components/modals/chatlist/ChatlistNew.tsx index 610bc7a9c..c7f0c08aa 100644 --- a/src/components/modals/chatlist/ChatlistNew.tsx +++ b/src/components/modals/chatlist/ChatlistNew.tsx @@ -9,7 +9,7 @@ import type { ApiChatlistInviteNew } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import renderText from '../../common/helpers/renderText'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Picker from '../../common/Picker'; import Badge from '../../ui/Badge'; @@ -24,7 +24,7 @@ type OwnProps = { const ChatlistNew: FC = ({ invite }) => { const { closeChatlistModal, joinChatlistInvite } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [selectedPeerIds, setSelectedPeerIds] = useState(invite.peerIds); const joinedIds = useMemo(() => { diff --git a/src/components/modals/collectible/CollectibleInfoModal.tsx b/src/components/modals/collectible/CollectibleInfoModal.tsx index 55014b504..ea9a17f59 100644 --- a/src/components/modals/collectible/CollectibleInfoModal.tsx +++ b/src/components/modals/collectible/CollectibleInfoModal.tsx @@ -9,15 +9,15 @@ import type { ApiCountryCode } from '../../../api/types'; import type { TabState } from '../../../global/types'; import { copyTextToClipboard } from '../../../util/clipboard'; -import { formatDateAtTime } from '../../../util/date/dateFormat'; +import { formatDateAtTime } from '../../../util/dates/dateFormat'; import { formatCurrency } from '../../../util/formatCurrency'; import { formatPhoneNumberWithCode } from '../../../util/phoneNumber'; import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets'; import formatUsername from '../../common/helpers/formatUsername'; import renderText from '../../common/helpers/renderText'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import AnimatedIconWithPreview from '../../common/AnimatedIconWithPreview'; import Icon from '../../common/icons/Icon'; @@ -47,7 +47,7 @@ const CollectibleInfoModal: FC = ({ openUrl, showNotification, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const isUsername = modal?.type === 'username'; diff --git a/src/components/modals/giftcode/GiftCodeModal.tsx b/src/components/modals/giftcode/GiftCodeModal.tsx index d1ef37261..58ed565dd 100644 --- a/src/components/modals/giftcode/GiftCodeModal.tsx +++ b/src/components/modals/giftcode/GiftCodeModal.tsx @@ -7,11 +7,11 @@ import type { TabState } from '../../../global/types'; import { TME_LINK_PREFIX } from '../../../config'; import { selectChatMessage, selectSender } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; -import { formatDateTimeToString } from '../../../util/date/dateFormat'; +import { formatDateTimeToString } from '../../../util/dates/dateFormat'; import renderText from '../../common/helpers/renderText'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import LinkField from '../../common/LinkField'; import TableInfoModal, { type TableData } from '../common/TableInfoModal'; @@ -39,7 +39,7 @@ const GiftCodeModal = ({ const { closeGiftCodeModal, applyGiftCode, focusMessage, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const isOpen = Boolean(modal); const canUse = (!modal?.info.toId || modal?.info.toId === currentUserId) && !modal?.info.usedAt; diff --git a/src/components/modals/inviteViaLink/InviteViaLinkModal.tsx b/src/components/modals/inviteViaLink/InviteViaLinkModal.tsx index 6c191f97f..439664f86 100644 --- a/src/components/modals/inviteViaLink/InviteViaLinkModal.tsx +++ b/src/components/modals/inviteViaLink/InviteViaLinkModal.tsx @@ -14,8 +14,8 @@ import { selectChat } from '../../../global/selectors'; import { partition } from '../../../util/iteratees'; import renderText from '../../common/helpers/renderText'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import AvatarList from '../../common/AvatarList'; import Picker from '../../common/Picker'; @@ -40,7 +40,7 @@ const InviteViaLinkModal: FC = ({ const { sendInviteMessages, closeInviteViaLinkModal, openPremiumModal } = getActions(); const { missingUsers } = modal || {}; - const lang = useLang(); + const lang = useOldLang(); const [selectedMemberIds, setSelectedMemberIds] = useState([]); const userIds = useMemo(() => missingUsers?.map((user) => user.id), [missingUsers]); diff --git a/src/components/modals/map/MapModal.tsx b/src/components/modals/map/MapModal.tsx index edfeb7098..c4d2717f6 100644 --- a/src/components/modals/map/MapModal.tsx +++ b/src/components/modals/map/MapModal.tsx @@ -6,8 +6,8 @@ import type { TabState } from '../../../global/types'; import { prepareMapUrl } from '../../../util/map'; import { IS_IOS, IS_MAC_OS } from '../../../util/windowEnvironment'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Button from '../../ui/Button'; import Modal from '../../ui/Modal'; @@ -23,7 +23,7 @@ const OpenMapModal = ({ modal }: OwnProps) => { const { point: geoPoint, zoom } = modal || {}; - const lang = useLang(); + const lang = useOldLang(); const isOpen = Boolean(geoPoint); diff --git a/src/components/modals/oneTimeMedia/OneTimeMediaModal.tsx b/src/components/modals/oneTimeMedia/OneTimeMediaModal.tsx index 965535b67..bdf4c1cee 100644 --- a/src/components/modals/oneTimeMedia/OneTimeMediaModal.tsx +++ b/src/components/modals/oneTimeMedia/OneTimeMediaModal.tsx @@ -9,8 +9,8 @@ import { selectTheme } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useShowTransition from '../../../hooks/useShowTransition'; import Audio from '../../common/Audio'; @@ -30,7 +30,7 @@ const OneTimeMediaModal = ({ closeOneTimeMediaModal, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const message = useCurrentOrPrev(modal?.message, true); const { diff --git a/src/components/modals/prompt/PromptDialog.tsx b/src/components/modals/prompt/PromptDialog.tsx index 83639d597..98419df17 100644 --- a/src/components/modals/prompt/PromptDialog.tsx +++ b/src/components/modals/prompt/PromptDialog.tsx @@ -1,7 +1,7 @@ import React, { memo, useState } from '../../../lib/teact/teact'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Button from '../../ui/Button'; import InputText from '../../ui/InputText'; @@ -32,7 +32,7 @@ const PromptDialog = ({ onClose, onSubmit, }: OwnProps) => { - const lang = useLang(); + const lang = useOldLang(); const [text, setText] = useState(initialValue); diff --git a/src/components/modals/reportAd/ReportAdModal.tsx b/src/components/modals/reportAd/ReportAdModal.tsx index 466f2b699..9a37f042d 100644 --- a/src/components/modals/reportAd/ReportAdModal.tsx +++ b/src/components/modals/reportAd/ReportAdModal.tsx @@ -8,8 +8,8 @@ import type { TabState } from '../../../global/types'; import { requestMeasure, requestMutation } from '../../../lib/fasterdom/fasterdom'; import buildClassName from '../../../util/buildClassName'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; import SafeLink from '../../common/SafeLink'; @@ -32,7 +32,7 @@ const ReportAdModal = ({ const { reportSponsoredMessage, closeReportAdModal, openPreviousReportAdModal, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const isOpen = Boolean(modal); // eslint-disable-next-line no-null/no-null diff --git a/src/components/modals/stars/BalanceBlock.tsx b/src/components/modals/stars/BalanceBlock.tsx index ddecfaa94..983d55f55 100644 --- a/src/components/modals/stars/BalanceBlock.tsx +++ b/src/components/modals/stars/BalanceBlock.tsx @@ -3,7 +3,7 @@ import React, { memo } from '../../../lib/teact/teact'; import buildClassName from '../../../util/buildClassName'; import { formatInteger } from '../../../util/textFormat'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import StarIcon from '../../common/icons/StarIcon'; @@ -15,7 +15,7 @@ type OwnProps = { }; const BalanceBlock = ({ balance, className }: OwnProps) => { - const lang = useLang(); + const lang = useOldLang(); return (
diff --git a/src/components/modals/stars/StarsBalanceModal.tsx b/src/components/modals/stars/StarsBalanceModal.tsx index 13517e6fa..c6561103d 100644 --- a/src/components/modals/stars/StarsBalanceModal.tsx +++ b/src/components/modals/stars/StarsBalanceModal.tsx @@ -13,8 +13,8 @@ import { formatCurrency } from '../../../util/formatCurrency'; import renderText from '../../common/helpers/renderText'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; import StarIcon from '../../common/icons/StarIcon'; @@ -56,7 +56,7 @@ const StarsBalanceModal = ({ const { balance, history, topupOptions } = starsBalanceState || {}; - const lang = useLang(); + const lang = useOldLang(); const [isHeaderHidden, setHeaderHidden] = useState(true); const [areOptionsExtended, markOptionsExtended, unmarkOptionsExtended] = useFlag(); @@ -218,7 +218,7 @@ function StarTopupOption({ }: { option: ApiStarTopupOption; starsCount: number; onClick?: (option: ApiStarTopupOption) => void; }) { - const lang = useLang(); + const lang = useOldLang(); return (
onClick?.(option)}> diff --git a/src/components/modals/stars/StarsPaymentModal.tsx b/src/components/modals/stars/StarsPaymentModal.tsx index e41888a15..570e9f7e5 100644 --- a/src/components/modals/stars/StarsPaymentModal.tsx +++ b/src/components/modals/stars/StarsPaymentModal.tsx @@ -10,8 +10,8 @@ import buildClassName from '../../../util/buildClassName'; import renderText from '../../common/helpers/renderText'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import StarIcon from '../../common/icons/StarIcon'; @@ -42,7 +42,7 @@ const StarPaymentModal = ({ const photo = payment?.invoice?.photo; - const lang = useLang(); + const lang = useOldLang(); useEffect(() => { if (!isOpen) { diff --git a/src/components/modals/stars/StarsTransactionItem.tsx b/src/components/modals/stars/StarsTransactionItem.tsx index b5e71fc6d..7c0e91f84 100644 --- a/src/components/modals/stars/StarsTransactionItem.tsx +++ b/src/components/modals/stars/StarsTransactionItem.tsx @@ -12,11 +12,11 @@ import { getSenderTitle } from '../../../global/helpers'; import { buildStarsTransactionCustomPeer, formatStarsTransactionAmount } from '../../../global/helpers/payments'; import { selectPeer } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; -import { formatDateTimeToString } from '../../../util/date/dateFormat'; +import { formatDateTimeToString } from '../../../util/dates/dateFormat'; import { CUSTOM_PEER_PREMIUM } from '../../../util/objects/customPeer'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import useSelector from '../../../hooks/useSelector'; import Avatar from '../../common/Avatar'; @@ -43,7 +43,7 @@ const StarsTransactionItem = ({ transaction }: OwnProps) => { isRefund, peer: transactionPeer, } = transaction; - const lang = useLang(); + const lang = useOldLang(); const peerId = transactionPeer.type === 'peer' ? transactionPeer.id : undefined; const peer = useSelector(selectOptionalPeer(peerId)); diff --git a/src/components/modals/urlAuth/UrlAuthModal.tsx b/src/components/modals/urlAuth/UrlAuthModal.tsx index c8782161c..0581916ab 100644 --- a/src/components/modals/urlAuth/UrlAuthModal.tsx +++ b/src/components/modals/urlAuth/UrlAuthModal.tsx @@ -13,7 +13,7 @@ import { ensureProtocol } from '../../../util/ensureProtocol'; import renderText from '../../common/helpers/renderText'; import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Checkbox from '../../ui/Checkbox'; import ConfirmDialog from '../../ui/ConfirmDialog'; @@ -38,7 +38,7 @@ const UrlAuthModal: FC = ({ const { domain, botId, shouldRequestWriteAccess } = currentAuth?.request || {}; const bot = botId ? getGlobal().users.byId[botId] : undefined; - const lang = useLang(); + const lang = useOldLang(); const handleOpen = useCallback(() => { if (modal?.url && isLoginChecked) { diff --git a/src/components/modals/webApp/WebAppModal.tsx b/src/components/modals/webApp/WebAppModal.tsx index 1c8776899..7b9b47174 100644 --- a/src/components/modals/webApp/WebAppModal.tsx +++ b/src/components/modals/webApp/WebAppModal.tsx @@ -25,8 +25,8 @@ import renderText from '../../common/helpers/renderText'; import useInterval from '../../../hooks/schedulers/useInterval'; import useAppLayout from '../../../hooks/useAppLayout'; import useFlag from '../../../hooks/useFlag'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import useSyncEffect from '../../../hooks/useSyncEffect'; import usePopupLimit from './hooks/usePopupLimit'; @@ -138,7 +138,7 @@ const WebAppModal: FC = ({ // eslint-disable-next-line no-null/no-null const frameRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { url, buttonText, queryId, replyInfo, } = modal || {}; diff --git a/src/components/payment/CardInput.tsx b/src/components/payment/CardInput.tsx index df8e43b36..0b46534ca 100644 --- a/src/components/payment/CardInput.tsx +++ b/src/components/payment/CardInput.tsx @@ -8,7 +8,7 @@ import { CardType, detectCardType } from '../common/helpers/detectCardType'; import { formatCardNumber } from '../middle/helpers/inputFormatters'; import useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import InputText from '../ui/InputText'; @@ -27,7 +27,7 @@ export type OwnProps = { }; const CardInput : FC = ({ value, error, onChange }) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const cardNumberRef = useRef(null); diff --git a/src/components/payment/Checkout.tsx b/src/components/payment/Checkout.tsx index 51058eba3..1e2e16bd7 100644 --- a/src/components/payment/Checkout.tsx +++ b/src/components/payment/Checkout.tsx @@ -15,8 +15,8 @@ import buildClassName from '../../util/buildClassName'; import { formatCurrency } from '../../util/formatCurrency'; import renderText from '../common/helpers/renderText'; -import useLang from '../../hooks/useLang'; import useMedia from '../../hooks/useMedia'; +import useOldLang from '../../hooks/useOldLang'; import SafeLink from '../common/SafeLink'; import Checkbox from '../ui/Checkbox'; @@ -70,7 +70,7 @@ const Checkout: FC = ({ }) => { const { setPaymentStep } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const isInteractive = Boolean(dispatch); const { diff --git a/src/components/payment/ConfirmPayment.tsx b/src/components/payment/ConfirmPayment.tsx index 2fbad8951..8fbc4034c 100644 --- a/src/components/payment/ConfirmPayment.tsx +++ b/src/components/payment/ConfirmPayment.tsx @@ -4,7 +4,7 @@ import { getActions } from '../../global'; import { TME_LINK_PREFIX } from '../../config'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import './ConfirmPayment.scss'; @@ -40,7 +40,7 @@ const ConfirmPayment: FC = ({ }) => { const { openTelegramLink } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const handleMessage = useCallback((event: MessageEvent) => { try { diff --git a/src/components/payment/ExpiryInput.tsx b/src/components/payment/ExpiryInput.tsx index 9c31a11ef..4f41e8123 100644 --- a/src/components/payment/ExpiryInput.tsx +++ b/src/components/payment/ExpiryInput.tsx @@ -3,7 +3,7 @@ import React, { memo, useCallback } from '../../lib/teact/teact'; import { formatCardExpiry } from '../middle/helpers/inputFormatters'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import InputText from '../ui/InputText'; @@ -16,7 +16,7 @@ export type OwnProps = { }; const ExpiryInput : FC = ({ value, error, onChange }) => { - const lang = useLang(); + const lang = useOldLang(); const handleChange = useCallback((e) => { const newValue = e.target.value; diff --git a/src/components/payment/PasswordConfirm.tsx b/src/components/payment/PasswordConfirm.tsx index 357b46971..8da35ae23 100644 --- a/src/components/payment/PasswordConfirm.tsx +++ b/src/components/payment/PasswordConfirm.tsx @@ -7,7 +7,7 @@ import type { FormState } from '../../hooks/reducers/usePaymentReducer'; import { selectTabState } from '../../global/selectors'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import PasswordForm from '../common/PasswordForm'; import PasswordMonkey from '../common/PasswordMonkey'; @@ -35,7 +35,7 @@ const PasswordConfirm: FC = ({ }) => { const { clearPaymentError } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [shouldShowPassword, setShouldShowPassword] = useState(false); const cardName = useMemo(() => { return savedCredentials?.length && state.savedCredentialId diff --git a/src/components/payment/PaymentInfo.tsx b/src/components/payment/PaymentInfo.tsx index 16e015b6b..6481185d3 100644 --- a/src/components/payment/PaymentInfo.tsx +++ b/src/components/payment/PaymentInfo.tsx @@ -7,7 +7,7 @@ import React, { import type { ApiCountry } from '../../api/types'; import type { FormEditDispatch, FormState } from '../../hooks/reducers/usePaymentReducer'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Checkbox from '../ui/Checkbox'; import InputText from '../ui/InputText'; @@ -75,7 +75,7 @@ const PaymentInfo: FC = ({ dispatch({ type: 'changeSaveCredentials', payload: e.target.value }); }, [dispatch]); - const lang = useLang(); + const lang = useOldLang(); const { formErrors = {} } = state; diff --git a/src/components/payment/PaymentModal.tsx b/src/components/payment/PaymentModal.tsx index 7a7728d41..559bfed27 100644 --- a/src/components/payment/PaymentModal.tsx +++ b/src/components/payment/PaymentModal.tsx @@ -20,8 +20,8 @@ import { detectCardTypeText } from '../common/helpers/detectCardType'; import usePaymentReducer from '../../hooks/reducers/usePaymentReducer'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import Button from '../ui/Button'; @@ -128,7 +128,7 @@ const PaymentModal: FC = ({ setSmartGlocalCardInfo, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isModalOpen, openModal, closeModal] = useFlag(); const [paymentState, paymentDispatch] = usePaymentReducer(); diff --git a/src/components/payment/ReceiptModal.tsx b/src/components/payment/ReceiptModal.tsx index 6d95f4dda..4e74ae091 100644 --- a/src/components/payment/ReceiptModal.tsx +++ b/src/components/payment/ReceiptModal.tsx @@ -12,10 +12,10 @@ import { buildStarsTransactionCustomPeer, formatStarsTransactionAmount } from '. import { selectTabState, selectUser } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; import { copyTextToClipboard } from '../../util/clipboard'; -import { formatDateTimeToString } from '../../util/date/dateFormat'; +import { formatDateTimeToString } from '../../util/dates/dateFormat'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Icon from '../common/icons/Icon'; import StarIcon from '../common/icons/StarIcon'; @@ -44,7 +44,7 @@ const ReceiptModal: FC = ({ isOpen, receipt, bot, onClose, }) => { const { showNotification } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const starModalData = useMemo(() => { if (receipt?.type !== 'stars') return undefined; @@ -150,7 +150,7 @@ function ReceiptModalRegular({ text, title, } = receipt; - const lang = useLang(); + const lang = useOldLang(); const [isModalOpen, openModal, closeModal] = useFlag(); diff --git a/src/components/payment/SavedPaymentCredentials.tsx b/src/components/payment/SavedPaymentCredentials.tsx index 99ffa8c3a..026717bd9 100644 --- a/src/components/payment/SavedPaymentCredentials.tsx +++ b/src/components/payment/SavedPaymentCredentials.tsx @@ -6,7 +6,7 @@ import type { FormEditDispatch, FormState } from '../../hooks/reducers/usePaymen import { MEMO_EMPTY_ARRAY } from '../../util/memo'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import RadioGroup from '../ui/RadioGroup'; @@ -24,7 +24,7 @@ const SavedPaymentCredentials: FC = ({ dispatch, onNewCardClick, }) => { - const lang = useLang(); + const lang = useOldLang(); const options = useMemo(() => { return savedCredentials?.length diff --git a/src/components/payment/Shipping.tsx b/src/components/payment/Shipping.tsx index fb3c11f5c..d6eef30a7 100644 --- a/src/components/payment/Shipping.tsx +++ b/src/components/payment/Shipping.tsx @@ -9,7 +9,7 @@ import type { ShippingOption } from '../../types'; import { formatCurrency } from '../../util/formatCurrency'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import RadioGroup from '../ui/RadioGroup'; @@ -28,7 +28,7 @@ const Shipping: FC = ({ currency, dispatch, }) => { - const lang = useLang(); + const lang = useOldLang(); useEffect(() => { if (!shippingOptions || !shippingOptions.length || state.shipping) { diff --git a/src/components/payment/ShippingInfo.tsx b/src/components/payment/ShippingInfo.tsx index b1e8251ee..f9c8ff493 100644 --- a/src/components/payment/ShippingInfo.tsx +++ b/src/components/payment/ShippingInfo.tsx @@ -8,7 +8,7 @@ import type { ApiCountry } from '../../api/types'; import type { FormEditDispatch, FormState } from '../../hooks/reducers/usePaymentReducer'; import useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Checkbox from '../ui/Checkbox'; import InputText from '../ui/InputText'; @@ -49,7 +49,7 @@ const ShippingInfo: FC = ({ } }, [state.countryIso2]); - const lang = useLang(); + const lang = useOldLang(); useFocusAfterAnimation(inputRef); diff --git a/src/components/right/AddChatMembers.tsx b/src/components/right/AddChatMembers.tsx index a210497c9..5fee822b7 100644 --- a/src/components/right/AddChatMembers.tsx +++ b/src/components/right/AddChatMembers.tsx @@ -17,7 +17,7 @@ import { unique } from '../../util/iteratees'; import sortChatIds from '../common/helpers/sortChatIds'; import useHistoryBack from '../../hooks/useHistoryBack'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import Picker from '../common/Picker'; @@ -61,7 +61,7 @@ const AddChatMembers: FC = ({ }) => { const { setUserSearchQuery } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [selectedMemberIds, setSelectedMemberIds] = useState([]); const prevSelectedMemberIds = usePrevious(selectedMemberIds); const noPickerScrollRestore = prevSelectedMemberIds === selectedMemberIds; diff --git a/src/components/right/CreateTopic.tsx b/src/components/right/CreateTopic.tsx index c6e69e62f..12963b45b 100644 --- a/src/components/right/CreateTopic.tsx +++ b/src/components/right/CreateTopic.tsx @@ -15,7 +15,7 @@ import { getTopicColors } from '../../util/forumColors'; import { REM } from '../common/helpers/mediaDimensions'; import useHistoryBack from '../../hooks/useHistoryBack'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import CustomEmojiPicker from '../common/CustomEmojiPicker'; import TopicIcon from '../common/TopicIcon'; @@ -50,7 +50,7 @@ const CreateTopic: FC = ({ const [title, setTitle] = useState(''); const [iconColorIndex, setIconColorIndex] = useState(0); const [iconEmojiId, setIconEmojiId] = useState(undefined); - const lang = useLang(); + const lang = useOldLang(); const isTouched = Boolean(title); const isLoading = Boolean(createTopicPanel?.isLoading); diff --git a/src/components/right/DeleteMemberModal.tsx b/src/components/right/DeleteMemberModal.tsx index ca499fca0..37b3d8cdd 100644 --- a/src/components/right/DeleteMemberModal.tsx +++ b/src/components/right/DeleteMemberModal.tsx @@ -8,7 +8,7 @@ import { getUserFirstOrLastName } from '../../global/helpers'; import { selectCurrentChat, selectUser } from '../../global/selectors'; import renderText from '../common/helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import ConfirmDialog from '../ui/ConfirmDialog'; @@ -32,7 +32,7 @@ const DeleteMemberModal: FC = ({ }) => { const { deleteChatMember } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const handleDeleteChatMember = useCallback(() => { deleteChatMember({ chatId: chat!.id, userId: userId! }); diff --git a/src/components/right/EditTopic.tsx b/src/components/right/EditTopic.tsx index ffc428e9b..5feb9233e 100644 --- a/src/components/right/EditTopic.tsx +++ b/src/components/right/EditTopic.tsx @@ -13,7 +13,7 @@ import buildClassName from '../../util/buildClassName'; import { REM } from '../common/helpers/mediaDimensions'; import useHistoryBack from '../../hooks/useHistoryBack'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import CustomEmojiPicker from '../common/CustomEmojiPicker'; import TopicIcon from '../common/TopicIcon'; @@ -51,7 +51,7 @@ const EditTopic: FC = ({ const { editTopic, openPremiumModal } = getActions(); const [title, setTitle] = useState(''); const [iconEmojiId, setIconEmojiId] = useState(undefined); - const lang = useLang(); + const lang = useOldLang(); const isLoading = Boolean(editTopicPanel?.isLoading); const isGeneral = topic?.id === GENERAL_TOPIC_ID; diff --git a/src/components/right/GifSearch.tsx b/src/components/right/GifSearch.tsx index 7900c08b7..9d16f557d 100644 --- a/src/components/right/GifSearch.tsx +++ b/src/components/right/GifSearch.tsx @@ -20,7 +20,7 @@ import { IS_TOUCH_ENV } from '../../util/windowEnvironment'; import useHistoryBack from '../../hooks/useHistoryBack'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import useSchedule from '../../hooks/useSchedule'; import GifButton from '../common/GifButton'; @@ -108,7 +108,7 @@ const GifSearch: FC = ({ searchMoreGifs(); }, [searchMoreGifs]); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/right/PollAnswerResults.tsx b/src/components/right/PollAnswerResults.tsx index 20731c01b..75df1a3c9 100644 --- a/src/components/right/PollAnswerResults.tsx +++ b/src/components/right/PollAnswerResults.tsx @@ -16,7 +16,7 @@ import { isUserId } from '../../global/helpers'; import { selectTabState } from '../../global/selectors'; import { renderTextWithEntities } from '../common/helpers/renderTextWithEntities'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import GroupChatInfo from '../common/GroupChatInfo'; @@ -62,7 +62,7 @@ const PollAnswerResults: FC = ({ const [isLoading, setIsLoading] = useState(true); const areVotersLoaded = Boolean(voters); const { option, text } = answer; - const lang = useLang(); + const lang = useOldLang(); useEffect(() => { // For update when new votes arrive or when the user takes back his vote diff --git a/src/components/right/PollResults.tsx b/src/components/right/PollResults.tsx index 73652c024..3f9aff5e3 100644 --- a/src/components/right/PollResults.tsx +++ b/src/components/right/PollResults.tsx @@ -10,7 +10,7 @@ import { buildCollectionByKey } from '../../util/iteratees'; import { renderTextWithEntities } from '../common/helpers/renderTextWithEntities'; import useHistoryBack from '../../hooks/useHistoryBack'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Loading from '../ui/Loading'; import PollAnswerResults from './PollAnswerResults'; @@ -33,7 +33,7 @@ const PollResults: FC = ({ message, onClose, }) => { - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/right/Profile.tsx b/src/components/right/Profile.tsx index 50ae11a40..68b99cd00 100644 --- a/src/components/right/Profile.tsx +++ b/src/components/right/Profile.tsx @@ -54,8 +54,8 @@ import usePeerStoriesPolling from '../../hooks/polling/usePeerStoriesPolling'; import useCacheBuster from '../../hooks/useCacheBuster'; import useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import useAsyncRendering from './hooks/useAsyncRendering'; import useProfileState from './hooks/useProfileState'; import useProfileViewportIds from './hooks/useProfileViewportIds'; @@ -206,7 +206,7 @@ const Profile: FC = ({ const containerRef = useRef(null); // eslint-disable-next-line no-null/no-null const transitionRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const [deletingUserId, setDeletingUserId] = useState(); const profileId = isSavedDialog ? String(threadId) : (resolvedUserId || chatId); diff --git a/src/components/right/RightHeader.tsx b/src/components/right/RightHeader.tsx index c03c96463..cd3ade538 100644 --- a/src/components/right/RightHeader.tsx +++ b/src/components/right/RightHeader.tsx @@ -22,7 +22,7 @@ import { selectUser, } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; -import { getDayStartAt } from '../../util/date/dateFormat'; +import { getDayStartAt } from '../../util/dates/dateFormat'; import { debounce } from '../../util/schedulers'; import useAppLayout from '../../hooks/useAppLayout'; @@ -30,8 +30,8 @@ import useCurrentOrPrev from '../../hooks/useCurrentOrPrev'; import useElectronDrag from '../../hooks/useElectronDrag'; import useFlag from '../../hooks/useFlag'; import { useFolderManagerForChatsCount } from '../../hooks/useFolderManager'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Icon from '../common/icons/Icon'; import Button from '../ui/Button'; @@ -241,7 +241,7 @@ const RightHeader: FC = ({ }, COLUMN_ANIMATION_DURATION); }, [isColumnOpen]); - const lang = useLang(); + const lang = useOldLang(); const contentKey = isProfile ? ( profileState === ProfileState.Profile ? ( HeaderContent.Profile diff --git a/src/components/right/RightSearch.tsx b/src/components/right/RightSearch.tsx index 4fb0b22a5..eccc6f549 100644 --- a/src/components/right/RightSearch.tsx +++ b/src/components/right/RightSearch.tsx @@ -28,8 +28,8 @@ import useHistoryBack from '../../hooks/useHistoryBack'; import useHorizontalScroll from '../../hooks/useHorizontalScroll'; import useInfiniteScroll from '../../hooks/useInfiniteScroll'; import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Avatar from '../common/Avatar'; import FullNameTitle from '../common/FullNameTitle'; @@ -87,7 +87,7 @@ const RightSearch: FC = ({ // eslint-disable-next-line no-null/no-null const tagsRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, onBack: onClose, diff --git a/src/components/right/StickerSearch.tsx b/src/components/right/StickerSearch.tsx index 5513f8849..aeb4ceafc 100644 --- a/src/components/right/StickerSearch.tsx +++ b/src/components/right/StickerSearch.tsx @@ -9,7 +9,7 @@ import { throttle } from '../../util/schedulers'; import useHistoryBack from '../../hooks/useHistoryBack'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Loading from '../ui/Loading'; import StickerSetResult from './StickerSetResult'; @@ -45,7 +45,7 @@ const StickerSearch: FC = ({ // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const { observe: observeIntersection, diff --git a/src/components/right/StickerSetResult.tsx b/src/components/right/StickerSetResult.tsx index f524b49c9..7fd4c2ba9 100644 --- a/src/components/right/StickerSetResult.tsx +++ b/src/components/right/StickerSetResult.tsx @@ -10,7 +10,7 @@ import type { ObserveFn } from '../../hooks/useIntersectionObserver'; import { STICKER_SIZE_SEARCH } from '../../config'; import { selectIsCurrentUserPremium, selectShouldLoopStickers, selectStickerSet } from '../../global/selectors'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import StickerButton from '../common/StickerButton'; import Button from '../ui/Button'; @@ -40,7 +40,7 @@ const StickerSetResult: FC = ({ // eslint-disable-next-line no-null/no-null const sharedCanvasRef = useRef(null); - const lang = useLang(); + const lang = useOldLang(); const isAdded = set && !set.isArchived && Boolean(set.installedDate); const areStickersLoaded = Boolean(set?.stickers); diff --git a/src/components/right/management/JoinRequest.tsx b/src/components/right/management/JoinRequest.tsx index 419c67b00..86178e29d 100644 --- a/src/components/right/management/JoinRequest.tsx +++ b/src/components/right/management/JoinRequest.tsx @@ -7,10 +7,10 @@ import type { ApiUser } from '../../../api/types'; import { getUserFullName } from '../../../global/helpers'; import { selectUser } from '../../../global/selectors'; import { createClassNameBuilder } from '../../../util/buildClassName'; -import { formatHumanDate, formatTime, isToday } from '../../../util/date/dateFormat'; +import { formatHumanDate, formatTime, isToday } from '../../../util/dates/dateFormat'; import { getServerTime } from '../../../util/serverTime'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import Button from '../../ui/Button'; @@ -41,7 +41,7 @@ const JoinRequest: FC = ({ const { openChat, hideChatJoinRequest } = getActions(); const buildClassName = createClassNameBuilder('JoinRequest'); - const lang = useLang(); + const lang = useOldLang(); const fullName = getUserFullName(user); const fixedDate = (date - getServerTime()) * 1000 + Date.now(); diff --git a/src/components/right/management/ManageBot.tsx b/src/components/right/management/ManageBot.tsx index dff131d27..c7fce6b60 100644 --- a/src/components/right/management/ManageBot.tsx +++ b/src/components/right/management/ManageBot.tsx @@ -22,9 +22,9 @@ import renderText from '../../common/helpers/renderText'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; import AvatarEditable from '../../ui/AvatarEditable'; @@ -74,7 +74,7 @@ const ManageBot: FC = ({ const [isFieldTouched, markFieldTouched, unmarkProfileTouched] = useFlag(false); const [isAvatarTouched, markAvatarTouched, unmarkAvatarTouched] = useFlag(false); const [error, setError] = useState(); - const lang = useLang(); + const lang = useOldLang(); const username = useMemo(() => (user ? getMainUsername(user) : undefined), [user]); diff --git a/src/components/right/management/ManageChannel.tsx b/src/components/right/management/ManageChannel.tsx index eb67a1e29..b1808bf85 100644 --- a/src/components/right/management/ManageChannel.tsx +++ b/src/components/right/management/ManageChannel.tsx @@ -17,8 +17,8 @@ import { formatInteger } from '../../../util/textFormat'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import AvatarEditable from '../../ui/AvatarEditable'; import Checkbox from '../../ui/Checkbox'; @@ -91,7 +91,7 @@ const ManageChannel: FC = ({ const [error, setError] = useState(); const imageHash = chat && getChatAvatarHash(chat); const currentAvatarBlobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/right/management/ManageChatAdministrators.tsx b/src/components/right/management/ManageChatAdministrators.tsx index 1d127a9d3..be49ec832 100644 --- a/src/components/right/management/ManageChatAdministrators.tsx +++ b/src/components/right/management/ManageChatAdministrators.tsx @@ -9,7 +9,7 @@ import { getUserFullName, isChatChannel } from '../../../global/helpers'; import { selectChat, selectChatFullInfo } from '../../../global/selectors'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import PrivateChatInfo from '../../common/PrivateChatInfo'; import FloatingActionButton from '../../ui/FloatingActionButton'; @@ -40,7 +40,7 @@ const ManageChatAdministrators: FC = ({ onClose, isActive, }) => { - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/right/management/ManageChatPrivacyType.tsx b/src/components/right/management/ManageChatPrivacyType.tsx index 932de7f9f..e197f14a8 100644 --- a/src/components/right/management/ManageChatPrivacyType.tsx +++ b/src/components/right/management/ManageChatPrivacyType.tsx @@ -18,7 +18,7 @@ import { selectCurrentLimit } from '../../../global/selectors/limits'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import usePrevious from '../../../hooks/usePrevious'; import ManageUsernames from '../../common/ManageUsernames'; @@ -160,7 +160,7 @@ const ManageChatPrivacyType: FC = ({ updatePrivateLink(); }, [closeRevokeConfirmDialog, updatePrivateLink]); - const lang = useLang(); + const lang = useOldLang(); const langPrefix1 = isChannel ? 'Channel' : 'Mega'; const langPrefix2 = isChannel ? 'Channel' : 'Group'; diff --git a/src/components/right/management/ManageChatRemovedUsers.tsx b/src/components/right/management/ManageChatRemovedUsers.tsx index 04c9b5f0b..881997a72 100644 --- a/src/components/right/management/ManageChatRemovedUsers.tsx +++ b/src/components/right/management/ManageChatRemovedUsers.tsx @@ -10,7 +10,7 @@ import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import PrivateChatInfo from '../../common/PrivateChatInfo'; import FloatingActionButton from '../../ui/FloatingActionButton'; @@ -42,7 +42,7 @@ const ManageChatRemovedUsers: FC = ({ }) => { const { updateChatMemberBannedRights } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isRemoveUserModalOpen, openRemoveUserModal, closeRemoveUserModal] = useFlag(); useHistoryBack({ diff --git a/src/components/right/management/ManageDiscussion.tsx b/src/components/right/management/ManageDiscussion.tsx index e58f5716a..c9aef735d 100644 --- a/src/components/right/management/ManageDiscussion.tsx +++ b/src/components/right/management/ManageDiscussion.tsx @@ -15,7 +15,7 @@ import renderText from '../../common/helpers/renderText'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import AnimatedIcon from '../../common/AnimatedIcon'; import Avatar from '../../common/Avatar'; @@ -64,7 +64,7 @@ const ManageDiscussion: FC = ({ const [isConfirmLinkGroupDialogOpen, openConfirmLinkGroupDialog, closeConfirmLinkGroupDialog] = useFlag(); const [isJoinToSend, setIsJoinToSend] = useState(Boolean(linkedChat?.isJoinToSend)); const [isJoinRequest, setIsJoinRequest] = useState(Boolean(linkedChat?.isJoinRequest)); - const lang = useLang(); + const lang = useOldLang(); const linkedChatId = linkedChat?.id; useHistoryBack({ diff --git a/src/components/right/management/ManageGroup.tsx b/src/components/right/management/ManageGroup.tsx index 2e8f01ef3..020beea27 100644 --- a/src/components/right/management/ManageGroup.tsx +++ b/src/components/right/management/ManageGroup.tsx @@ -24,9 +24,9 @@ import renderText from '../../common/helpers/renderText'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import AvatarEditable from '../../ui/AvatarEditable'; import Checkbox from '../../ui/Checkbox'; @@ -130,7 +130,7 @@ const ManageGroup: FC = ({ const imageHash = getChatAvatarHash(chat); const currentAvatarBlobUrl = useMedia(imageHash, false, ApiMediaFormat.BlobUrl); const isPublicGroup = useMemo(() => isChatPublic(chat), [chat]); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const isPreHistoryHiddenCheckboxRef = useRef(null); diff --git a/src/components/right/management/ManageGroupAdminRights.tsx b/src/components/right/management/ManageGroupAdminRights.tsx index aba94a632..5d4b908d5 100644 --- a/src/components/right/management/ManageGroupAdminRights.tsx +++ b/src/components/right/management/ManageGroupAdminRights.tsx @@ -14,7 +14,7 @@ import { selectChat, selectChatFullInfo } from '../../../global/selectors'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import PrivateChatInfo from '../../common/PrivateChatInfo'; import Checkbox from '../../ui/Checkbox'; @@ -71,7 +71,7 @@ const ManageGroupAdminRights: FC = ({ const [isLoading, setIsLoading] = useState(false); const [isDismissConfirmationDialogOpen, openDismissConfirmationDialog, closeDismissConfirmationDialog] = useFlag(); const [customTitle, setCustomTitle] = useState(''); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/right/management/ManageGroupMembers.tsx b/src/components/right/management/ManageGroupMembers.tsx index a4e044987..28e7f6d2e 100644 --- a/src/components/right/management/ManageGroupMembers.tsx +++ b/src/components/right/management/ManageGroupMembers.tsx @@ -19,8 +19,8 @@ import usePeerStoriesPolling from '../../../hooks/polling/usePeerStoriesPolling' import useHistoryBack from '../../../hooks/useHistoryBack'; import useInfiniteScroll from '../../../hooks/useInfiniteScroll'; import useKeyboardListNavigation from '../../../hooks/useKeyboardListNavigation'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; import NothingFound from '../../common/NothingFound'; @@ -85,7 +85,7 @@ const ManageGroupMembers: FC = ({ openChat, setUserSearchQuery, closeManagement, toggleParticipantsHidden, setNewChatMembersDialogState, toggleManagement, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const inputRef = useRef(null); // eslint-disable-next-line no-null/no-null diff --git a/src/components/right/management/ManageGroupPermissions.tsx b/src/components/right/management/ManageGroupPermissions.tsx index f1ca90ad7..89728f9ec 100644 --- a/src/components/right/management/ManageGroupPermissions.tsx +++ b/src/components/right/management/ManageGroupPermissions.tsx @@ -13,7 +13,7 @@ import buildClassName from '../../../util/buildClassName'; import stopEvent from '../../../util/stopEvent'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import useManagePermissions from '../hooks/useManagePermissions'; import PrivateChatInfo from '../../common/PrivateChatInfo'; @@ -97,7 +97,7 @@ const ManageGroupPermissions: FC = ({ const { permissions, havePermissionChanged, isLoading, handlePermissionChange, setIsLoading, } = useManagePermissions(chat?.defaultBannedRights); - const lang = useLang(); + const lang = useOldLang(); const { isForum } = chat || {}; const isPublic = useMemo(() => chat && isChatPublic(chat), [chat]); const shouldDisablePermissionForPublicGroup = hasLinkedChat || isPublic; diff --git a/src/components/right/management/ManageGroupUserPermissions.tsx b/src/components/right/management/ManageGroupUserPermissions.tsx index 2063a2e33..a36a9272b 100644 --- a/src/components/right/management/ManageGroupUserPermissions.tsx +++ b/src/components/right/management/ManageGroupUserPermissions.tsx @@ -13,7 +13,7 @@ import stopEvent from '../../../util/stopEvent'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import useManagePermissions from '../hooks/useManagePermissions'; import PrivateChatInfo from '../../common/PrivateChatInfo'; @@ -69,7 +69,7 @@ const ManageGroupUserPermissions: FC = ({ permissions, havePermissionChanged, isLoading, handlePermissionChange, setIsLoading, } = useManagePermissions(selectedChatMember?.bannedRights || chat?.defaultBannedRights); const [isBanConfirmationDialogOpen, openBanConfirmationDialog, closeBanConfirmationDialog] = useFlag(); - const lang = useLang(); + const lang = useOldLang(); const { isForum } = chat || {}; diff --git a/src/components/right/management/ManageInvite.tsx b/src/components/right/management/ManageInvite.tsx index de52b631d..c78db8148 100644 --- a/src/components/right/management/ManageInvite.tsx +++ b/src/components/right/management/ManageInvite.tsx @@ -7,12 +7,12 @@ import type { ApiExportedInvite } from '../../../api/types'; import { ManagementScreens } from '../../../types'; import { selectTabState } from '../../../global/selectors'; -import { formatFullDate, formatTime } from '../../../util/date/dateFormat'; +import { formatFullDate, formatTime } from '../../../util/dates/dateFormat'; import { getServerTime } from '../../../util/serverTime'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import useSyncEffect from '../../../hooks/useSyncEffect'; import CalendarModal from '../../common/CalendarModal'; @@ -50,7 +50,7 @@ const ManageInvite: FC = ({ }) => { const { editExportedChatInvite, exportChatInvite } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isCalendarOpened, openCalendar, closeCalendar] = useFlag(); const [isRequestNeeded, setIsRequestNeeded] = useState(false); const [title, setTitle] = useState(''); diff --git a/src/components/right/management/ManageInviteInfo.tsx b/src/components/right/management/ManageInviteInfo.tsx index 99222065e..707498e99 100644 --- a/src/components/right/management/ManageInviteInfo.tsx +++ b/src/components/right/management/ManageInviteInfo.tsx @@ -7,11 +7,11 @@ import type { ApiChatInviteImporter, ApiExportedInvite, ApiUser } from '../../.. import { isChatChannel } from '../../../global/helpers'; import { selectChat, selectTabState } from '../../../global/selectors'; import { copyTextToClipboard } from '../../../util/clipboard'; -import { formatFullDate, formatMediaDateTime, formatTime } from '../../../util/date/dateFormat'; +import { formatFullDate, formatMediaDateTime, formatTime } from '../../../util/dates/dateFormat'; import { getServerTime } from '../../../util/serverTime'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import PrivateChatInfo from '../../common/PrivateChatInfo'; import Button from '../../ui/Button'; @@ -50,7 +50,7 @@ const ManageInviteInfo: FC = ({ openChat, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { usage = 0, usageLimit, link, adminId, } = invite || {}; diff --git a/src/components/right/management/ManageInvites.tsx b/src/components/right/management/ManageInvites.tsx index 0e4f84185..3bcf32be9 100644 --- a/src/components/right/management/ManageInvites.tsx +++ b/src/components/right/management/ManageInvites.tsx @@ -11,7 +11,7 @@ import { STICKER_SIZE_INVITES, TME_LINK_PREFIX } from '../../../config'; import { getMainUsername, isChatChannel } from '../../../global/helpers'; import { selectChat, selectTabState } from '../../../global/selectors'; import { copyTextToClipboard } from '../../../util/clipboard'; -import { formatCountdown, MILLISECONDS_IN_DAY } from '../../../util/date/dateFormat'; +import { formatCountdown, MILLISECONDS_IN_DAY } from '../../../util/dates/dateFormat'; import { getServerTime } from '../../../util/serverTime'; import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets'; @@ -19,7 +19,7 @@ import useInterval from '../../../hooks/schedulers/useInterval'; import useFlag from '../../../hooks/useFlag'; import useForceUpdate from '../../../hooks/useForceUpdate'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import AnimatedIcon from '../../common/AnimatedIcon'; import LinkField from '../../common/LinkField'; @@ -71,7 +71,7 @@ const ManageInvites: FC = ({ setOpenedInviteInfo, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isDeleteRevokeAllDialogOpen, openDeleteRevokeAllDialog, closeDeleteRevokeAllDialog] = useFlag(); const [isRevokeDialogOpen, openRevokeDialog, closeRevokeDialog] = useFlag(); diff --git a/src/components/right/management/ManageJoinRequests.tsx b/src/components/right/management/ManageJoinRequests.tsx index 370633c92..ed98d92d8 100644 --- a/src/components/right/management/ManageJoinRequests.tsx +++ b/src/components/right/management/ManageJoinRequests.tsx @@ -11,7 +11,7 @@ import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets'; import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import AnimatedIcon from '../../common/AnimatedIcon'; import Button from '../../ui/Button'; @@ -41,7 +41,7 @@ const ManageJoinRequests: FC = ({ const [isAcceptAllDialogOpen, openAcceptAllDialog, closeAcceptAllDialog] = useFlag(); const [isRejectAllDialogOpen, openRejectAllDialog, closeRejectAllDialog] = useFlag(); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/right/management/ManageReactions.tsx b/src/components/right/management/ManageReactions.tsx index d2f7d7dd8..6edaaea8f 100644 --- a/src/components/right/management/ManageReactions.tsx +++ b/src/components/right/management/ManageReactions.tsx @@ -13,7 +13,7 @@ import { isSameReaction } from '../../../global/helpers'; import { selectChat, selectChatFullInfo } from '../../../global/selectors'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import ReactionStaticEmoji from '../../common/ReactionStaticEmoji'; import Checkbox from '../../ui/Checkbox'; @@ -42,7 +42,7 @@ const ManageReactions: FC = ({ }) => { const { setChatEnabledReactions } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isTouched, setIsTouched] = useState(false); const [isLoading, setIsLoading] = useState(false); const [localEnabledReactions, setLocalEnabledReactions] = useState(enabledReactions); diff --git a/src/components/right/management/ManageUser.tsx b/src/components/right/management/ManageUser.tsx index 42c28c2d2..65ca31d8b 100644 --- a/src/components/right/management/ManageUser.tsx +++ b/src/components/right/management/ManageUser.tsx @@ -21,7 +21,7 @@ import { import useFlag from '../../../hooks/useFlag'; import useHistoryBack from '../../../hooks/useHistoryBack'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import PrivateChatInfo from '../../common/PrivateChatInfo'; @@ -72,7 +72,7 @@ const ManageUser: FC = ({ const [isResetPersonalPhotoDialogOpen, openResetPersonalPhotoDialog, closeResetPersonalPhotoDialog] = useFlag(); const [isProfileFieldsTouched, setIsProfileFieldsTouched] = useState(false); const [error, setError] = useState(); - const lang = useLang(); + const lang = useOldLang(); useHistoryBack({ isActive, diff --git a/src/components/right/management/RemoveGroupUserModal.tsx b/src/components/right/management/RemoveGroupUserModal.tsx index 92ae4b491..c466c132b 100644 --- a/src/components/right/management/RemoveGroupUserModal.tsx +++ b/src/components/right/management/RemoveGroupUserModal.tsx @@ -10,7 +10,7 @@ import type { ApiChat, ApiChatMember } from '../../../api/types'; import { filterUsersByName } from '../../../global/helpers'; import { selectChatFullInfo } from '../../../global/selectors'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import ChatOrUserPicker from '../../common/ChatOrUserPicker'; @@ -37,7 +37,7 @@ const RemoveGroupUserModal: FC = ({ deleteChatMember, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [search, setSearch] = useState(''); const usersId = useMemo(() => { diff --git a/src/components/right/statistics/BoostStatistics.tsx b/src/components/right/statistics/BoostStatistics.tsx index 59168ae2e..f9e9282f0 100644 --- a/src/components/right/statistics/BoostStatistics.tsx +++ b/src/components/right/statistics/BoostStatistics.tsx @@ -16,13 +16,13 @@ import { selectTabState, } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; -import { formatDateAtTime } from '../../../util/date/dateFormat'; +import { formatDateAtTime } from '../../../util/dates/dateFormat'; import { CUSTOM_PEER_TO_BE_DISTRIBUTED } from '../../../util/objects/customPeer'; import { formatInteger } from '../../../util/textFormat'; import { getBoostProgressInfo } from '../../common/helpers/boostInfo'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; import LinkField from '../../common/LinkField'; @@ -65,7 +65,7 @@ const BoostStatistics = ({ const { openChat, loadMoreBoosters, closeBoostStatistics, openGiveawayModal, showNotification, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const transitionRef = useRef(null); diff --git a/src/components/right/statistics/MessageStatistics.tsx b/src/components/right/statistics/MessageStatistics.tsx index 9fd81d9e0..3f19871bc 100644 --- a/src/components/right/statistics/MessageStatistics.tsx +++ b/src/components/right/statistics/MessageStatistics.tsx @@ -16,8 +16,8 @@ import buildClassName from '../../../util/buildClassName'; import { callApi } from '../../../api/gramjs'; import useForceUpdate from '../../../hooks/useForceUpdate'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import InfiniteScroll from '../../ui/InfiniteScroll'; import Loading from '../../ui/Loading'; @@ -63,7 +63,7 @@ function Statistics({ dcId, messageId, }: OwnProps & StateProps) { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); const [isReady, setIsReady] = useState(false); diff --git a/src/components/right/statistics/Statistics.tsx b/src/components/right/statistics/Statistics.tsx index dc7a7a8b0..28aa4a260 100644 --- a/src/components/right/statistics/Statistics.tsx +++ b/src/components/right/statistics/Statistics.tsx @@ -25,7 +25,7 @@ import buildClassName from '../../../util/buildClassName'; import { callApi } from '../../../api/gramjs'; import useForceUpdate from '../../../hooks/useForceUpdate'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Loading from '../../ui/Loading'; import StatisticsOverview from './StatisticsOverview'; @@ -94,7 +94,7 @@ const Statistics: FC = ({ messagesById, storiesById, }) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); const [isReady, setIsReady] = useState(false); diff --git a/src/components/right/statistics/StatisticsMessagePublicForward.tsx b/src/components/right/statistics/StatisticsMessagePublicForward.tsx index 78c43b0ed..d1af22649 100644 --- a/src/components/right/statistics/StatisticsMessagePublicForward.tsx +++ b/src/components/right/statistics/StatisticsMessagePublicForward.tsx @@ -7,7 +7,7 @@ import type { ApiMessagePublicForward } from '../../../api/types'; import { getMainUsername } from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; @@ -18,7 +18,7 @@ export type OwnProps = { }; const StatisticsMessagePublicForward: FC = ({ data }) => { - const lang = useLang(); + const lang = useOldLang(); const { openChatByUsername } = getActions(); const username = useMemo(() => (data.chat ? getMainUsername(data.chat) : undefined), [data.chat]); diff --git a/src/components/right/statistics/StatisticsOverview.tsx b/src/components/right/statistics/StatisticsOverview.tsx index 2718d35c8..a64bd9a5d 100644 --- a/src/components/right/statistics/StatisticsOverview.tsx +++ b/src/components/right/statistics/StatisticsOverview.tsx @@ -7,10 +7,10 @@ import type { } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; -import { formatFullDate } from '../../../util/date/dateFormat'; +import { formatFullDate } from '../../../util/dates/dateFormat'; import { formatInteger, formatIntegerCompact } from '../../../util/textFormat'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import styles from './StatisticsOverview.module.scss'; @@ -109,7 +109,7 @@ const StatisticsOverview: FC = ({ statistics, className, }) => { - const lang = useLang(); + const lang = useOldLang(); const renderOverviewItemValue = ({ change, percentage }: StatisticsOverviewItem) => { if (!change) { diff --git a/src/components/right/statistics/StatisticsRecentMessage.tsx b/src/components/right/statistics/StatisticsRecentMessage.tsx index ba9baf9ea..ecd842f5f 100644 --- a/src/components/right/statistics/StatisticsRecentMessage.tsx +++ b/src/components/right/statistics/StatisticsRecentMessage.tsx @@ -3,7 +3,7 @@ import React, { memo, useCallback } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; import type { ApiMessage, StatisticsMessageInteractionCounter } from '../../../api/types'; -import type { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useOldLang'; import { getMessageMediaHash, @@ -12,11 +12,11 @@ import { getMessageVideo, } from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; -import { formatDateTimeToString } from '../../../util/date/dateFormat'; +import { formatDateTimeToString } from '../../../util/dates/dateFormat'; import { renderMessageSummary } from '../../common/helpers/renderMessageText'; -import useLang from '../../../hooks/useLang'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; import StatisticsRecentPostMeta from './StatisticsRecentPostMeta'; @@ -29,7 +29,7 @@ export type OwnProps = { }; const StatisticsRecentMessage: FC = ({ postStatistic, message }) => { - const lang = useLang(); + const lang = useOldLang(); const { toggleMessageStatistics } = getActions(); const mediaThumbnail = getMessageMediaThumbDataUri(message); diff --git a/src/components/right/statistics/StatisticsRecentPostMeta.tsx b/src/components/right/statistics/StatisticsRecentPostMeta.tsx index 4c3728575..108e14c26 100644 --- a/src/components/right/statistics/StatisticsRecentPostMeta.tsx +++ b/src/components/right/statistics/StatisticsRecentPostMeta.tsx @@ -4,7 +4,7 @@ import type { StatisticsMessageInteractionCounter, StatisticsStoryInteractionCou import { formatIntegerCompact } from '../../../util/textFormat'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Icon from '../../common/icons/Icon'; @@ -15,7 +15,7 @@ interface OwnProps { } function StatisticsRecentPostMeta({ postStatistic }: OwnProps) { - const lang = useLang(); + const lang = useOldLang(); return (
{postStatistic.reactionsCount > 0 && ( diff --git a/src/components/right/statistics/StatisticsRecentStory.tsx b/src/components/right/statistics/StatisticsRecentStory.tsx index 3ca942245..12ff26fa9 100644 --- a/src/components/right/statistics/StatisticsRecentStory.tsx +++ b/src/components/right/statistics/StatisticsRecentStory.tsx @@ -6,15 +6,15 @@ import type { ApiTypeStory, StatisticsStoryInteractionCounter, } from '../../../api/types'; -import type { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useOldLang'; import { getStoryMediaHash } from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; -import { formatDateTimeToString } from '../../../util/date/dateFormat'; +import { formatDateTimeToString } from '../../../util/dates/dateFormat'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useMedia from '../../../hooks/useMedia'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; import StatisticsRecentPostMeta from './StatisticsRecentPostMeta'; @@ -28,7 +28,7 @@ export type OwnProps = { }; function StatisticsRecentStory({ chat, story, postStatistic }: OwnProps) { - const lang = useLang(); + const lang = useOldLang(); const { toggleStoryStatistics } = getActions(); const isLoaded = story && 'content' in story; diff --git a/src/components/right/statistics/StatisticsStoryPublicForward.tsx b/src/components/right/statistics/StatisticsStoryPublicForward.tsx index 6fd9427c7..170943f0f 100644 --- a/src/components/right/statistics/StatisticsStoryPublicForward.tsx +++ b/src/components/right/statistics/StatisticsStoryPublicForward.tsx @@ -8,8 +8,8 @@ import type { import { getChatTitle, getUserFullName } from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Avatar from '../../common/Avatar'; @@ -22,7 +22,7 @@ export type OwnProps = { }; function StatisticsMessagePublicForward({ data, chatsById, usersById }: OwnProps) { - const lang = useLang(); + const lang = useOldLang(); const { openChat } = getActions(); const user = usersById[data.peerId]; const chat = chatsById[data.peerId]; diff --git a/src/components/right/statistics/StoryStatistics.tsx b/src/components/right/statistics/StoryStatistics.tsx index 9f15e0145..7883c1885 100644 --- a/src/components/right/statistics/StoryStatistics.tsx +++ b/src/components/right/statistics/StoryStatistics.tsx @@ -16,8 +16,8 @@ import buildClassName from '../../../util/buildClassName'; import { callApi } from '../../../api/gramjs'; import useForceUpdate from '../../../hooks/useForceUpdate'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import InfiniteScroll from '../../ui/InfiniteScroll'; import Loading from '../../ui/Loading'; @@ -68,7 +68,7 @@ function StoryStatistics({ chatsById, usersById, }: OwnProps & StateProps) { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); const [isReady, setIsReady] = useState(false); diff --git a/src/components/story/MediaStory.tsx b/src/components/story/MediaStory.tsx index 26e522ec3..6393b1e0b 100644 --- a/src/components/story/MediaStory.tsx +++ b/src/components/story/MediaStory.tsx @@ -8,15 +8,15 @@ import type { ApiStory, ApiTypeStory } from '../../api/types'; import { getStoryMediaHash } from '../../global/helpers'; import { selectChat, selectPinnedStories } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; -import { formatMediaDuration } from '../../util/date/dateFormat'; +import { formatMediaDuration } from '../../util/dates/dateFormat'; import stopEvent from '../../util/stopEvent'; import { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur'; import useContextMenuHandlers from '../../hooks/useContextMenuHandlers'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMedia from '../../hooks/useMedia'; import useMenuPosition from '../../hooks/useMenuPosition'; +import useOldLang from '../../hooks/useOldLang'; import Icon from '../common/icons/Icon'; import Menu from '../ui/Menu'; @@ -47,7 +47,7 @@ function MediaStory({ showNotification, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); diff --git a/src/components/story/StealthModeModal.tsx b/src/components/story/StealthModeModal.tsx index d82860155..7327c36cc 100644 --- a/src/components/story/StealthModeModal.tsx +++ b/src/components/story/StealthModeModal.tsx @@ -7,8 +7,8 @@ import { selectIsCurrentUserPremium, selectTabState } from '../../global/selecto import buildClassName from '../../util/buildClassName'; import { getServerTime } from '../../util/serverTime'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import ListItem from '../ui/ListItem'; @@ -40,7 +40,7 @@ const StealthModeModal = ({ isOpen, stealthMode, isCurrentUserPremium } : StateP } }, [stealthMode, isOpen]); - const lang = useLang(); + const lang = useOldLang(); const handleTimerEnds = useLastCallback(() => { setIsOnCooldown(false); diff --git a/src/components/story/Story.tsx b/src/components/story/Story.tsx index ee79e7487..626dba56e 100644 --- a/src/components/story/Story.tsx +++ b/src/components/story/Story.tsx @@ -26,7 +26,7 @@ import { } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; import captureKeyboardListeners from '../../util/captureKeyboardListeners'; -import { formatMediaDuration, formatRelativeTime } from '../../util/date/dateFormat'; +import { formatMediaDuration, formatRelativeTime } from '../../util/dates/dateFormat'; import download from '../../util/download'; import { round } from '../../util/math'; import { getServerTime } from '../../util/serverTime'; @@ -41,10 +41,10 @@ import useCanvasBlur from '../../hooks/useCanvasBlur'; import useCurrentOrPrev from '../../hooks/useCurrentOrPrev'; import useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useLongPress from '../../hooks/useLongPress'; import useMediaTransition from '../../hooks/useMediaTransition'; +import useOldLang from '../../hooks/useOldLang'; import useShowTransition from '../../hooks/useShowTransition'; import { useStreaming } from '../../hooks/useStreaming'; import useBackgroundMode from '../../hooks/window/useBackgroundMode'; @@ -151,7 +151,7 @@ function Story({ } = getActions(); const serverTime = getServerTime(); - const lang = useLang(); + const lang = useOldLang(); const { isMobile } = useAppLayout(); const [isComposerHasFocus, markComposerHasFocus, unmarkComposerHasFocus] = useFlag(false); const [isStoryPlaybackRequested, playStory, pauseStory] = useFlag(false); diff --git a/src/components/story/StoryCaption.tsx b/src/components/story/StoryCaption.tsx index 21391f738..28037b96d 100644 --- a/src/components/story/StoryCaption.tsx +++ b/src/components/story/StoryCaption.tsx @@ -10,7 +10,7 @@ import buildClassName from '../../util/buildClassName'; import calcTextLineHeightAndCount from '../../util/element/calcTextLineHeightAndCount'; import useCurrentOrPrev from '../../hooks/useCurrentOrPrev'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import usePrevDuringAnimation from '../../hooks/usePrevDuringAnimation'; import useShowTransition from '../../hooks/useShowTransition'; @@ -33,7 +33,7 @@ const LINES_TO_SHOW = 3; function StoryCaption({ story, isExpanded, className, onExpand, onFold, }: OwnProps) { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); // eslint-disable-next-line no-null/no-null diff --git a/src/components/story/StoryDeleteConfirmModal.tsx b/src/components/story/StoryDeleteConfirmModal.tsx index 45dce1d10..a6048fc31 100644 --- a/src/components/story/StoryDeleteConfirmModal.tsx +++ b/src/components/story/StoryDeleteConfirmModal.tsx @@ -3,7 +3,7 @@ import { getActions } from '../../global'; import type { ApiTypeStory } from '../../api/types'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import ConfirmDialog from '../ui/ConfirmDialog'; @@ -18,7 +18,7 @@ function StoryDeleteConfirmModal({ }: OwnProps) { const { deleteStory, openNextStory } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const handleDeleteStoryClick = useCallback(() => { if (!story) { diff --git a/src/components/story/StoryFooter.tsx b/src/components/story/StoryFooter.tsx index ec06a3b23..f8e37acf6 100644 --- a/src/components/story/StoryFooter.tsx +++ b/src/components/story/StoryFooter.tsx @@ -7,8 +7,8 @@ import { HEART_REACTION } from '../../config'; import { getStoryKey, isUserId } from '../../global/helpers'; import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import AvatarList from '../common/AvatarList'; import Icon from '../common/icons/Icon'; @@ -27,7 +27,7 @@ const StoryFooter = ({ className, }: OwnProps) => { const { openStoryViewModal, openForwardMenu, sendStoryReaction } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const { views, isOut, peerId, id: storyId, sentReaction, diff --git a/src/components/story/StoryPreview.tsx b/src/components/story/StoryPreview.tsx index 2c76908ed..648d0df56 100644 --- a/src/components/story/StoryPreview.tsx +++ b/src/components/story/StoryPreview.tsx @@ -10,8 +10,8 @@ import { getSenderTitle, getStoryMediaHash } from '../../global/helpers'; import { selectTabState } from '../../global/selectors'; import renderText from '../common/helpers/renderText'; -import useLang from '../../hooks/useLang'; import useMedia from '../../hooks/useMedia'; +import useOldLang from '../../hooks/useOldLang'; import Avatar from '../common/Avatar'; import MediaAreaOverlay from './mediaArea/MediaAreaOverlay'; @@ -33,7 +33,7 @@ function StoryPreview({ peer, peerStories, lastViewedId, storyIdsForViewer, origin, }: OwnProps & StateProps) { const { openStoryViewer, loadPeerSkippedStories } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const story = useMemo(() => { if (!peerStories) { diff --git a/src/components/story/StoryRibbon.tsx b/src/components/story/StoryRibbon.tsx index f5cca9954..7216aad14 100644 --- a/src/components/story/StoryRibbon.tsx +++ b/src/components/story/StoryRibbon.tsx @@ -7,7 +7,7 @@ import buildClassName from '../../util/buildClassName'; import { getIsMobile } from '../../hooks/useAppLayout'; import useHorizontalScroll from '../../hooks/useHorizontalScroll'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import StoryRibbonButton from './StoryRibbonButton'; @@ -33,7 +33,7 @@ function StoryRibbon({ chatsById, isClosing, }: OwnProps & StateProps) { - const lang = useLang(); + const lang = useOldLang(); const fullClassName = buildClassName( styles.root, !orderedPeerIds.length && styles.hidden, diff --git a/src/components/story/StoryRibbonButton.tsx b/src/components/story/StoryRibbonButton.tsx index 671283690..0a07bf160 100644 --- a/src/components/story/StoryRibbonButton.tsx +++ b/src/components/story/StoryRibbonButton.tsx @@ -9,9 +9,9 @@ import buildClassName from '../../util/buildClassName'; import { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur'; import useContextMenuHandlers from '../../hooks/useContextMenuHandlers'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMenuPosition from '../../hooks/useMenuPosition'; +import useOldLang from '../../hooks/useOldLang'; import useStoryPreloader from './hooks/useStoryPreloader'; import Avatar from '../common/Avatar'; @@ -33,7 +33,7 @@ function StoryRibbonButton({ peer, isArchived }: OwnProps) { toggleStoriesHidden, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); diff --git a/src/components/story/StorySettings.tsx b/src/components/story/StorySettings.tsx index 744bf0b52..dfcc52a3a 100644 --- a/src/components/story/StorySettings.tsx +++ b/src/components/story/StorySettings.tsx @@ -13,8 +13,8 @@ import buildClassName from '../../util/buildClassName'; import stopEvent from '../../util/stopEvent'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import Button from '../ui/Button'; import ListItem from '../ui/ListItem'; @@ -93,7 +93,7 @@ function StorySettings({ }: OwnProps & StateProps) { const { editStoryPrivacy, toggleStoryInProfile } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [isOpenModal, openModal, closeModal] = useFlag(false); const [privacy, setPrivacy] = useState(visibility); const [isPinned, setIsPinned] = useState(story?.isInProfile); diff --git a/src/components/story/StoryToggler.tsx b/src/components/story/StoryToggler.tsx index e80ae1b9f..d0de3aef9 100644 --- a/src/components/story/StoryToggler.tsx +++ b/src/components/story/StoryToggler.tsx @@ -12,7 +12,7 @@ import buildClassName from '../../util/buildClassName'; import { animateClosing, animateOpening, ANIMATION_DURATION } from './helpers/ribbonAnimation'; import { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import useShowTransition from '../../hooks/useShowTransition'; import useStoryPreloader from './hooks/useStoryPreloader'; @@ -52,7 +52,7 @@ function StoryToggler({ }: OwnProps & StateProps) { const { toggleStoryRibbon } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const peers = useMemo(() => { if (orderedPeerIds.length === 1) { diff --git a/src/components/story/StoryView.tsx b/src/components/story/StoryView.tsx index d8307b3ec..e2cd3922a 100644 --- a/src/components/story/StoryView.tsx +++ b/src/components/story/StoryView.tsx @@ -9,11 +9,11 @@ import type { IconName } from '../../types/icons'; import { getUserFullName, isUserId } from '../../global/helpers'; import { selectPeer } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; -import { formatDateAtTime } from '../../util/date/dateFormat'; +import { formatDateAtTime } from '../../util/dates/dateFormat'; import { REM } from '../common/helpers/mediaDimensions'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import GroupChatInfo from '../common/GroupChatInfo'; import PrivateChatInfo from '../common/PrivateChatInfo'; @@ -52,7 +52,7 @@ const StoryView = ({ closeStoryViewModal, } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const handleClick = useLastCallback(() => { const { type } = storyView; diff --git a/src/components/story/StoryViewModal.tsx b/src/components/story/StoryViewModal.tsx index 7a5d71f3b..18736a52d 100644 --- a/src/components/story/StoryViewModal.tsx +++ b/src/components/story/StoryViewModal.tsx @@ -22,8 +22,8 @@ import renderText from '../common/helpers/renderText'; import useDebouncedCallback from '../../hooks/useDebouncedCallback'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import useScrolledState from '../../hooks/useScrolledState'; import Button from '../ui/Button'; @@ -65,7 +65,7 @@ function StoryViewModal({ const [areReactionsFirst, markReactionsFirst, unmarkReactionsFirst] = useFlag(true); const [query, setQuery] = useState(''); - const lang = useLang(); + const lang = useOldLang(); const isOpen = Boolean(story); const isExpired = Boolean(story?.date) && (story!.date + viewersExpirePeriod) < getServerTime(); diff --git a/src/components/story/StoryViewer.tsx b/src/components/story/StoryViewer.tsx index 0811a9345..b8d8f2495 100644 --- a/src/components/story/StoryViewer.tsx +++ b/src/components/story/StoryViewer.tsx @@ -20,7 +20,7 @@ import { animateClosing, animateOpening } from './helpers/ghostAnimation'; import useFlag from '../../hooks/useFlag'; import { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import usePrevious from '../../hooks/usePrevious'; import { dispatchPriorityPlaybackEvent } from '../../hooks/usePriorityPlaybackCheck'; import useSlideSizes from './hooks/useSlideSizes'; @@ -62,7 +62,7 @@ function StoryViewer({ }: StateProps) { const { closeStoryViewer, closeStoryPrivacyEditor } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [storyToDelete, setStoryToDelete] = useState(undefined); const [isDeleteModalOpen, openDeleteModal, closeDeleteModal] = useFlag(false); const [isReportModalOpen, openReportModal, closeReportModal] = useFlag(false); diff --git a/src/components/story/privacy/AllowDenyList.tsx b/src/components/story/privacy/AllowDenyList.tsx index 8660068d0..d6f142534 100644 --- a/src/components/story/privacy/AllowDenyList.tsx +++ b/src/components/story/privacy/AllowDenyList.tsx @@ -6,7 +6,7 @@ import { filterUsersByName } from '../../../global/helpers'; import { unique } from '../../../util/iteratees'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; -import useLang from '../../../hooks/useLang'; +import useOldLang from '../../../hooks/useOldLang'; import Picker from '../../common/Picker'; @@ -29,7 +29,7 @@ function AllowDenyList({ lockedIds, onSelect, }: OwnProps) { - const lang = useLang(); + const lang = useOldLang(); const [searchQuery, setSearchQuery] = useState(''); const displayedIds = useMemo(() => { diff --git a/src/components/story/privacy/CloseFriends.tsx b/src/components/story/privacy/CloseFriends.tsx index 7dbd2db39..772849fb0 100644 --- a/src/components/story/privacy/CloseFriends.tsx +++ b/src/components/story/privacy/CloseFriends.tsx @@ -10,8 +10,8 @@ import buildClassName from '../../../util/buildClassName'; import { unique } from '../../../util/iteratees'; import useEffectWithPrevDeps from '../../../hooks/useEffectWithPrevDeps'; -import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; +import useOldLang from '../../../hooks/useOldLang'; import Picker from '../../common/Picker'; import FloatingActionButton from '../../ui/FloatingActionButton'; @@ -31,7 +31,7 @@ function CloseFriends({ }: OwnProps) { const { saveCloseFriends } = getActions(); - const lang = useLang(); + const lang = useOldLang(); const [searchQuery, setSearchQuery] = useState(''); const [isSubmitShown, setIsSubmitShown] = useState(false); const [newSelectedContactIds, setNewSelectedContactIds] = useState([]); diff --git a/src/components/test/TestLocale.tsx b/src/components/test/TestLocale.tsx new file mode 100644 index 000000000..2a0f51cb4 --- /dev/null +++ b/src/components/test/TestLocale.tsx @@ -0,0 +1,66 @@ +import React from '../../lib/teact/teact'; + +import type { LangFnParameters } from '../../util/localization'; + +import useLang from '../../hooks/useLang'; + +const storedParameter: LangFnParameters = { + key: 'StickerPackAddStickerCount', + variables: { + count: 42, + }, +}; + +const storedAdvancedParameter: LangFnParameters = { + key: 'VoipPeerIncompatible', + variables: { + user: 'Some user', + }, + options: { + withNodes: true, + withMarkdown: true, + }, +}; + +const TestLocale = () => { + const lang = useLang(); + + return ( +
+

{lang('NothingFound')}

+

{lang.with(storedParameter)}

+

{lang.with(storedAdvancedParameter)}

+

+ {lang('LimitReachedChatInFolders', { + limit: 'first limit', + limit2: 'second limit', + }, { + withNodes: true, + withMarkdown: true, + })} +

+

{lang('Participants', { count: 42 })}

+

+ {lang('ChatServiceGroupUpdatedPinnedMessage1', { + message: 'Some message', + user: 'Some user', + })} +

+ {/*

+ {lang('LocalTestString', { + link: this link, + secondLink: this second link, + user: lang.disjunction(['Some __tricky__ user', 'Another user', 'Third user']), + }, { + withNodes: true, + withMarkdown: true, + specialReplacement: { + '⚡': , + }, + })} +

*/} +
+ ); +}; + +export default TestLocale; diff --git a/src/components/ui/Checkbox.tsx b/src/components/ui/Checkbox.tsx index d3626b72d..de713411b 100644 --- a/src/components/ui/Checkbox.tsx +++ b/src/components/ui/Checkbox.tsx @@ -7,7 +7,7 @@ import type { IconName } from '../../types/icons'; import buildClassName from '../../util/buildClassName'; import renderText from '../common/helpers/renderText'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Spinner from './Spinner'; @@ -51,7 +51,7 @@ const Checkbox: FC = ({ onCheck, onClickLabel, }) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const labelRef = useRef(null); diff --git a/src/components/ui/ConfirmDialog.tsx b/src/components/ui/ConfirmDialog.tsx index 1cdf38a61..9ae23c9a4 100644 --- a/src/components/ui/ConfirmDialog.tsx +++ b/src/components/ui/ConfirmDialog.tsx @@ -6,7 +6,7 @@ import type { TextPart } from '../../types'; import buildClassName from '../../util/buildClassName'; import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from './Button'; import Modal from './Modal'; @@ -46,7 +46,7 @@ const ConfirmDialog: FC = ({ onClose, onCloseAnimationEnd, }) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const containerRef = useRef(null); diff --git a/src/components/ui/CropModal.tsx b/src/components/ui/CropModal.tsx index 033dfcaab..6ed2d5d68 100644 --- a/src/components/ui/CropModal.tsx +++ b/src/components/ui/CropModal.tsx @@ -6,7 +6,7 @@ import React, { import { DEBUG } from '../../config'; import { blobToDataUri, blobToFile } from '../../util/files'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from './Button'; import Loading from './Loading'; @@ -93,7 +93,7 @@ const CropModal: FC = ({ file, onChange, onClose }: OwnProps) => { initCropper(file); }, [file, isCroppieReady]); - const lang = useLang(); + const lang = useOldLang(); const handleCropClick = useCallback(async () => { if (!cropper) { diff --git a/src/components/ui/Draggable.tsx b/src/components/ui/Draggable.tsx index 00dab9c33..7dacc83e4 100644 --- a/src/components/ui/Draggable.tsx +++ b/src/components/ui/Draggable.tsx @@ -6,7 +6,7 @@ import React, { import buildClassName from '../../util/buildClassName'; import buildStyle from '../../util/buildStyle'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import styles from './Draggable.module.scss'; @@ -44,7 +44,7 @@ const Draggable: FC = ({ knobStyle, isDisabled, }) => { - const lang = useLang(); + const lang = useOldLang(); // eslint-disable-next-line no-null/no-null const ref = useRef(null); diff --git a/src/components/ui/FloatingActionButton.tsx b/src/components/ui/FloatingActionButton.tsx index d4df34f5e..c450d1b77 100644 --- a/src/components/ui/FloatingActionButton.tsx +++ b/src/components/ui/FloatingActionButton.tsx @@ -5,7 +5,7 @@ import type { OwnProps as ButtonProps } from './Button'; import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from './Button'; @@ -30,7 +30,7 @@ const FloatingActionButton: FC = ({ onClick, children, }) => { - const lang = useLang(); + const lang = useOldLang(); const buttonClassName = buildClassName( 'FloatingActionButton', diff --git a/src/components/ui/InputText.tsx b/src/components/ui/InputText.tsx index 8c924742f..3b5890df1 100644 --- a/src/components/ui/InputText.tsx +++ b/src/components/ui/InputText.tsx @@ -6,7 +6,7 @@ import React, { memo } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; type OwnProps = { ref?: RefObject; @@ -55,7 +55,7 @@ const InputText: FC = ({ onBlur, onPaste, }) => { - const lang = useLang(); + const lang = useOldLang(); const labelText = error || success || label; const fullClassName = buildClassName( 'input-group', diff --git a/src/components/ui/ListItem.tsx b/src/components/ui/ListItem.tsx index 4c0cb3b18..980bc8409 100644 --- a/src/components/ui/ListItem.tsx +++ b/src/components/ui/ListItem.tsx @@ -12,9 +12,9 @@ import renderText from '../common/helpers/renderText'; import useContextMenuHandlers from '../../hooks/useContextMenuHandlers'; import { useFastClick } from '../../hooks/useFastClick'; import useFlag from '../../hooks/useFlag'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useMenuPosition from '../../hooks/useMenuPosition'; +import useOldLang from '../../hooks/useOldLang'; import Icon from '../common/icons/Icon'; import Button from './Button'; @@ -204,7 +204,7 @@ const ListItem: FC = ({ } }); - const lang = useLang(); + const lang = useOldLang(); const fullClassName = buildClassName( 'ListItem', diff --git a/src/components/ui/MenuItem.tsx b/src/components/ui/MenuItem.tsx index 98ea73231..1e95bc009 100644 --- a/src/components/ui/MenuItem.tsx +++ b/src/components/ui/MenuItem.tsx @@ -7,8 +7,8 @@ import { IS_TEST } from '../../config'; import buildClassName from '../../util/buildClassName'; import useAppLayout from '../../hooks/useAppLayout'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; +import useOldLang from '../../hooks/useOldLang'; import './MenuItem.scss'; @@ -49,7 +49,7 @@ const MenuItem: FC = (props) => { withPreventDefaultOnMouseDown, } = props; - const lang = useLang(); + const lang = useOldLang(); const { isTouchScreen } = useAppLayout(); const handleClick = useLastCallback((e: React.MouseEvent) => { if (disabled || !onClick) { diff --git a/src/components/ui/Modal.tsx b/src/components/ui/Modal.tsx index d36acd49d..b142fe75b 100644 --- a/src/components/ui/Modal.tsx +++ b/src/components/ui/Modal.tsx @@ -11,9 +11,9 @@ import trapFocus from '../../util/trapFocus'; import { dispatchHeavyAnimationEvent } from '../../hooks/useHeavyAnimationCheck'; import useHistoryBack from '../../hooks/useHistoryBack'; -import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useLayoutEffectWithPrevDeps from '../../hooks/useLayoutEffectWithPrevDeps'; +import useOldLang from '../../hooks/useOldLang'; import useShowTransition from '../../hooks/useShowTransition'; import Icon from '../common/icons/Icon'; @@ -118,7 +118,7 @@ const Modal: FC = ({ }; }, [isOpen]); - const lang = useLang(); + const lang = useOldLang(); if (!shouldRender) { return undefined; diff --git a/src/components/ui/Radio.tsx b/src/components/ui/Radio.tsx index 294501874..939041fdb 100644 --- a/src/components/ui/Radio.tsx +++ b/src/components/ui/Radio.tsx @@ -4,7 +4,7 @@ import React, { memo } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Spinner from './Spinner'; @@ -43,7 +43,7 @@ const Radio: FC = ({ isLink, onSubLabelClick, }) => { - const lang = useLang(); + const lang = useOldLang(); const fullClassName = buildClassName( 'Radio', className, diff --git a/src/components/ui/RangeSlider.tsx b/src/components/ui/RangeSlider.tsx index eb827f615..b81902425 100644 --- a/src/components/ui/RangeSlider.tsx +++ b/src/components/ui/RangeSlider.tsx @@ -4,7 +4,7 @@ import React, { memo, useCallback, useMemo } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import './RangeSlider.scss'; @@ -35,7 +35,7 @@ const RangeSlider: FC = ({ renderValue, onChange, }) => { - const lang = useLang(); + const lang = useOldLang(); const handleChange = useCallback((event: ChangeEvent) => { onChange(Number(event.currentTarget.value)); }, [onChange]); diff --git a/src/components/ui/SearchInput.tsx b/src/components/ui/SearchInput.tsx index 018b9e27b..026ab1c86 100644 --- a/src/components/ui/SearchInput.tsx +++ b/src/components/ui/SearchInput.tsx @@ -8,7 +8,7 @@ import buildClassName from '../../util/buildClassName'; import useFlag from '../../hooks/useFlag'; import useInputFocusOnOpen from '../../hooks/useInputFocusOnOpen'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import Button from './Button'; import Loading from './Loading'; @@ -83,7 +83,7 @@ const SearchInput: FC = ({ } }, [focused, placeholder]); // Trick for setting focus when selecting a contact to search for - const lang = useLang(); + const lang = useOldLang(); function handleChange(event: React.ChangeEvent) { const { currentTarget } = event; diff --git a/src/components/ui/Separator.tsx b/src/components/ui/Separator.tsx index 503cf25da..92fabbc73 100644 --- a/src/components/ui/Separator.tsx +++ b/src/components/ui/Separator.tsx @@ -2,7 +2,7 @@ import React from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; -import useLang from '../../hooks/useLang'; +import useOldLang from '../../hooks/useOldLang'; import styles from './Separator.module.scss'; @@ -12,7 +12,7 @@ type OwnProps = { }; function Separator({ children, className }: OwnProps) { - const lang = useLang(); + const lang = useOldLang(); return (
= ({ isLoading, onClick, }) => { - const lang = useLang(); + const lang = useOldLang(); return (