bfg-common 1.3.362 → 1.3.364

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -603,6 +603,7 @@
603
603
  "freeSpace": "Вольная прастора",
604
604
  "friday": "Пятніца",
605
605
  "from": "ад",
606
+ "from2": "ад",
606
607
  "fullScreenMode": "Поўнаэкранны рэжым",
607
608
  "fullyAutomated": "Цалкам аўтаматызаваны",
608
609
  "function": "Функцыя",
@@ -1625,6 +1626,7 @@
1625
1626
  "timeSynchronizationServicesTest": "Тэставанне службаў сінхранізацыі часу",
1626
1627
  "timeToShouldBeLaterTimeFrom": "Ўказаны дыяпазон часу недапушчальны. Дата \" да \"павінна быць пазней даты\"ад\".",
1627
1628
  "to": "К",
1629
+ "to2": "К",
1628
1630
  "toCsv": "К CSV",
1629
1631
  "toggleFullscreenMode": "Пераключэнне ў поўнаэкранны рэжым",
1630
1632
  "togglePassthrough": "Пераключыць праход праз",
@@ -603,6 +603,7 @@
603
603
  "freeSpace": "Free Space",
604
604
  "friday": "Friday",
605
605
  "from": "from",
606
+ "from2": "from",
606
607
  "fullScreenMode": "Full screen mode",
607
608
  "fullyAutomated": "Fully Automated",
608
609
  "function": "Function",
@@ -1625,6 +1626,7 @@
1625
1626
  "timeSynchronizationServicesTest": "Time Synchronization Services test",
1626
1627
  "timeToShouldBeLaterTimeFrom": "The specified time range is not valid. The \"to\" date should be later than the \"from\" date.",
1627
1628
  "to": "To",
1629
+ "to2": "To",
1628
1630
  "toCsv": "To CSV",
1629
1631
  "toggleFullscreenMode": "Toggle Full Screen Mode",
1630
1632
  "togglePassthrough": "Toggle Passthrough",
@@ -603,6 +603,7 @@
603
603
  "freeSpace": "Ազատ տարածք",
604
604
  "friday": "Ուրբաթ",
605
605
  "from": "ից",
606
+ "from2": "ից",
606
607
  "fullScreenMode": "Ամբողջ էկրանով ռեժիմ",
607
608
  "fullyAutomated": "Լիովին ավտոմատացված",
608
609
  "function": "Գործառույթ",
@@ -1625,6 +1626,7 @@
1625
1626
  "timeSynchronizationServicesTest": "Ժամանակի համաժամացման ծառայությունների փորձարկում",
1626
1627
  "timeToShouldBeLaterTimeFrom": "Նշված ժամանակային միջակայքն անընդունելի է: \"Նախքան\" ամսաթիվը պետք է լինի ավելի ուշ, քան \"from\"ամսաթիվը:",
1627
1628
  "to": "Դեպի",
1629
+ "to2": "Դեպի",
1628
1630
  "toCsv": "Դեպի CSV",
1629
1631
  "toggleFullscreenMode": "Անցնել ամբողջ էկրանով ռեժիմին",
1630
1632
  "togglePassthrough": "Անցնել անցումը",
@@ -603,6 +603,7 @@
603
603
  "freeSpace": "Бос кеңістік",
604
604
  "friday": "Жұма",
605
605
  "from": "бастап",
606
+ "from2": "бастап",
606
607
  "fullScreenMode": "Толық экран режимі",
607
608
  "fullyAutomated": "толық автоматтандырылған",
608
609
  "function": "Функция",
@@ -1625,6 +1626,7 @@
1625
1626
  "timeSynchronizationServicesTest": "Уақытты синхрондау қызметтерін тестілеу",
1626
1627
  "timeToShouldBeLaterTimeFrom": "The specified time range is not valid. The \"to\" date should be later than the \"from\" date.",
1627
1628
  "to": "К",
1629
+ "to2": "К",
1628
1630
  "toCsv": "CSV-ДЕ",
1629
1631
  "toggleFullscreenMode": "Толық экран режиміне ауысу",
1630
1632
  "togglePassthrough": "Өту жолын ауыстырыңыз",
@@ -605,7 +605,8 @@
605
605
  "free": "Свободно",
606
606
  "freeSpace": "Свободное место",
607
607
  "friday": "Пятница",
608
- "from": "От",
608
+ "from": "из",
609
+ "from2": "От",
609
610
  "fullScreenMode": "Полноэкранный режим",
610
611
  "fullyAutomated": "Полностью автоматизированный",
611
612
  "function": "Функция",
@@ -1630,7 +1631,8 @@
1630
1631
  "timeSynchronizationServicesHelpText": "Одновременно у вас может быть только одна услуга по хранению времени. Когда PTP является основным протоколом, NTP может быть запущен только в \"Мониторинг\" государство. Вы не можете установить время вручную, когда запущена служба хронометража.",
1631
1632
  "timeSynchronizationServicesTest": "Тестирование служб синхронизации времени",
1632
1633
  "timeToShouldBeLaterTimeFrom": "Указанный диапазон времени недопустим. Дата \"до\" должна быть позже даты \"от\".",
1633
- "to": "До",
1634
+ "to": "К",
1635
+ "to2": "До",
1634
1636
  "toCsv": "В CSV",
1635
1637
  "toggleFullscreenMode": "Переключение в полноэкранный режим",
1636
1638
  "togglePassthrough": "Переключить проход через",
@@ -603,6 +603,7 @@
603
603
  "freeSpace": "可用空间",
