Skip to content

Commit

Permalink
Update strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Sominemo committed Dec 4, 2023
1 parent b992f61 commit e63ae34
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 108 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mono-pwa",
"version": "3.4.2-hotfix.2",
"version": "3.4.3",
"description": "monobank PWA",
"main": "index.html",
"config": {
Expand All @@ -17,7 +17,7 @@
},
"repository": "git+https://github.com/SominemoMono-PWA.git",
"keywords": [],
"author": "Sominemo <me@sominemo.com>",
"author": "Sominemo <support@sominemo.com>",
"license": "GPL-2.0",
"bugs": {
"url": "https://github.com/SominemoMono-PWA/issues"
Expand Down
19 changes: 9 additions & 10 deletions src/app/res/language/en/library.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
export default class LanguageLibrary {
// [number, numbers, numbers] [minute, minutes, minutes]
// English pluralize function
// [minute, minutes]
static plural(data, { number = 1 } = {}) {
number = Math.abs(number)
if (Math.floor(number) !== number) return data[1]
return data[
// eslint-disable-next-line no-nested-ternary
(number % 10 === 1 && number % 100 !== 11) ? 0
: number % 10 >= 2
&& number % 10 <= 4
&& (number % 100 < 10 || number % 100 >= 20) ? 1 : 2
]
const absNumber = Math.abs(number)

if (absNumber === 1) {
return data[0]
}

return data[1]
}

static replace(data, { replace = {} } = {}) {
Expand Down
Loading

0 comments on commit e63ae34

Please sign in to comment.