feat: added week day support for english and russian language

This commit is contained in:
Saveliy Savenok 2024-11-23 15:48:05 +03:00
parent 36ac898508
commit 6419e21387
23 changed files with 65 additions and 7 deletions

View File

@ -6,7 +6,7 @@
"appType": "watchface",
"version": {
"code": 1,
"name": "1.0.6"
"name": "1.1.0"
},
"icon": "icon.png",
"vender": "zepp",
@ -51,6 +51,9 @@
"i18n": {
"en-US": {
"appName": "VHS Watch"
},
"ru-RU": {
"appName": "VHS Watch"
}
},
"defaultLanguage": "en-US"

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 727 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 889 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

View File

@ -1,6 +1,6 @@
{
"name": "vhs-watch",
"version": "1.0.6",
"version": "1.1.0",
"description": "vhs watch for Zepp OS 3.0 (GTS 4)",
"main": "app.js",
"scripts": {

View File

@ -9,4 +9,4 @@ export default [
'clk/7.PNG',
'clk/8.PNG',
'clk/9.PNG'
];
]

View File

@ -9,4 +9,4 @@ export default [
'date/7.PNG',
'date/8.PNG',
'date/9.PNG'
];
]

View File

@ -0,0 +1,19 @@
export const en = [
'week/WeekEn/Monday.PNG',
'week/WeekEn/Tuesday.PNG',
'week/WeekEn/Wednesday.PNG',
'week/WeekEn/Thursday.PNG',
'week/WeekEn/Friday.PNG',
'week/WeekEn/Saturday.PNG',
'week/WeekEn/Sunday.PNG'
]
export const ru = [
'week/WeekRu/Понедельник.PNG',
'week/WeekRu/Вторник.PNG',
'week/WeekRu/Среда.PNG',
'week/WeekRu/Четверг.PNG',
'week/WeekRu/Пятница.PNG',
'week/WeekRu/Суббота.PNG',
'week/WeekRu/Воскресенье.PNG'
]

View File

@ -3,6 +3,7 @@ import clockModule from "./modules/clock"
import dateModule from "./modules/date"
import distanceModule from "./modules/distance"
import heartRateModule from "./modules/heartRate"
import weekModule from "./modules/week"
WatchFace({
onInit() {
@ -11,6 +12,7 @@ WatchFace({
batteryModule()
heartRateModule()
distanceModule()
weekModule()
},
build() {

View File

@ -1,6 +1,6 @@
import { getScene, SCENE_AOD } from '@zos/app'
import * as hmUI from '@zos/ui';
import secondaryFont from '../fontData/secondaryFont';
import * as hmUI from '@zos/ui'
import secondaryFont from '../fontData/secondaryFont'
const moduleX = 50
const moduleY = 405
@ -24,7 +24,7 @@ export default function () {
hmUI.createWidget(hmUI.widget.IMG, {
x: moduleX + 243,
y: moduleY,
src: "misc/km.png"
src: "misc/km.PNG"
})
}
}

34
watchface/modules/week.js Normal file
View File

@ -0,0 +1,34 @@
import { getScene, SCENE_AOD } from '@zos/app'
import * as hmSetting from '@zos/settings'
import * as hmUI from '@zos/ui'
import { ru, en } from '../fontData/weekData'
const moduleX = 225
const moduleY = 90
export default function () {
console.log("[modules]: week module init")
const language = hmSetting.getLanguage()
if (getScene() != SCENE_AOD) {
switch (language) {
case 4: //ru-RU
hmUI.createWidget(hmUI.widget.IMG_WEEK, {
x: moduleX,
y: moduleY,
week_en: ru,
week_tc: ru,
week_sc: ru
})
break;
default:
hmUI.createWidget(hmUI.widget.IMG_WEEK, {
x: moduleX,
y: moduleY,
week_en: en,
week_tc: en,
week_sc: en
})
break;
}
}
}