604
604
  "friday": "星期五",
605
605
  "from": "从",
606
+ "from2": "从",
606
607
  "fullScreenMode": "全屏模式",
607
608
  "fullyAutomated": "全自動",
608
609
  "function": "功能",
@@ -1625,6 +1626,7 @@
1625
1626
  "timeSynchronizationServicesTest": "时间同步服务测试",
1626
1627
  "timeToShouldBeLaterTimeFrom": "指定的时间范围无效。 “结束”日期应晚于“开始”日期。",
1627
1628
  "to": "到",
1629
+ "to2": "到",
1628
1630
  "toCsv": "到CSV",
1629
1631
  "toggleFullscreenMode": "切换全屏模式",
1630
1632
  "togglePassthrough": "切换直通",
@@ -1,4 +1,5 @@
1
1
  import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
2
3
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
4
 
4
5
  export const timespanFunc = (
@@ -37,10 +38,16 @@ export const customTimeFunc = (
37
38
  ): UI_I_OptionItem[] => {
38
39
  const isLangRu = lang === 'ru_RU'
39
40
 
40
- const hourText = isLangRu ? getCorrectHourForm(hour) : localization.hours2
41
- const dayText = isLangRu ? getCorrectDayForm(hour) : localization.days2
42
- const weekText = isLangRu ? getCorrectWeekForm(hour) : localization.weeks2
43
- const monthText = isLangRu ? getCorrectMonthForm(hour) : localization.months2
41
+ const hourText = isLangRu
42
+ ? getCorrectRuForm(hour, 'hour')
43
+ : localization.hours2
44
+ const dayText = isLangRu ? getCorrectRuForm(hour, 'day') : localization.days2
45
+ const weekText = isLangRu
46
+ ? getCorrectRuForm(hour, 'week')
47
+ : localization.weeks2
48
+ const monthText = isLangRu
49
+ ? getCorrectRuForm(hour, 'month')
50
+ : localization.months2
44
51
 
45
52
  return [
46
53
  {
@@ -75,89 +82,30 @@ export const chartTypeFunc = (
75
82
  },
76
83
  ]
77
84
 
78
- const getCorrectHourForm = (hours: number): string => {
79
- let text: string
80
-
81
- if (!hours) {
82
- return getCorrectHourForm.text
83
- }
84
-
85
- if (hours % 10 === 1 && hours % 100 !== 11) {
86
- text = 'Час'
87
- } else if (
88
- [2, 3, 4].includes(hours % 10) &&
89
- ![12, 13, 14].includes(hours % 100)
90
- ) {
91
- text = 'Часа'
92
- } else {
93
- text = 'Часов'
94
- }
95
-
96
- getCorrectHourForm.text = text
97
- return text
98
- }
99
-
100
- const getCorrectDayForm = (days: number): string => {
101
- let text: string
102
-
103
- if (!days) {
104
- return getCorrectDayForm.text
105
- }
106
-
107
- if (days % 10 === 1 && days % 100 !== 11) {
108
- text = 'День'
109
- } else if (
110
- [2, 3, 4].includes(days % 10) &&
111
- ![12, 13, 14].includes(days % 100)
112
- ) {
113
- text = 'Дня'
114
- } else {
115
- text = 'Дней'
85
+ const getCorrectRuForm = (value: number, type: string): string => {
86
+ const forms: UI_I_ArbitraryObject<string[]> = {
87
+ hour: ['Час', 'Часа', 'Часов'],
88
+ day: ['День', 'Дня', 'Дней'],
89
+ week: ['Неделя', 'Недели', 'Недель'],
90
+ month: ['Месяц', 'Месяца', 'Месяцев'],
116
91
  }
117
92
 
118
- getCorrectDayForm.text = text
119
- return text
120
- }
121
- const getCorrectWeekForm = (weeks: number): string => {
122
93
  let text: string
123
94
 
124
- if (!weeks) {
125
- return getCorrectWeekForm.text
95
+ if (!value) {
96
+ return getCorrectRuForm[type]
126
97
  }
127
98
 
128
- if (weeks % 10 === 1 && weeks % 100 !== 11) {
129
- text = 'Неделя'
99
+ if (value % 10 === 1 && value % 100 !== 11) {
100
+ text = forms[type][0]
130
101
  } else if (
131
- [2, 3, 4].includes(weeks % 10) &&
132
- ![12, 13, 14].includes(weeks % 100)
102
+ [2, 3, 4].includes(value % 10) &&
103
+ ![12, 13, 14].includes(value % 100)
133
104
  ) {
134
- text = 'Недели'
105
+ text = forms[type][1]
135
106
  } else {
136
- text = 'Недель'
107
+ text = forms[type][2]
137
108
  }
138
-
139
- getCorrectWeekForm.text = text
140
- return text
141
- }
142
-
143
- const getCorrectMonthForm = (months: number): string => {
144
- let text: string
145
-
146
- if (!months) {
147
- return getCorrectMonthForm.text
148
- }
149
-
150
- if (months % 10 === 1 && months % 100 !== 11) {
151
- text = 'Месяц'
152
- } else if (
153
- [2, 3, 4].includes(months % 10) &&
154
- ![12, 13, 14].includes(months % 100)
155
- ) {
156
- text = 'Месяца'
157
- } else {
158
- text = 'Месяцев'
159
- }
160
-
161
- getCorrectMonthForm.text = text
109
+ getCorrectRuForm[type] = text
162
110
  return text
163
111
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.362",
4
+ "version": "1.3.364",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",