Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: Replaced custom version check with semver package #240

Merged
merged 4 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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([
Expand All @@ -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

Expand Down
32 changes: 8 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "peri",
"version": "2.3.10",
"version": "2.3.11",
"author": {
"name": "Irina Sorokina",
"url": "https://github.com/IraSoro"
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/data/AppVersion.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -59,7 +60,7 @@ export async function isNewVersionAvailable(): Promise<boolean> {
return false;
}

return (await getLatestReleaseInfo()).version > appVersion;
return semver.gt((await getLatestReleaseInfo()).version, appVersion);
}

export async function downloadLatestRelease() {
Expand Down
1 change: 1 addition & 0 deletions src/utils/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export async function init() {
lng: (await storage.getUnsafe.language()) || navigator.language,
fallbackLng: {
ru: ["ru"],
es: ["es"],
default: [defaultLanguageCode],
},
} satisfies InitOptions);
Expand Down
Loading