diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 17ab844..39ef47f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,7 @@ We welcome contributions for translating our application into various languages. ]); ``` -6. Added language to resources like this: +6. Added language to `resources` like this: ```ts resources: { @@ -41,7 +41,16 @@ We welcome contributions for translating our application into various languages. }, ``` -7. Open the file `./src/utils/datetime.ts`. Add the locale to the `locales` variable like this: +7. Added language to `fallbackLng` like this: + + ```ts + fallbackLng: { + ru: ["ru"], + default: [defaultLanguageCode], + }, + ``` + +8. Open the file `./src/utils/datetime.ts`. Add the locale to the `locales` variable like this: ```ts const locales = new Map([ @@ -50,7 +59,7 @@ We welcome contributions for translating our application into various languages. ]); ``` -8. Make a Pull Request with the translated file. +9. Make a Pull Request with the translated file. ### Guidelines diff --git a/package-lock.json b/package-lock.json index 504a2e2..b9c8c69 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "peri", - "version": "2.3.10", + "version": "2.3.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "peri", - "version": "2.3.10", + "version": "2.3.11", "dependencies": { "@capacitor/android": "5.0.5", "@capacitor/app": "5.0.3", @@ -44,6 +44,7 @@ "react-router": "^5.3.4", "react-router-dom": "^5.3.4", "react-scripts": "^5.0.0", + "semver": "^7.6.2", "typescript": "^4.9.5", "web-vitals": "^3.3.2", "workbox-background-sync": "^7.0.0", @@ -2141,6 +2142,7 @@ "version": "5.0.5", "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-5.0.5.tgz", "integrity": "sha512-vH5Qoy+p2Egsu1GtPtOsihHcEI2fCGCIHwlUGPaXXGysudzpzWtJZ5JZNlycJyfRdjECrjkutgbNaHLog+YlXQ==", + "license": "MIT", "peerDependencies": { "@capacitor/core": "^5.0.0" } @@ -16157,12 +16159,10 @@ } }, "node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -16170,22 +16170,6 @@ "node": ">=10" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/send": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", diff --git a/package.json b/package.json index 06310b2..f358d98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "peri", - "version": "2.3.10", + "version": "2.3.11", "author": { "name": "Irina Sorokina", "url": "https://github.com/IraSoro" @@ -42,6 +42,7 @@ "react-router": "^5.3.4", "react-router-dom": "^5.3.4", "react-scripts": "^5.0.0", + "semver": "^7.6.2", "typescript": "^4.9.5", "web-vitals": "^3.3.2", "workbox-background-sync": "^7.0.0", diff --git a/src/data/AppVersion.ts b/src/data/AppVersion.ts index 1a33eaa..eef568a 100644 --- a/src/data/AppVersion.ts +++ b/src/data/AppVersion.ts @@ -1,6 +1,7 @@ import { isPlatform } from "@ionic/core"; +import semver from "semver"; -export const appVersion = "v2.3.10"; +export const appVersion = "v2.3.11"; export interface GithubReleaseAsset { content_type: string; @@ -59,7 +60,7 @@ export async function isNewVersionAvailable(): Promise { return false; } - return (await getLatestReleaseInfo()).version > appVersion; + return semver.gt((await getLatestReleaseInfo()).version, appVersion); } export async function downloadLatestRelease() { diff --git a/src/utils/translation.ts b/src/utils/translation.ts index 26f673d..2ec198a 100644 --- a/src/utils/translation.ts +++ b/src/utils/translation.ts @@ -36,6 +36,7 @@ export async function init() { lng: (await storage.getUnsafe.language()) || navigator.language, fallbackLng: { ru: ["ru"], + es: ["es"], default: [defaultLanguageCode], }, } satisfies InitOptions);