From 83935c14cbb8b5c0cfabfac8cbd5c0535d23e8dd Mon Sep 17 00:00:00 2001 From: caoliwen1 <14658249+caoliwen1@user.noreply.gitee.com> Date: Fri, 20 Sep 2024 19:47:32 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/base/BuildProfile.ets | 17 ++ .../merge_profile/default/module.json | 25 +++ .../src/main/ets/constants/HomeConstants.ets | 72 ++++---- .../home/src/main/ets/view/BannerView.ets | 7 +- .../home/src/main/ets/view/CommonView.ets | 6 +- .../src/main/ets/view/RecommendedVideo.ets | 6 +- .../main/ets/viewmodel/BannerViewModel.ets | 6 +- .../src/main/ets/viewmodel/IconViewModel.ets | 6 +- .../main/ets/viewmodel/VideoImgViewModel.ets | 14 +- .../main/resources/base/element/float.json | 8 +- .../main/resources/base/element/string.json | 148 +++++++++++++++ .../main/resources/en_US/element/string.json | 168 ++++++++++++++++++ .../main/resources/zh_CN/element/string.json | 167 +++++++++++++++++ 13 files changed, 589 insertions(+), 61 deletions(-) create mode 100644 commons/base/BuildProfile.ets create mode 100644 commons/base/build/default/intermediates/merge_profile/default/module.json create mode 100644 features/home/src/main/resources/en_US/element/string.json create mode 100644 features/home/src/main/resources/zh_CN/element/string.json diff --git a/commons/base/BuildProfile.ets b/commons/base/BuildProfile.ets new file mode 100644 index 0000000..3a501e5 --- /dev/null +++ b/commons/base/BuildProfile.ets @@ -0,0 +1,17 @@ +/** + * Use these variables when you tailor your ArkTS code. They must be of the const type. + */ +export const HAR_VERSION = '1.0.0'; +export const BUILD_MODE_NAME = 'debug'; +export const DEBUG = true; +export const TARGET_NAME = 'default'; + +/** + * BuildProfile Class is used only for compatibility purposes. + */ +export default class BuildProfile { + static readonly HAR_VERSION = HAR_VERSION; + static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; + static readonly DEBUG = DEBUG; + static readonly TARGET_NAME = TARGET_NAME; +} \ No newline at end of file diff --git a/commons/base/build/default/intermediates/merge_profile/default/module.json b/commons/base/build/default/intermediates/merge_profile/default/module.json new file mode 100644 index 0000000..26f4896 --- /dev/null +++ b/commons/base/build/default/intermediates/merge_profile/default/module.json @@ -0,0 +1,25 @@ +{ + "app": { + "bundleName": "com.huawei.videoapplication", + "debug": true, + "versionCode": 1000000, + "versionName": "1.0.0", + "minAPIVersion": 50000012, + "targetAPIVersion": 50000012, + "apiReleaseType": "Beta3", + "compileSdkVersion": "5.0.0.36", + "compileSdkType": "HarmonyOS", + "appEnvironments": [], + "bundleType": "app" + }, + "module": { + "name": "base", + "type": "har", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "installationFree": false + } +} diff --git a/features/home/src/main/ets/constants/HomeConstants.ets b/features/home/src/main/ets/constants/HomeConstants.ets index 0b8f5b0..0f6e380 100644 --- a/features/home/src/main/ets/constants/HomeConstants.ets +++ b/features/home/src/main/ets/constants/HomeConstants.ets @@ -17,33 +17,33 @@ export class HomeConstants { /** * Top tab topics. */ - static readonly TOP_TOPIC_LIST: string[] = ['精选', '视频', '社区', '新闻', '购物', '科技', '财经', '历史', '军事']; + static readonly TOP_TOPIC_LIST: ResourceStr[] = [$r('app.string.sift'), $r('app.string.video'), $r('app.string.community'), $r('app.string.news'), $r('app.string.shop'), $r('app.string.science'), $r('app.string.finance'), $r('app.string.history'), $r('app.string.affairs')]; /** * Icon list. */ - static readonly ICON_LIST: string[] = ['全部', '周热榜', '免费', '经典', '专区', '儿童专区', '华为专区', '付费精品', - '健身专区']; + static readonly ICON_LIST: ResourceStr[] = [$r('app.string.all'), $r('app.string.heat_list'), $r('app.string.free'), $r('app.string.sutra'), $r('app.string.prefecture'), $r('app.string.kids_only'), $r('app.string.zone'), $r('app.string.Premium_products'), + $r('app.string.Fitness')]; /** * Banner text 1. */ - static readonly BANNER_TEXT_1: string[] = ['HUAWEI ', 'Mate Book 系列', '新 品 发 布 会']; + static readonly BANNER_TEXT_1: ResourceStr[] = ['HUAWEI ', 'Mate Book ', $r('app.string.new')]; /** * Banner text 2. */ - static readonly BANNER_TEXT_2: string[] = ['HUAWEI ', '折叠旗舰及全场景', '新 品 发 布 会']; + static readonly BANNER_TEXT_2: ResourceStr[] = ['HUAWEI ', '', $r('app.string.new')]; /** * Banner text 3. */ - static readonly BANNER_TEXT_3: string[] = ['HUAWEI P60 系列', '', '华为春季旗舰新品发布会']; + static readonly BANNER_TEXT_3: ResourceStr[] = ['HUAWEI P60 ', '', $r('app.string.new')]; /** * Banner text 4. */ - static readonly BANNER_TEXT_4: string[] = ['万 象 新 生', '', '华 为 旗 舰 新 品 发 布 会']; + static readonly BANNER_TEXT_4: ResourceStr[] = ['HUAWEI P50', '', $r('app.string.new')]; /** * Video grid rate list. @@ -53,17 +53,17 @@ export class HomeConstants { /** * Video grid name list. */ - static readonly VIDEO_GRID_NAMES: string[] = ['建筑人文史迹', '生命之谜语', '世界十大神奇建筑', '舞动者们', '动物大迁徙', - '深海诱惑', '爱丽丝的秘密花园', '山河壮丽 下集', '童话王国', '我的世界']; + static readonly VIDEO_GRID_NAMES: ResourceStr[] = [$r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), + $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural')]; /** * Video grid content list. */ - static readonly VIDEO_GRID_CONTENTS: string[] = ['欧洲建筑的历史责任在载对欧洲建筑风格的形成和...', - '小小世界的生存智慧是非常复杂的,有社会环境...', '世界十大神奇建筑指的是建筑造型或地点十分独...', - '世界十大神奇建筑指的是建筑造型或地点十分独...', '每年6月左右,坦桑尼亚大草原的青草逐渐消耗...', - '深海险象环生,人类为何仍热衷潜水运动,海底...', '作家爱丽丝有一个不为人知的秘密花园,每当她...', - '这是千百年前的痕迹是经过风吹日晒才逐渐形成...', '一觉醒来,湛蓝的天空,连风都是温...', '卢卡斯有一只神奇的猫咪,每当它静...']; + static readonly VIDEO_GRID_CONTENTS: ResourceStr[] = [$r('app.string.europe'), + $r('app.string.europe'), $r('app.string.europe'), + $r('app.string.europe'), $r('app.string.europe'), + $r('app.string.europe'), $r('app.string.europe'), + $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe')]; /** * New video grid rate list. @@ -73,14 +73,14 @@ export class HomeConstants { /** * New video name list. */ - static readonly NEW_VIDEO_NAMES: string[] = ['HUAWEI Mate30 新...', '华为全场景智慧生活...', '自然地貌一览', '探海神秘', - '山河壮丽 中集', '父与子', '山河壮丽 上集']; + static readonly NEW_VIDEO_NAMES: ResourceStr[] = ['HUAWEI Mate30 ...', $r('app.string.life'), $r('app.string.life'), $r('app.string.life'), + $r('app.string.life'), $r('app.string.life'), $r('app.string.life')]; /** * New video content list. */ - static readonly NEW_VIDEO_CONTENTS: string[] = ['全球新品发布...', '华为终端·华为智慧生活...', '亿万年前地貌的形成都通...', - '海洋,是世界上最伟大的...', '亿万年前地貌的形成都通...', '在一个风雨交加的夜晚...', '亿万年前地貌的形成都通...']; + static readonly NEW_VIDEO_CONTENTS: ResourceStr[] = [$r('app.string.landscape'), $r('app.string.landscape'), $r('app.string.landscape'), + $r('app.string.landscape'), $r('app.string.landscape'), $r('app.string.landscape'), $r('app.string.landscape')]; /** * Main daily video rate. @@ -90,17 +90,17 @@ export class HomeConstants { /** * Main daily video name. */ - static readonly MAIN_DAILY_VIDEO_NAME: string = '生命之源:探索生命之源'; + static readonly MAIN_DAILY_VIDEO_NAME: ResourceStr = $r('app.string.explore'); /** * Main daily video content. */ - static readonly MAIN_DAILY_VIDEO_CONTENT: string = '探索生命之源'; + static readonly MAIN_DAILY_VIDEO_CONTENT: ResourceStr = $r('app.string.source'); /** * Main daily video more info. */ - static readonly MAIN_DAILY_VIDEO_MORE: string = '生命之源'; + static readonly MAIN_DAILY_VIDEO_MORE: ResourceStr = $r('app.string.source'); /** * Daily video rate list. @@ -110,42 +110,42 @@ export class HomeConstants { /** * Daily video name list. */ - static readonly DAILY_VIDEO_NAMES: string[] = ['孤独者', '日照金山', '女侦探黛西', '我和我的家乡']; + static readonly DAILY_VIDEO_NAMES: ResourceStr[] = [$r('app.string.lonely'), $r('app.string.lonely'), $r('app.string.lonely'), $r('app.string.lonely')]; /** * Daily video name list. */ - static readonly DAILY_VIDEO_CONTENTS: string[] = ['凯里是一个思想及灵魂...', '日照金山是梅里雪上独...', - '黛西是这个街区最有名...', '我的家乡在很遥远的山...']; + static readonly DAILY_VIDEO_CONTENTS: ResourceStr[] = [$r('app.string.source'), $r('app.string.source'), + $r('app.string.source'), $r('app.string.source')]; /** * Previous video name list one. */ - static readonly PREVIOUS_VIDEO_NAMES_ONE: string[] = ['海边往事', '华为折叠屏旗舰及全场景新品发布会', - '2022华为全屋智能及全场景新品春季...']; + static readonly PREVIOUS_VIDEO_NAMES_ONE: ResourceStr[] = [$r('app.string.life'), $r('app.string.life'), + $r('app.string.life')]; /** * Previous video content list one. */ - static readonly PREVIOUS_VIDEO_CONTENTS_ONE: string[] = ['电影 · 剧情片 · 2008年上...', '华为终端 · 发布会 · 202...', - '华为终端 · 华为资讯 · 20...']; + static readonly PREVIOUS_VIDEO_CONTENTS_ONE: ResourceStr[] = [$r('app.string.film'), $r('app.string.film'), + $r('app.string.film')]; /** * Previous video more info list one. */ - static readonly PREVIOUS_VIDEO_MORE_ONE: string[] = ['75.2万次播放', '9.8万次播放', '10.1万次播放']; + static readonly PREVIOUS_VIDEO_MORE_ONE: ResourceStr[] = [$r('app.string.plays'), $r('app.string.plays'), $r('app.string.plays')]; /** * Previous video name list two. */ - static readonly PREVIOUS_VIDEO_NAMES_TWO: string[] = ['华为全场景智慧生...', '神秘人X', '华为全场景智慧...', - '星球故事', '华为全场景智慧生...', '折叠万象']; + static readonly PREVIOUS_VIDEO_NAMES_TWO: ResourceStr[] = [$r('app.string.life'), $r('app.string.life'), $r('app.string.life'), + $r('app.string.life'), $r('app.string.life'), $r('app.string.life')]; /** * Previous video content list two. */ - static readonly PREVIOUS_VIDEO_CONTENTS_TWO: string[] = ['华为终端·华为资讯·...', '至今没有公开自己是...', - '华为终端·华为资讯·...', '在遥远的宇宙中有无...', '华为终端·华为资讯·...', '华为冬季旗舰新品发...']; + static readonly PREVIOUS_VIDEO_CONTENTS_TWO: ResourceStr[] = [$r('app.string.europe'), $r('app.string.europe'), + $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe')]; /** * XComponent type. @@ -170,7 +170,7 @@ export class HomeConstants { /** * Home sub title list. */ - static readonly HOME_SUB_TITLES: string[] = ['新片发布', '每日佳片', '往期回顾']; + static readonly HOME_SUB_TITLES: ResourceStr[] = [$r('app.string.release'), $r('app.string.tablet'), $r('app.string.back')]; /** * New video rows template. @@ -185,7 +185,7 @@ export class HomeConstants { /** * Main daily video button text. */ - static readonly HOME_BUTTON_TEXT: string[] = ['关注', '继续播放', '播放', '缓存']; + static readonly HOME_BUTTON_TEXT: ResourceStr[] = [$r('app.string.follow'), $r('app.string.play_on'), $r('app.string.play'), $r('app.string.cache')]; /** * Previous two list translate position. @@ -195,7 +195,7 @@ export class HomeConstants { /** * Search placeholder. */ - static readonly SEARCH_PLACEHOLDER: string = '搜索...'; + static readonly SEARCH_PLACEHOLDER: ResourceStr = $r('app.string.search'); /** * Video dialog option list. diff --git a/features/home/src/main/ets/view/BannerView.ets b/features/home/src/main/ets/view/BannerView.ets index 2ec304a..e83e43d 100644 --- a/features/home/src/main/ets/view/BannerView.ets +++ b/features/home/src/main/ets/view/BannerView.ets @@ -90,7 +90,7 @@ export struct BannerView { Column() { Text(item.getDescription().getIsLeftCenter().getValue(this.currentBreakpoint) ? - item.getDescription().getDescription()[0] + item.getDescription().getDescription()[1] : + `${item.getDescription().getDescription()[0]}${item.getDescription().getDescription()[1]}` : item.getDescription().getDescription()[0]) .fontSize(item.getDescription().getFontSize().getValue(this.currentBreakpoint)[0]) .fontWeight(item.getDescription().getFontWeight()[0]) @@ -224,8 +224,7 @@ export struct BannerView { // Immersive layout. Column() { Text(this.bannerImgList[2].getDescription().getIsLeftCenter().getValue(this.currentBreakpoint) ? - this.bannerImgList[2].getDescription().getDescription()[0] + - this.bannerImgList[2].getDescription().getDescription()[1] : + `${this.bannerImgList[2].getDescription().getDescription()[0]}${this.bannerImgList[2].getDescription().getDescription()[1]}` : this.bannerImgList[2].getDescription().getDescription()[0]) .fontSize(new BreakpointType($r('app.float.immersive_text_1_font_sm'), $r('app.float.immersive_text_1_font_md'), $r('app.float.immersive_text_1_font_lg')) @@ -329,7 +328,7 @@ struct BannerText { Column() { Text(this.banner.getDescription().getIsLeftCenter().getValue(this.currentBreakpoint) ? - this.banner.getDescription().getDescription()[0] + this.banner.getDescription().getDescription()[1] : + `${this.banner.getDescription().getDescription()[0]}${this.banner.getDescription().getDescription()[1]}` : this.banner.getDescription().getDescription()[0]) .fontSize(this.banner.getDescription().getFontSize().getValue(this.currentBreakpoint)[0]) .fontWeight(this.banner.getDescription().getFontWeight()[0]) diff --git a/features/home/src/main/ets/view/CommonView.ets b/features/home/src/main/ets/view/CommonView.ets index a869dcd..b3c7bb3 100644 --- a/features/home/src/main/ets/view/CommonView.ets +++ b/features/home/src/main/ets/view/CommonView.ets @@ -46,7 +46,7 @@ export struct VideoImgRating { export struct VideoTitle { @StorageLink('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; @StorageLink('currentTopIndex') currentTopIndex: number = 0; - private title: string = ''; + private title: ResourceStr = ''; build() { Text(this.title) @@ -64,7 +64,7 @@ export struct VideoTitle { export struct VideoContent { @StorageLink('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; @StorageLink('currentTopIndex') currentTopIndex: number = 0; - private content: string = ''; + private content: ResourceStr = ''; build() { Text(this.content) @@ -83,7 +83,7 @@ export struct VideoContent { export struct SubtitleComponent { @StorageLink('currentBreakpoint') currentBreakpoint: string = BreakpointConstants.BREAKPOINT_LG; @StorageLink('currentTopIndex') currentTopIndex: number = 0; - private title: string = ''; + private title: ResourceStr = ''; build() { Row() { diff --git a/features/home/src/main/ets/view/RecommendedVideo.ets b/features/home/src/main/ets/view/RecommendedVideo.ets index be70c4e..2c0b0ea 100644 --- a/features/home/src/main/ets/view/RecommendedVideo.ets +++ b/features/home/src/main/ets/view/RecommendedVideo.ets @@ -97,7 +97,7 @@ export struct RecommendedVideo { return; } // Obtains all attributes of a component. - let obj: Record = JSON.parse(getInspectorByKey(JSON.stringify(item))); + let obj: Record = JSON.parse(getRectangleById(JSON.stringify(item))); let rectInfo: string[] = JSON.parse(HomeConstants.SQUARE_BRACKETS[0] + obj.$rect + HomeConstants.SQUARE_BRACKETS[1]); // Obtains the height of the component from the top. @@ -244,3 +244,7 @@ export struct RecommendedVideo { } } + +function getRectangleById(arg0: string): string { + throw new Error('Function not implemented.'); +} diff --git a/features/home/src/main/ets/viewmodel/BannerViewModel.ets b/features/home/src/main/ets/viewmodel/BannerViewModel.ets index 2e1376b..59cf99e 100644 --- a/features/home/src/main/ets/viewmodel/BannerViewModel.ets +++ b/features/home/src/main/ets/viewmodel/BannerViewModel.ets @@ -141,7 +141,7 @@ class BannerDescription { /** * Text description. */ - private description: string[]; + private description: ResourceStr[]; /** * Font size of text. @@ -178,7 +178,7 @@ class BannerDescription { */ private isTopCenter: BreakpointType; - constructor(description: string[], fontSize: BreakpointType, fontWeight: number[], + constructor(description: ResourceStr[], fontSize: BreakpointType, fontWeight: number[], lineHeight: BreakpointType, leftPosition: BreakpointType, topPosition: BreakpointType, isLeftCenter: BreakpointType, isTopCenter: BreakpointType) { @@ -192,7 +192,7 @@ class BannerDescription { this.isTopCenter = isTopCenter; } - getDescription(): string[] { + getDescription(): ResourceStr[] { return this.description; } diff --git a/features/home/src/main/ets/viewmodel/IconViewModel.ets b/features/home/src/main/ets/viewmodel/IconViewModel.ets index fc58b39..c2b149a 100644 --- a/features/home/src/main/ets/viewmodel/IconViewModel.ets +++ b/features/home/src/main/ets/viewmodel/IconViewModel.ets @@ -39,19 +39,19 @@ export class VideoIcon { /** * Name of the icon. */ - private name: string; + private name: ResourceStr; /** * Image of the icon. */ private image: Resource; - constructor(name: string, image: Resource) { + constructor(name: ResourceStr, image: Resource) { this.name = name; this.image = image; } - getName(): string { + getName(): ResourceStr { return this.name; } diff --git a/features/home/src/main/ets/viewmodel/VideoImgViewModel.ets b/features/home/src/main/ets/viewmodel/VideoImgViewModel.ets index 7ff6be0..56af03f 100644 --- a/features/home/src/main/ets/viewmodel/VideoImgViewModel.ets +++ b/features/home/src/main/ets/viewmodel/VideoImgViewModel.ets @@ -142,19 +142,19 @@ export class VideoImage { /** * Title of the video. */ - private title: string; + private title: ResourceStr; /** * Content of the video. */ - private content: string; + private content: ResourceStr; /** * Other information of the video. */ - private otherInfo: string; + private otherInfo: ResourceStr; - constructor(imgSrc: Resource, rating: string, title: string, content: string, otherInfo: string) { + constructor(imgSrc: Resource, rating: string, title: ResourceStr, content: ResourceStr, otherInfo: ResourceStr) { this.imgSrc = imgSrc; this.rating = rating; this.title = title; @@ -170,15 +170,15 @@ export class VideoImage { return this.rating; } - getTitle(): string { + getTitle(): ResourceStr { return this.title; } - getContent(): string { + getContent(): ResourceStr { return this.content; } - getOtherInfo(): string { + getOtherInfo(): ResourceStr { return this.otherInfo; } } \ No newline at end of file diff --git a/features/home/src/main/resources/base/element/float.json b/features/home/src/main/resources/base/element/float.json index 7069781..d494032 100644 --- a/features/home/src/main/resources/base/element/float.json +++ b/features/home/src/main/resources/base/element/float.json @@ -238,11 +238,11 @@ }, { "name": "search_tab_font_selected", - "value": "24fp" + "value": "16fp" }, { "name": "search_tab_font", - "value": "18fp" + "value": "14fp" }, { "name": "main_daily_rating_font_lg", @@ -894,11 +894,11 @@ }, { "name": "top_text_width_selected", - "value": "56vp" + "value": "80vp" }, { "name": "top_text_width", - "value": "44vp" + "value": "60vp" }, { "name": "banner_focus_radius", diff --git a/features/home/src/main/resources/base/element/string.json b/features/home/src/main/resources/base/element/string.json index 51850af..9156e77 100644 --- a/features/home/src/main/resources/base/element/string.json +++ b/features/home/src/main/resources/base/element/string.json @@ -15,6 +15,154 @@ { "name": "tab_mine", "value": "我的" + }, + { + "name": "sift", + "value": "精选" + }, + { + "name": "video", + "value": "视频" + }, + { + "name": "community", + "value": "社区" + }, + { + "name": "news", + "value": "新闻" + }, + { + "name": "shop", + "value": "购物" + }, + { + "name": "science", + "value": "科技" + }, + { + "name": "finance", + "value": "财经" + }, + { + "name": "history", + "value": "历史" + }, + { + "name": "affairs", + "value": "军事" + }, + { + "name": "all", + "value": "全部" + }, + { + "name": "heat_list", + "value": "周热榜" + }, + { + "name": "free", + "value": "免费" + }, + { + "name": "sutra", + "value": "经典" + }, + { + "name": "prefecture", + "value": "专区" + }, + { + "name": "kids_only", + "value": "儿童专区" + }, + { + "name": "zone", + "value": "华为专区" + }, + { + "name": "Premium_products", + "value": "付费精品" + }, + { + "name": "Fitness", + "value": "健身专区" + }, + { + "name": "new", + "value": "新 品 发 布 会" + }, + { + "name": "folding", + "value": "折叠旗舰及全场景" + }, + { + "name": "cultural", + "value": "建筑人文史迹" + }, + { + "name": "europe", + "value": "欧洲建筑的历史责任在载对欧洲建筑风格的形成和" + }, + { + "name": "life", + "value": "华为全场景智慧生活" + }, + { + "name": "landscape", + "value": "数百万年前,地貌形成" + }, + { + "name": "explore", + "value": "生命之源:探索生命之源" + }, + { + "name": "source", + "value": "探索生命之源" + }, + { + "name": "lonely", + "value": "孤独者" + }, + { + "name": "film", + "value": "电影 · 剧情片 · 2008年上" + }, + { + "name": "plays", + "value": "75.2万次播放" + }, + { + "name": "release", + "value": "新片发布" + }, + { + "name": "tablet", + "value": "每日佳片" + }, + { + "name": "back", + "value": "往期回顾" + }, + { + "name": "follow", + "value": "关注" + }, + { + "name": "play_on", + "value": "继续播放" + }, + { + "name": "play", + "value": "播放" + }, + { + "name": "cache", + "value": "缓存" + }, + { + "name": "search", + "value": "搜索..." } ] } \ No newline at end of file diff --git a/features/home/src/main/resources/en_US/element/string.json b/features/home/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000..959608c --- /dev/null +++ b/features/home/src/main/resources/en_US/element/string.json @@ -0,0 +1,168 @@ +{ + "string": [ + { + "name": "tab_home", + "value": "home" + }, + { + "name": "tab_development", + "value": "develop" + }, + { + "name": "tab_member", + "value": "member" + }, + { + "name": "tab_mine", + "value": "my" + }, + { + "name": "sift", + "value": "Sift" + }, + { + "name": "video", + "value": "Video" + }, + { + "name": "community", + "value": "Area" + }, + { + "name": "news", + "value": "News" + }, + { + "name": "shop", + "value": "Shop" + }, + { + "name": "science", + "value": "Science" + }, + { + "name": "finance", + "value": "Finance" + }, + { + "name": "history", + "value": "history" + }, + { + "name": "affairs", + "value": "affairs" + }, + { + "name": "all", + "value": "all" + }, + { + "name": "heat_list", + "value": "heat list" + }, + { + "name": "free", + "value": "free" + }, + { + "name": "sutra", + "value": "sutra" + }, + { + "name": "prefecture", + "value": "prefecture" + }, + { + "name": "kids_only", + "value": "kids only" + }, + { + "name": "zone", + "value": "HUAWEI zone" + }, + { + "name": "Premium_products", + "value": "pay products" + }, + { + "name": "Fitness", + "value": "fitness area" + }, + { + "name": "new", + "value": "New product distribution meeting" + }, + { + "name": "folding", + "value": "Folding flagship and full scene" + }, + { + "name": "cultural", + "value": "Architectural cultural and historical sites" + }, + { + "name": "europe", + "value": "The historical responsibility of European architecture lies in the formation and development of European architectural styles" + }, + { + "name": "life", + "value": "Huawei full scene smart life" + }, + { + "name": "landscape", + "value": "Millions of years ago, the landscape was formed" + }, + { + "name": "explore", + "value": "The source of life: to explore the source of life" + }, + { + "name": "source", + "value": "To explore the source of life" + }, + { + "name": "lonely", + "value": "lonely" + }, + { + "name": "film", + "value": "Film · Feature Film · 2008" + }, + { + "name": "plays", + "value": "752,000 plays" + }, + { + "name": "release", + "value": "New film release" + }, + { + "name": "tablet", + "value": "Daily best tablet" + }, + { + "name": "back", + "value": "Look back" + }, + { + "name": "follow", + "value": "follow" + }, + { + "name": "play_on", + "value": "Play on" + }, + { + "name": "play", + "value": "play" + }, + { + "name": "cache", + "value": "cache" + }, + { + "name": "search", + "value": "Search..." + } + ] +} \ No newline at end of file diff --git a/features/home/src/main/resources/zh_CN/element/string.json b/features/home/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000..5963d53 --- /dev/null +++ b/features/home/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,167 @@ +{ + "string": [ + { + "name": "tab_home", + "value": "首页" + }, + { + "name": "tab_development", + "value": "动态" + }, + { + "name": "tab_member", + "value": "会员购" + }, + { + "name": "tab_mine", + "value": "我的" + }, + { + "name": "sift", + "value": "精选" + }, + { + "name": "video", + "value": "视频" + }, + { + "name": "community", + "value": "社区" + }, + { + "name": "news", + "value": "新闻" + }, + { + "name": "shop", + "value": "购物" + }, + { + "name": "science", + "value": "科技" + }, + { + "name": "finance", + "value": "财经" + }, + { + "name": "history", + "value": "历史" + }, + { + "name": "affairs", + "value": "军事" + }, + { + "name": "all", + "value": "全部" + }, + { + "name": "heat_list", + "value": "周热榜" + }, + { + "name": "free", + "value": "免费" + }, + { + "name": "sutra", + "value": "经典" + }, + { + "name": "prefecture", + "value": "专区" + }, + { + "name": "kids_only", + "value": "儿童专区" + }, + { + "name": "zone", + "value": "华为专区" + }, + { + "name": "Premium_products", + "value": "付费精品" + }, + { + "name": "Fitness", + "value": "健身专区" + }, + { + "name": "new", + "value": "新 品 发 布 会" + }, + { + "name": "folding", + "value": "折叠旗舰及全场景" + }, + { + "name": "cultural", + "value": "建筑人文史迹" + }, + { + "name": "europe", + "value": "欧洲建筑的历史责任在载对欧洲建筑风格的形成和" + }, + { + "name": "life", + "value": "华为全场景智慧生活" + }, + { + "name": "landscape", + "value": "数百万年前,地貌形成" + }, + { + "name": "explore", + "value": "生命之源:探索生命之源" + }, + { + "name": "source", + "value": "探索生命之源" + }, + { + "name": "lonely", + "value": "孤独者" + }, + { + "name": "film", + "value": "电影 · 剧情片 · 2008年上" + },{ + "name": "plays", + "value": "75.2万次播放" + }, + { + "name": "release", + "value": "新片发布" + }, + { + "name": "tablet", + "value": "每日佳片" + }, + { + "name": "back", + "value": "往期回顾" + }, + { + "name": "follow", + "value": "关注" + }, + { + "name": "play_on", + "value": "继续播放" + }, + { + "name": "play", + "value": "播放" + }, + { + "name": "cache", + "value": "缓存" + }, + { + "name": "search", + "value": "搜索..." + } + ] +} \ No newline at end of file -- Gitee From 70c603979d5a27f53862943b842bcdbc2143eed9 Mon Sep 17 00:00:00 2001 From: caoliwen1 <14658249+caoliwen1@user.noreply.gitee.com> Date: Fri, 20 Sep 2024 19:54:36 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/base/BuildProfile.ets | 17 ------------- .../merge_profile/default/module.json | 25 ------------------- 2 files changed, 42 deletions(-) delete mode 100644 commons/base/BuildProfile.ets delete mode 100644 commons/base/build/default/intermediates/merge_profile/default/module.json diff --git a/commons/base/BuildProfile.ets b/commons/base/BuildProfile.ets deleted file mode 100644 index 3a501e5..0000000 --- a/commons/base/BuildProfile.ets +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Use these variables when you tailor your ArkTS code. They must be of the const type. - */ -export const HAR_VERSION = '1.0.0'; -export const BUILD_MODE_NAME = 'debug'; -export const DEBUG = true; -export const TARGET_NAME = 'default'; - -/** - * BuildProfile Class is used only for compatibility purposes. - */ -export default class BuildProfile { - static readonly HAR_VERSION = HAR_VERSION; - static readonly BUILD_MODE_NAME = BUILD_MODE_NAME; - static readonly DEBUG = DEBUG; - static readonly TARGET_NAME = TARGET_NAME; -} \ No newline at end of file diff --git a/commons/base/build/default/intermediates/merge_profile/default/module.json b/commons/base/build/default/intermediates/merge_profile/default/module.json deleted file mode 100644 index 26f4896..0000000 --- a/commons/base/build/default/intermediates/merge_profile/default/module.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "app": { - "bundleName": "com.huawei.videoapplication", - "debug": true, - "versionCode": 1000000, - "versionName": "1.0.0", - "minAPIVersion": 50000012, - "targetAPIVersion": 50000012, - "apiReleaseType": "Beta3", - "compileSdkVersion": "5.0.0.36", - "compileSdkType": "HarmonyOS", - "appEnvironments": [], - "bundleType": "app" - }, - "module": { - "name": "base", - "type": "har", - "deviceTypes": [ - "phone", - "tablet", - "2in1" - ], - "installationFree": false - } -} -- Gitee From b25876d37201bcc6fd11a8894536baa78d0a726a Mon Sep 17 00:00:00 2001 From: caoliwen1 <14658249+caoliwen1@user.noreply.gitee.com> Date: Mon, 23 Sep 2024 08:34:58 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=A1=B5=E5=92=8C?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE=E9=A1=B5=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/ets/constants/HomeConstants.ets | 118 +++++------------- .../main/resources/base/element/string.json | 2 +- .../main/resources/en_US/element/string.json | 6 +- .../main/resources/zh_CN/element/string.json | 2 +- .../main/ets/constants/SearchConstants.ets | 57 ++++----- .../ets/viewmodel/SearchVideoImgViewModel.ets | 10 +- .../main/resources/base/element/string.json | 64 ++++++++++ .../main/resources/en_US/element/string.json | 64 ++++++++++ .../main/resources/zh_CN/element/string.json | 64 ++++++++++ .../main/ets/constants/DetailConstants.ets | 60 +++------ .../src/main/ets/view/AllComments.ets | 2 +- .../src/main/ets/view/RelatedList.ets | 6 +- .../ets/viewmodel/RelatedVideoViewModel.ets | 6 +- .../src/main/ets/viewmodel/UserViewModel.ets | 10 +- .../main/resources/base/element/string.json | 60 +++++++++ .../main/resources/en_US/element/string.json | 60 +++++++++ .../main/resources/zh_CN/element/string.json | 60 +++++++++ .../main/ets/constants/PlayerConstants.ets | 2 +- .../src/main/ets/view/SideEpisodes.ets | 2 +- .../src/main/ets/view/VideoPlayer.ets | 2 +- .../main/resources/base/element/string.json | 20 +++ .../main/resources/en_US/element/string.json | 20 +++ .../main/resources/zh_CN/element/string.json | 20 +++ 23 files changed, 525 insertions(+), 192 deletions(-) create mode 100644 features/search/src/main/resources/base/element/string.json create mode 100644 features/search/src/main/resources/en_US/element/string.json create mode 100644 features/search/src/main/resources/zh_CN/element/string.json create mode 100644 features/videoDetail/src/main/resources/base/element/string.json create mode 100644 features/videoDetail/src/main/resources/en_US/element/string.json create mode 100644 features/videoDetail/src/main/resources/zh_CN/element/string.json create mode 100644 features/videoPlayer/src/main/resources/base/element/string.json create mode 100644 features/videoPlayer/src/main/resources/en_US/element/string.json create mode 100644 features/videoPlayer/src/main/resources/zh_CN/element/string.json diff --git a/features/home/src/main/ets/constants/HomeConstants.ets b/features/home/src/main/ets/constants/HomeConstants.ets index 0f6e380..27b597d 100644 --- a/features/home/src/main/ets/constants/HomeConstants.ets +++ b/features/home/src/main/ets/constants/HomeConstants.ets @@ -17,45 +17,45 @@ export class HomeConstants { /** * Top tab topics. */ - static readonly TOP_TOPIC_LIST: ResourceStr[] = [$r('app.string.sift'), $r('app.string.video'), $r('app.string.community'), $r('app.string.news'), $r('app.string.shop'), $r('app.string.science'), $r('app.string.finance'), $r('app.string.history'), $r('app.string.affairs')]; - + static readonly TOP_TOPIC_LIST: ResourceStr[] = + [$r('app.string.sift'), $r('app.string.video'), $r('app.string.community'), $r('app.string.news'), + $r('app.string.shop'), $r('app.string.science'), $r('app.string.finance'), $r('app.string.history'), + $r('app.string.affairs')]; /** * Icon list. */ - static readonly ICON_LIST: ResourceStr[] = [$r('app.string.all'), $r('app.string.heat_list'), $r('app.string.free'), $r('app.string.sutra'), $r('app.string.prefecture'), $r('app.string.kids_only'), $r('app.string.zone'), $r('app.string.Premium_products'), - $r('app.string.Fitness')]; - + static readonly ICON_LIST: ResourceStr[] = + [$r('app.string.all'), $r('app.string.heat_list'), $r('app.string.free'), $r('app.string.sutra'), + $r('app.string.prefecture'), $r('app.string.kids_only'), $r('app.string.zone'), $r('app.string.Premium_products'), + $r('app.string.Fitness')]; /** * Banner text 1. */ static readonly BANNER_TEXT_1: ResourceStr[] = ['HUAWEI ', 'Mate Book ', $r('app.string.new')]; - /** * Banner text 2. */ static readonly BANNER_TEXT_2: ResourceStr[] = ['HUAWEI ', '', $r('app.string.new')]; - /** * Banner text 3. */ static readonly BANNER_TEXT_3: ResourceStr[] = ['HUAWEI P60 ', '', $r('app.string.new')]; - /** * Banner text 4. */ static readonly BANNER_TEXT_4: ResourceStr[] = ['HUAWEI P50', '', $r('app.string.new')]; - /** * Video grid rate list. */ static readonly VIDEO_GRID_RATES: string[] = ['7.8', '8.0', '7.9', '8.4', '7.8', '8.0', '7.9', '8.4', '7.6', '8.0']; - /** * Video grid name list. */ - static readonly VIDEO_GRID_NAMES: ResourceStr[] = [$r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), - $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural')]; - + static readonly VIDEO_GRID_NAMES: ResourceStr[] = + [$r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), + $r('app.string.cultural'), + $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), + $r('app.string.cultural')]; /** * Video grid content list. */ @@ -64,335 +64,277 @@ export class HomeConstants { $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe')]; - /** * New video grid rate list. */ static readonly NEW_VIDEO_RATES: string[] = ['', '', '7.9', '7.9', '7.9', '7.9', '7.9']; - /** * New video name list. */ - static readonly NEW_VIDEO_NAMES: ResourceStr[] = ['HUAWEI Mate30 ...', $r('app.string.life'), $r('app.string.life'), $r('app.string.life'), - $r('app.string.life'), $r('app.string.life'), $r('app.string.life')]; - + static readonly NEW_VIDEO_NAMES: ResourceStr[] = + ['HUAWEI Mate30 ...', $r('app.string.life'), $r('app.string.life'), $r('app.string.life'), + $r('app.string.life'), $r('app.string.life'), $r('app.string.life')]; /** * New video content list. */ - static readonly NEW_VIDEO_CONTENTS: ResourceStr[] = [$r('app.string.landscape'), $r('app.string.landscape'), $r('app.string.landscape'), - $r('app.string.landscape'), $r('app.string.landscape'), $r('app.string.landscape'), $r('app.string.landscape')]; - + static readonly NEW_VIDEO_CONTENTS: ResourceStr[] = + [$r('app.string.landscape'), $r('app.string.landscape'), $r('app.string.landscape'), + $r('app.string.landscape'), $r('app.string.landscape'), $r('app.string.landscape'), $r('app.string.landscape')]; /** * Main daily video rate. */ static readonly MAIN_DAILY_VIDEO_RATE: string = '8.4'; - /** * Main daily video name. */ static readonly MAIN_DAILY_VIDEO_NAME: ResourceStr = $r('app.string.explore'); - /** * Main daily video content. */ static readonly MAIN_DAILY_VIDEO_CONTENT: ResourceStr = $r('app.string.source'); - /** * Main daily video more info. */ static readonly MAIN_DAILY_VIDEO_MORE: ResourceStr = $r('app.string.source'); - /** * Daily video rate list. */ static readonly DAILY_VIDEO_RATES: string[] = ['8.4', '8.4', '8.4', '8.4']; - /** * Daily video name list. */ - static readonly DAILY_VIDEO_NAMES: ResourceStr[] = [$r('app.string.lonely'), $r('app.string.lonely'), $r('app.string.lonely'), $r('app.string.lonely')]; - + static readonly DAILY_VIDEO_NAMES: ResourceStr[] = + [$r('app.string.lonely'), $r('app.string.lonely'), $r('app.string.lonely'), $r('app.string.lonely')]; /** * Daily video name list. */ static readonly DAILY_VIDEO_CONTENTS: ResourceStr[] = [$r('app.string.source'), $r('app.string.source'), $r('app.string.source'), $r('app.string.source')]; - /** * Previous video name list one. */ static readonly PREVIOUS_VIDEO_NAMES_ONE: ResourceStr[] = [$r('app.string.life'), $r('app.string.life'), $r('app.string.life')]; - /** * Previous video content list one. */ static readonly PREVIOUS_VIDEO_CONTENTS_ONE: ResourceStr[] = [$r('app.string.film'), $r('app.string.film'), $r('app.string.film')]; - /** * Previous video more info list one. */ - static readonly PREVIOUS_VIDEO_MORE_ONE: ResourceStr[] = [$r('app.string.plays'), $r('app.string.plays'), $r('app.string.plays')]; - + static readonly PREVIOUS_VIDEO_MORE_ONE: ResourceStr[] = + [$r('app.string.plays'), $r('app.string.plays'), $r('app.string.plays')]; /** * Previous video name list two. */ - static readonly PREVIOUS_VIDEO_NAMES_TWO: ResourceStr[] = [$r('app.string.life'), $r('app.string.life'), $r('app.string.life'), - $r('app.string.life'), $r('app.string.life'), $r('app.string.life')]; - + static readonly PREVIOUS_VIDEO_NAMES_TWO: ResourceStr[] = + [$r('app.string.life'), $r('app.string.life'), $r('app.string.life'), + $r('app.string.life'), $r('app.string.life'), $r('app.string.life')]; /** * Previous video content list two. */ static readonly PREVIOUS_VIDEO_CONTENTS_TWO: ResourceStr[] = [$r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe')]; - /** * XComponent type. */ static readonly X_COMPONENT_TYPE: string = 'surface'; - /** * Banner text letter space list. */ static readonly BANNER_TEXT_LETTER_SPACES: string[] = ['2vp', '3vp', '1vp']; - /** * Swiper item space. */ static readonly SWIPER_ITEM_SPACE: string = '12vp'; - /** * Banner row space. */ static readonly BANNER_ROW_SPACE: string = '12vp'; - /** * Home sub title list. */ - static readonly HOME_SUB_TITLES: ResourceStr[] = [$r('app.string.release'), $r('app.string.tablet'), $r('app.string.back')]; - + static readonly HOME_SUB_TITLES: ResourceStr[] = + [$r('app.string.release'), $r('app.string.tablet'), $r('app.string.back')]; /** * New video rows template. */ static readonly NEW_VIDEO_ROWS_TEMPLATE: string = '1fr'; - /** * Search top tab bar list space list. */ static readonly SEARCH_TAB_LIST_SPACES: string[] = ['16vp', '24vp', '36vp']; - /** * Main daily video button text. */ - static readonly HOME_BUTTON_TEXT: ResourceStr[] = [$r('app.string.follow'), $r('app.string.play_on'), $r('app.string.play'), $r('app.string.cache')]; - + static readonly HOME_BUTTON_TEXT: ResourceStr[] = + [$r('app.string.follow'), $r('app.string.play_on'), $r('app.string.player'), $r('app.string.cache')]; /** * Previous two list translate position. */ static readonly PREVIOUS_TWO_TRANSLATE_MD: string = '-42vp'; - /** * Search placeholder. */ static readonly SEARCH_PLACEHOLDER: ResourceStr = $r('app.string.search'); - /** * Video dialog option list. */ static readonly VIDEO_DIALOG_OPTIONS: string[] = ['追剧', '收藏', '点赞']; - /** * Side bar icon list height. */ static readonly SIDE_ICON_LIST_HEIGHT: string = '25%'; - /** * Square brackets. */ static readonly SQUARE_BRACKETS: string[] = ['[', ']']; - /** * Height unit. */ static readonly HEIGHT_UNIT: string = 'vp'; - /** * Two. */ static readonly TWO: number = 2; - /** * Five. */ static readonly FIVE: number = 5; - /** * Six. */ static readonly SIX: number = 6; - /** * Seven. */ static readonly SEVEN: number = 7; - /** * Eight. */ static readonly EIGHT: number = 8; - /** * Video dialog height list. */ static readonly VIDEO_DIALOG_HEIGHTS: number[] = [161, 268, 347]; - /** * Video dialog aspect ratio. */ static readonly VIDEO_DIALOG_ASPECT_RATIO: number = 1.74; - /** * New banner aspect ratio. */ static readonly NEW_BANNER_ASPECT_RATIO: number = 1.5; - /** * Home header background change height. */ static readonly BACKGROUND_CHANGE_HEIGHT: number[] = [27, 34, 56]; - /** * Video grid item space. */ static readonly VIDEO_GRID_ITEM_SPACE: number = 12; - /** * Video grid margin. */ static readonly VIDEO_GRID_MARGIN: number[] = [32, 48, 64]; - /** * Number of displayed icons. */ static readonly DISPLAYED_ICON_NUMBER: number[] = [9, 13, 17]; - /** * Lg sidebar width. */ static readonly LG_SIDEBAR_WIDTH: number = 96; - /** * Video grid description height. */ static readonly VIDEO_GRID_DESCRIPTION_HEIGHT: number = 114; - /** * New video aspect ratio. */ static readonly NEW_VIDEO_ASPECT_RATIO: number = 0.72; - /** * New video description height. */ static readonly NEW_VIDEO_DESCRIPTION_HEIGHT: number = 45; - /** * Daily video description height. */ static readonly DAILY_VIDEO_DESCRIPTION_HEIGHT: number[] = [103, 62]; - /** * Previous two ratio list. */ static readonly PREVIOUS_TWO_RATIOS: number[] = [0.76, 0.89, 0.86, 0.74, 0.8, 0.9, 0.83]; - /** * Banner aspect ratio list. */ static readonly BANNER_RATIOS: number[] = [1.5, 1.83, 2.33]; - /** * Home header height for sm. */ static readonly HOME_HEADER_HEIGHT_SM: number = 112; - /** * Window undefined top. */ static readonly WINDOW_UNDEFINED_TOP: number = 39; - /** * Window undefined left. */ static readonly WINDOW_UNDEFINED_LEFT: number = 5; - /** * Eleven. */ static readonly ELEVEN: number = 11; - /** * Banner text 1 left position for md. */ static readonly BANNER_TEXT_1_LEFT_MD: string = '8%'; - /** * Banner text 2 left position for md. */ static readonly BANNER_TEXT_2_LEFT_MD: string = '8%'; - /** * Banner text 2 left position for lg. */ static readonly BANNER_TEXT_2_LEFT_LG: string = '5%'; - /** * Banner text 1 top position for sm. */ static readonly BANNER_TEXT_1_TOP_SM: string[] = ['15%', '2vp']; - /** * Banner text 1 top position for md. */ static readonly BANNER_TEXT_1_TOP_MD: string[] = ['8%', '4vp']; - /** * Banner text 1 top position for lg. */ static readonly BANNER_TEXT_1_TOP_LG: string[] = ['5%', '2vp']; - /** * Banner text 2 top position for sm. */ static readonly BANNER_TEXT_2_TOP_SM: string[] = ['15%', '2vp']; - /** * Banner text 2 top position for md. */ static readonly BANNER_TEXT_2_TOP_MD: string[] = ['10%', '4vp']; - /** * Banner text 2 top position for lg. */ static readonly BANNER_TEXT_2_TOP_LG: string[] = ['10%', '8vp']; - /** * Video detail url. */ static readonly VIDEO_DETAIL_URL: string = '@bundle:com.huawei.videoapplication/videoDetail/ets/pages/Index'; - /** * Direction list. */ static readonly DIRECTION_LIST: string[] = ['BottomTabs', 'TopTabs', 'Banner', 'IconList', 'RecommendedVideo', 'NewRelease', 'DailyVideoOne', 'DailyVideoTwo', 'PreviousVideo']; - /** * Percent 105. */ static readonly PERCENT_HUNDRED_AND_FIVE: string = '105%'; - /** * Animation duration. */ diff --git a/features/home/src/main/resources/base/element/string.json b/features/home/src/main/resources/base/element/string.json index 9156e77..19051de 100644 --- a/features/home/src/main/resources/base/element/string.json +++ b/features/home/src/main/resources/base/element/string.json @@ -153,7 +153,7 @@ "value": "继续播放" }, { - "name": "play", + "name": "player", "value": "播放" }, { diff --git a/features/home/src/main/resources/en_US/element/string.json b/features/home/src/main/resources/en_US/element/string.json index 959608c..bd8df22 100644 --- a/features/home/src/main/resources/en_US/element/string.json +++ b/features/home/src/main/resources/en_US/element/string.json @@ -46,11 +46,11 @@ }, { "name": "history", - "value": "history" + "value": "History" }, { "name": "affairs", - "value": "affairs" + "value": "Affairs" }, { "name": "all", @@ -153,7 +153,7 @@ "value": "Play on" }, { - "name": "play", + "name": "player", "value": "play" }, { diff --git a/features/home/src/main/resources/zh_CN/element/string.json b/features/home/src/main/resources/zh_CN/element/string.json index 5963d53..0754316 100644 --- a/features/home/src/main/resources/zh_CN/element/string.json +++ b/features/home/src/main/resources/zh_CN/element/string.json @@ -152,7 +152,7 @@ "value": "继续播放" }, { - "name": "play", + "name": "player", "value": "播放" }, { diff --git a/features/search/src/main/ets/constants/SearchConstants.ets b/features/search/src/main/ets/constants/SearchConstants.ets index 8320af2..3294e14 100644 --- a/features/search/src/main/ets/constants/SearchConstants.ets +++ b/features/search/src/main/ets/constants/SearchConstants.ets @@ -17,112 +17,101 @@ export class SearchConstants { /** * Searching for a recommendation list in large devices. */ - static readonly SEARCH_DISCOVERY_LARGE: string[] = ['搜索发现1', '搜索发现2', '搜索发现3', '搜索发现4', '搜索发现5', - '搜索发现6', '搜索发现7', '搜索发现8', '搜索发现9']; - + static readonly SEARCH_DISCOVERY_LARGE: ResourceStr[] = + [$r('app.string.search'), $r('app.string.search'), $r('app.string.search'), $r('app.string.search'), + $r('app.string.search'), + $r('app.string.search'), $r('app.string.search'), $r('app.string.search'), $r('app.string.search')]; /** * Tabs list. */ - static readonly SEARCH_TABS: string[] = ['热搜', '剧场', '电影', '综艺', '动漫', '儿童', '记录']; - + static readonly SEARCH_TABS: ResourceStr[] = + [$r('app.string.top'), $r('app.string.theater'), $r('app.string.movie'), $r('app.string.variety'), + $r('app.string.anime'), $r('app.string.children'), $r('app.string.records')]; /** * Search List for hua. */ - static readonly HUA_LIST: string[] = ['华为游戏', '华为会员电视剧场', '华为开发者大会2023cloud主题演讲...', '华为发布会', - '华为发布会Harmonyos4', '华为会员电影专区']; - + static readonly HUA_LIST: ResourceStr[] = + ['华为游戏', $r('app.string.tv'), '华为开发者大会2023cloud主题演讲...', '华为发布会', + '华为发布会Harmonyos4', '华为会员电影专区']; /** * Search result tab List. */ static readonly SEARCH_RESULT_TAB_LIST: string[] = ['全部', '影视', '短视频', '用户']; - /** * Search video img title list. */ - static readonly SEARCH_IMG_IMG_TITLES: string[] = ['建筑人文史迹', '世界十大神奇建筑', '生命之谜语', '舞动者们', - '动物大迁徙', '深海诱惑', '爱丽丝的秘密花园', '山河壮丽 下集', '我的世界', '童话王国', '父与子', '山河壮丽 中集']; - + static readonly SEARCH_IMG_IMG_TITLES: ResourceStr[] = + [$r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), + $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), + $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural'), $r('app.string.cultural')]; /** * Search video img content list. */ - static readonly SEARCH_IMG_IMG_CONTENTS: string[] = ['欧洲建筑的历史责任在于对欧洲...', '世界十大神奇建筑指的是建筑造型...', - '小小世界的生存智慧是非常...', '世界十大神奇建筑指的是建筑造型...', '每年6月左右,坦桑尼亚大草原...', - '深海险象环生,人类为何仍热衷潜水...', '作家爱丽丝有一个不为人知的秘密花...', '这是千百年前的痕迹是经过风吹日晒...', - '卢卡斯有一只神奇的猫咪,每当它静...', '一觉醒来,湛蓝的天空,连风都是温...', '在一个风雨交加的夜晚,杰克破门...', - '亿万年前地貌的形成都通过不同的']; - + static readonly SEARCH_IMG_IMG_CONTENTS: ResourceStr[] = + [$r('app.string.europe'), $r('app.string.europe'), + $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe'), + $r('app.string.europe'), $r('app.string.europe'), + $r('app.string.europe'), + $r('app.string.europe'), $r('app.string.europe'), $r('app.string.europe'), + $r('app.string.europe')]; /** * Search result title list. */ static readonly SEARCH_RESULT_TITLES: string[] = ['华为折叠屏旗舰及全场景新品发布会', '华为旗舰新品发布会', '2022华为全屋智能及全场景新品春季...']; - /** * Search result content list. */ static readonly SEARCH_RESULT_CONTENTS: string[] = ['发布会 · 华为终端 · 202...', '发布会 · 华为终端 · 202...', '2022华为全屋智能及全场景新品春季...']; - /** * Search result more info list. */ static readonly SEARCH_RESULT_MORE: string[] = ['9.8万次播放', '75.2万次播放', '10.1万次播放']; - /** * Search sub title list. */ - static readonly SEARCH_SUB_TITLES: string[] = ['搜索历史', '搜索内容', '搜索发现']; - + static readonly SEARCH_SUB_TITLES: ResourceStr[] = [$r('app.string.history_search'), $r('app.string.content'), $r('app.string.find')]; /** * Search recommend list lanes. */ static readonly SEARCH_LIST_LANES: number[] = [3, 2, 1]; - /** * Hot trending list spaces. */ static readonly HOT_TRENDING_LIST_SPACES: string[] = ['16vp', '24vp', '36vp']; - /** * Search recommend divider padding. */ static readonly SEARCH_RECOMMEND_DIVIDER_PADDING: string = '16vp'; - /** * Search index. */ static readonly SEARCH_INDEX: number[] = [2, 3]; - /** * Search placeholder. */ - static readonly SEARCH_PLACEHOLDER: string = '搜索...'; - + static readonly SEARCH_PLACEHOLDER: ResourceStr = $r('app.string.search1'); /** * Type tabs divider stroke width. */ static readonly TYPE_TABS_DIVIDER_STROKE_WIDTH: string = '2vp'; - /** * Search result title. */ static readonly SEARCH_RESULT_TITLE: string = '华为发布会'; - /** * Search result button text list. */ static readonly SEARCH_RESULT_BUTTON_TEXTS: string[] = ['播放', '缓存']; - /** * Video detail url. */ static readonly VIDEO_DETAIL_URL: string = '@bundle:com.huawei.videoapplication/videoDetail/ets/pages/Index'; - /** * Search input list. */ static readonly SEARCH_INPUT_LIST: string[] = ['华', '华为发布会']; - /** * Hot video divider stroke width. */ diff --git a/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets b/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets index a3de5f4..ca0a819 100644 --- a/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets +++ b/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets @@ -80,19 +80,19 @@ export class SearchVideoImg { /** * Title of the video. */ - private title: string; + private title: ResourceStr; /** * Content of the video. */ - private content: string; + private content: ResourceStr; /** * Other information of the video. */ private otherInfo: string; - constructor(imgSrc: Resource, title: string, content: string, otherInfo: string) { + constructor(imgSrc: Resource, title: ResourceStr, content: ResourceStr, otherInfo: string) { this.imgSrc = imgSrc; this.title = title; this.content = content; @@ -103,11 +103,11 @@ export class SearchVideoImg { return this.imgSrc; } - getTitle(): string { + getTitle(): ResourceStr { return this.title; } - getContent(): string { + getContent(): ResourceStr { return this.content; } diff --git a/features/search/src/main/resources/base/element/string.json b/features/search/src/main/resources/base/element/string.json new file mode 100644 index 0000000..8feefe0 --- /dev/null +++ b/features/search/src/main/resources/base/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "search", + "value": "搜索发现1" + }, + { + "name": "top", + "value": "热搜" + }, + { + "name": "theater", + "value": "剧场" + }, + { + "name": "movie", + "value": "电影" + }, + { + "name": "variety", + "value": "综艺" + }, + { + "name": "anime", + "value": "动漫" + }, + { + "name": "children", + "value": "儿童" + }, + { + "name": "records", + "value": "记录" + }, + { + "name": "tv", + "value": "华为会员电视剧场" + }, + { + "name": "cultural", + "value": "建筑人文史迹" + }, + { + "name": "europe", + "value": "欧洲建筑的历史责任在载对欧洲建筑风格的形成和" + }, + { + "name": "history_search", + "value": "搜索历史" + }, + { + "name": "content", + "value": "搜索内容" + }, + { + "name": "find", + "value": "搜索发现" + }, + { + "name": "search1", + "value": "搜索..." + } + ] +} \ No newline at end of file diff --git a/features/search/src/main/resources/en_US/element/string.json b/features/search/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000..c8f2853 --- /dev/null +++ b/features/search/src/main/resources/en_US/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "search", + "value": "Search 1" + }, + { + "name": "top", + "value": "top" + }, + { + "name": "theater", + "value": "theater" + }, + { + "name": "movie", + "value": "movie" + }, + { + "name": "variety", + "value": "variety" + }, + { + "name": "anime", + "value": "anime" + }, + { + "name": "children", + "value": "children" + }, + { + "name": "records", + "value": "records" + }, + { + "name": "tv", + "value": "Huawei member TV Theater" + }, + { + "name": "cultural", + "value": "Architectural cultural and historical sites" + }, + { + "name": "europe", + "value": "The historical responsibility of European architecture lies in the formation and development of European architectural styles" + }, + { + "name": "history_search", + "value": "Search history" + }, + { + "name": "content", + "value": "content" + }, + { + "name": "find", + "value": "Search and find" + }, + { + "name": "search1", + "value": "Search..." + } + ] +} \ No newline at end of file diff --git a/features/search/src/main/resources/zh_CN/element/string.json b/features/search/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000..8feefe0 --- /dev/null +++ b/features/search/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "search", + "value": "搜索发现1" + }, + { + "name": "top", + "value": "热搜" + }, + { + "name": "theater", + "value": "剧场" + }, + { + "name": "movie", + "value": "电影" + }, + { + "name": "variety", + "value": "综艺" + }, + { + "name": "anime", + "value": "动漫" + }, + { + "name": "children", + "value": "儿童" + }, + { + "name": "records", + "value": "记录" + }, + { + "name": "tv", + "value": "华为会员电视剧场" + }, + { + "name": "cultural", + "value": "建筑人文史迹" + }, + { + "name": "europe", + "value": "欧洲建筑的历史责任在载对欧洲建筑风格的形成和" + }, + { + "name": "history_search", + "value": "搜索历史" + }, + { + "name": "content", + "value": "搜索内容" + }, + { + "name": "find", + "value": "搜索发现" + }, + { + "name": "search1", + "value": "搜索..." + } + ] +} \ No newline at end of file diff --git a/features/videoDetail/src/main/ets/constants/DetailConstants.ets b/features/videoDetail/src/main/ets/constants/DetailConstants.ets index 1975e78..63ea824 100644 --- a/features/videoDetail/src/main/ets/constants/DetailConstants.ets +++ b/features/videoDetail/src/main/ets/constants/DetailConstants.ets @@ -18,173 +18,143 @@ export class DetailConstants { * Initial comment image height. */ static readonly INITIAL_COMMENT_IMAGE_HEIGHT: string = '150vp'; - /** * Initial comment image width. */ static readonly INITIAL_COMMENT_IMAGE_WIDTH: string = '219vp'; - /** * Initial related video height. */ static readonly INITIAL_RELATED_VIDEO_HEIGHT: number = 169; - /** * Initial related video height. */ static readonly INITIAL_VIDEO_HEIGHT: number = 100; - /** * Comment image min height number. */ static readonly COMMENT_IMAGE_MIN_HEIGHT_NUMBER: number = 150; - /** * Comment image min width number. */ static readonly COMMENT_IMAGE_MIN_WIDTH_NUMBER: number = 219; - /** * Comment image max height number. */ static readonly COMMENT_IMAGE_MAX_HEIGHT_NUMBER: number = 182; - /** * Comment image max width number. */ static readonly COMMENT_IMAGE_MAX_WIDTH_NUMBER: number = 266; - /** * Side bar min width number. */ static readonly SIDE_BAR_MIN_WIDTH_NUMBER: number = 320; - /** * Offset for scrolling to top. */ static readonly SCROLL_TO_TOP: string = '{"xOffset":0,"yOffset":0}'; - /** * Sub title list. */ - static readonly SUB_TITLES: string[] = ['全部评论', '相关列表', '更多', '视频简介', '选集', '周边视频']; - + static readonly SUB_TITLES: ResourceStr[] = + [$r('app.string.comments'), $r('app.string.related'), $r('app.string.more'), $r('app.string.introduction'), + $r('app.string.anthology'), $r('app.string.Peripheral')]; /** * Comment image aspect ratio. */ static readonly COMMENT_IMAGE_ASPECT_RATIO: number = 1.46; - /** * Comment image width list. */ static readonly COMMENT_IMAGE_WIDTH: string[] = ['227vp', '371vp']; - /** * Comment image height list. */ static readonly COMMENT_IMAGE_HEIGHT: string[] = ['155vp', '254vp']; - /** * Episodes list. */ static readonly EPISODES_LIST: string[] = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']; - /** * Length unit. */ static readonly LENGTH_UNIT: string = 'vp'; - /** * Introduction content. */ - static readonly INTRODUCTION_CONTENT: string[] = ['北京时间3月23日,华为春季旗舰新品发布会,我们不见不散。', - '23.4万次播放··华为终端·华为资讯·2023·中国大陆']; - + static readonly INTRODUCTION_CONTENT: ResourceStr[] = [$r('app.string.product'), + $r('app.string.play')]; /** * Icon list. */ static readonly ICON_LIST: Resource[] = [$r('app.media.ic_public_favor'), $r('app.media.ic_public_comments'), $r('app.media.ic_public_thumb_sup'), $r('app.media.ic_public_download'), $r('app.media.ic_public_share')]; - /** * Shadow radius. */ static readonly SHADOW_RADIUS: number = 50; - /** * Shadow offset y. */ static readonly SHADOW_OFFSET_Y: number = 10; - /** * Percent sign. */ static readonly PERCENT_SIGN: string = '%'; - /** * Related video title list. */ - static readonly RELATED_VIDEO_TITLES: string[] = ['华为旗舰新品发布...', '华为公益之路:向...', '华为全屋智能家居...', - 'nova 10系列及全...', '华为冬季旗舰新品...', 'Matebook系列新...', '华为Vision全新发布...']; - + static readonly RELATED_VIDEO_TITLES: ResourceStr[] = + [$r('app.string.released'), $r('app.string.released'), $r('app.string.released'), + $r('app.string.released'), $r('app.string.released'), $r('app.string.released'), $r('app.string.released')]; /** * Peripheral video title list. */ - static readonly PERIPHERAL_VIDEO_TITLE: string[] = ['华为音乐听书会,背包...', '华为折叠屏旗舰及全场...', - 'HUAWEI P60 系列发布...', '折叠万象系列新品发布', 'HUAWEI P60 系列发布...']; - + static readonly PERIPHERAL_VIDEO_TITLE: ResourceStr[] = [$r('app.string.series'), $r('app.string.series'), + $r('app.string.series'), $r('app.string.series'), $r('app.string.series')]; /** * User info name list. */ static readonly USER_INFO_NAMES: string[] = ['m******', 'H******', 'BEI***']; - /** * User info comment list. */ - static readonly USER_INFO_COMMENTS: string[] = [ - '感觉很不错啊,下一款准备入手Mate X3了,很喜欢折叠屏的分屏功能,终于可以一边聊天一边看短视频了!', - '好喜欢这张图,很惊艳!!!竟然是手机拍出来的,太给力了!', '这个背面真的很有设计感,珠光贝母,种草了种草了']; - + static readonly USER_INFO_COMMENTS: ResourceStr[] = [ + $r('app.string.feel'), + $r('app.string.love')]; /** * User info date. */ - static readonly USER_INFO_DATE: string = '7月27日'; - + static readonly USER_INFO_DATE: ResourceStr = $r('app.string.July'); /** * Placeholder of comment text input. */ - static readonly COMMENT_PLACEHOLDER: string = '评论...'; - + static readonly COMMENT_PLACEHOLDER: ResourceStr = $r('app.string.comment'); /** * Min video percent. */ static readonly MIN_VIDEO_PERCENT: number = 53; - /** * Max video percent. */ static readonly MAX_VIDEO_PERCENT: number = 100; - /** * Ten. */ static readonly TEN: number = 10; - /** * Related list height. */ static readonly RELATED_LIST_HEIGHT: number = 169; - /** * Video detail. */ static readonly VIDEO_DETAIL: string = 'videoDetail'; - /** * Full-screen page url. */ static readonly FULL_SCREEN_URL: string = '@bundle:com.huawei.videoapplication/videoPlayer/ets/pages/Index'; - /** * Comments area percent. */ diff --git a/features/videoDetail/src/main/ets/view/AllComments.ets b/features/videoDetail/src/main/ets/view/AllComments.ets index 2122ce2..7e2f89f 100644 --- a/features/videoDetail/src/main/ets/view/AllComments.ets +++ b/features/videoDetail/src/main/ets/view/AllComments.ets @@ -123,7 +123,7 @@ export struct AllComments { } @Builder - TitleText(content: string) { + TitleText(content: ResourceStr) { Text(content) .fontSize($r('app.float.all_comments_title_text_font')) .lineHeight($r('app.float.all_comments_title_text_line')) diff --git a/features/videoDetail/src/main/ets/view/RelatedList.ets b/features/videoDetail/src/main/ets/view/RelatedList.ets index 7bdb880..fa63840 100644 --- a/features/videoDetail/src/main/ets/view/RelatedList.ets +++ b/features/videoDetail/src/main/ets/view/RelatedList.ets @@ -267,7 +267,7 @@ export struct RelatedList { } @Builder - SubTitle(subtitle: string) { + SubTitle(subtitle: ResourceStr) { Row() { Text(subtitle) .fontSize($r('app.float.sub_title_font')) @@ -283,7 +283,7 @@ export struct RelatedList { } @Builder - SubTitleAndMore(subtitle: string) { + SubTitleAndMore(subtitle: ResourceStr) { Row() { Text(subtitle) .fontSize($r('app.float.sub_title_font')) @@ -311,7 +311,7 @@ export struct RelatedList { } @Builder - IntroductionContent(content: string) { + IntroductionContent(content: ResourceStr) { Text(content) .fontSize($r('app.float.introduction_content_font')) .lineHeight($r('app.float.introduction_content_line')) diff --git a/features/videoDetail/src/main/ets/viewmodel/RelatedVideoViewModel.ets b/features/videoDetail/src/main/ets/viewmodel/RelatedVideoViewModel.ets index 95d729a..7e24db2 100644 --- a/features/videoDetail/src/main/ets/viewmodel/RelatedVideoViewModel.ets +++ b/features/videoDetail/src/main/ets/viewmodel/RelatedVideoViewModel.ets @@ -59,19 +59,19 @@ export class RelatedVideo { /** * Name of the related video. */ - private name: string; + private name: ResourceStr; /** * Image src of related video. */ private imageSrc: Resource; - constructor(name: string, imageSrc: Resource) { + constructor(name: ResourceStr, imageSrc: Resource) { this.name = name; this.imageSrc = imageSrc; } - public getName(): string { + public getName(): ResourceStr { return this.name; } diff --git a/features/videoDetail/src/main/ets/viewmodel/UserViewModel.ets b/features/videoDetail/src/main/ets/viewmodel/UserViewModel.ets index 8215b5b..f75dceb 100644 --- a/features/videoDetail/src/main/ets/viewmodel/UserViewModel.ets +++ b/features/videoDetail/src/main/ets/viewmodel/UserViewModel.ets @@ -50,7 +50,7 @@ export class UserInfo { /** * Comment of user. */ - private comment: string; + private comment: ResourceStr; /** * Image src of the comment. @@ -60,9 +60,9 @@ export class UserInfo { /** * Time of the comment. */ - private time: string; + private time: ResourceStr; - constructor(name: string, imageSrc: Resource, comment: string, commentImageSrc: Resource | undefined, time: string) { + constructor(name: string, imageSrc: Resource, comment: ResourceStr, commentImageSrc: Resource | undefined, time: ResourceStr) { this.name = name; this.imageSrc = imageSrc; this.comment = comment; @@ -78,7 +78,7 @@ export class UserInfo { return this.imageSrc; } - public getComment(): string { + public getComment(): ResourceStr { return this.comment; } @@ -86,7 +86,7 @@ export class UserInfo { return this.commentImageSrc; } - public getTime(): string { + public getTime(): ResourceStr { return this.time; } } \ No newline at end of file diff --git a/features/videoDetail/src/main/resources/base/element/string.json b/features/videoDetail/src/main/resources/base/element/string.json new file mode 100644 index 0000000..cd5bc50 --- /dev/null +++ b/features/videoDetail/src/main/resources/base/element/string.json @@ -0,0 +1,60 @@ +{ + "string": [ + { + "name": "comments", + "value": "全部评论" + }, + { + "name": "related", + "value": "相关列表" + }, + { + "name": "more", + "value": "更多" + }, + { + "name": "introduction", + "value": "视频简介" + }, + { + "name": "anthology", + "value": "选集" + }, + { + "name": "Peripheral", + "value": "周边视频" + }, + { + "name": "product", + "value": "北京时间3月23日,华为春季旗舰新品发布会,我们不见不散。" + }, + { + "name": "play", + "value": "23.4万次播放··华为终端·华为资讯·2023·中国大陆" + }, + { + "name": "released", + "value": "Matebook系列新" + }, + { + "name": "series", + "value": "HUAWEI P60 系列发布" + }, + { + "name": "feel", + "value": "感觉很不错啊,下一款准备入手Mate X3了,很喜欢折叠屏的分屏功能,终于可以一边聊天一边看短视频了!" + }, + { + "name": "love", + "value": "好喜欢这张图,很惊艳!!!竟然是手机拍出来的,太给力了!', '这个背面真的很有设计感,珠光贝母,种草了种草了" + }, + { + "name": "July", + "value": "7月27日" + }, + { + "name": "comment", + "value": "评论..." + } + ] +} \ No newline at end of file diff --git a/features/videoDetail/src/main/resources/en_US/element/string.json b/features/videoDetail/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000..e4f56b0 --- /dev/null +++ b/features/videoDetail/src/main/resources/en_US/element/string.json @@ -0,0 +1,60 @@ +{ + "string": [ + { + "name": "comments", + "value": "All comments" + }, + { + "name": "related", + "value": "Related list" + }, + { + "name": "more", + "value": "more" + }, + { + "name": "introduction", + "value": "Video introduction" + }, + { + "name": "anthology", + "value": "anthology" + }, + { + "name": "Peripheral", + "value": "Peripheral video" + }, + { + "name": "product", + "value": "On March 23, Beijing time, Huawei's spring flagship new product conference, we will see each other." + }, + { + "name": "play", + "value": "234,000 plays··Huawei terminal·Huawei Information·2023·Chinese mainland" + }, + { + "name": "released", + "value": "New to the Matebook series" + }, + { + "name": "series", + "value": "HUAWEI P60 series released" + }, + { + "name": "feel", + "value": "Feel very good ah, the next ready to start Mate X3, like the folding screen split screen function, finally can chat while watching short videos!" + }, + { + "name": "love", + "value": "Love this picture, it's amazing!! It was taken by a mobile phone. Great! 'This back is really designed, pearl fritillary, planted grass." + }, + { + "name": "July", + "value": "The 27th of July" + }, + { + "name": "comment", + "value": "comment..." + } + ] +} \ No newline at end of file diff --git a/features/videoDetail/src/main/resources/zh_CN/element/string.json b/features/videoDetail/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000..cd5bc50 --- /dev/null +++ b/features/videoDetail/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,60 @@ +{ + "string": [ + { + "name": "comments", + "value": "全部评论" + }, + { + "name": "related", + "value": "相关列表" + }, + { + "name": "more", + "value": "更多" + }, + { + "name": "introduction", + "value": "视频简介" + }, + { + "name": "anthology", + "value": "选集" + }, + { + "name": "Peripheral", + "value": "周边视频" + }, + { + "name": "product", + "value": "北京时间3月23日,华为春季旗舰新品发布会,我们不见不散。" + }, + { + "name": "play", + "value": "23.4万次播放··华为终端·华为资讯·2023·中国大陆" + }, + { + "name": "released", + "value": "Matebook系列新" + }, + { + "name": "series", + "value": "HUAWEI P60 系列发布" + }, + { + "name": "feel", + "value": "感觉很不错啊,下一款准备入手Mate X3了,很喜欢折叠屏的分屏功能,终于可以一边聊天一边看短视频了!" + }, + { + "name": "love", + "value": "好喜欢这张图,很惊艳!!!竟然是手机拍出来的,太给力了!', '这个背面真的很有设计感,珠光贝母,种草了种草了" + }, + { + "name": "July", + "value": "7月27日" + }, + { + "name": "comment", + "value": "评论..." + } + ] +} \ No newline at end of file diff --git a/features/videoPlayer/src/main/ets/constants/PlayerConstants.ets b/features/videoPlayer/src/main/ets/constants/PlayerConstants.ets index 5b2ab0a..2ac2e1a 100644 --- a/features/videoPlayer/src/main/ets/constants/PlayerConstants.ets +++ b/features/videoPlayer/src/main/ets/constants/PlayerConstants.ets @@ -28,7 +28,7 @@ export class PlayerConstants { /** * Player text list. */ - static readonly PLAYER_TEXT_LIST: string[] = ['选集', '只看TA', '超清', '倍速']; + static readonly PLAYER_TEXT_LIST: ResourceStr[] = [$r('app.string.selections'), $r('app.string.just'), $r('app.string.super'), $r('app.string.speed')]; /** * X component id. diff --git a/features/videoPlayer/src/main/ets/view/SideEpisodes.ets b/features/videoPlayer/src/main/ets/view/SideEpisodes.ets index 126debd..15d0fdf 100644 --- a/features/videoPlayer/src/main/ets/view/SideEpisodes.ets +++ b/features/videoPlayer/src/main/ets/view/SideEpisodes.ets @@ -96,7 +96,7 @@ export struct SideEpisodes { @Component struct SideTitleText { - private content: string = ''; + private content: ResourceStr = ''; build() { Text(this.content) diff --git a/features/videoPlayer/src/main/ets/view/VideoPlayer.ets b/features/videoPlayer/src/main/ets/view/VideoPlayer.ets index da093ca..a00e41a 100644 --- a/features/videoPlayer/src/main/ets/view/VideoPlayer.ets +++ b/features/videoPlayer/src/main/ets/view/VideoPlayer.ets @@ -265,7 +265,7 @@ struct ImgIcon { @Component struct TextButton { - private content: string = ''; + private content: ResourceStr = ''; build() { Text(this.content) diff --git a/features/videoPlayer/src/main/resources/base/element/string.json b/features/videoPlayer/src/main/resources/base/element/string.json new file mode 100644 index 0000000..e876602 --- /dev/null +++ b/features/videoPlayer/src/main/resources/base/element/string.json @@ -0,0 +1,20 @@ +{ + "string": [ + { + "name": "selections", + "value": "选集" + }, + { + "name": "just", + "value": "只看TA" + }, + { + "name": "super", + "value": "超清" + }, + { + "name": "speed", + "value": "超清" + } + ] +} \ No newline at end of file diff --git a/features/videoPlayer/src/main/resources/en_US/element/string.json b/features/videoPlayer/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000..faa5917 --- /dev/null +++ b/features/videoPlayer/src/main/resources/en_US/element/string.json @@ -0,0 +1,20 @@ +{ + "string": [ + { + "name": "selections", + "value": "select" + }, + { + "name": "just", + "value": "look it" + }, + { + "name": "super", + "value": "super" + }, + { + "name": "speed", + "value": "speed" + } + ] +} \ No newline at end of file diff --git a/features/videoPlayer/src/main/resources/zh_CN/element/string.json b/features/videoPlayer/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000..e876602 --- /dev/null +++ b/features/videoPlayer/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,20 @@ +{ + "string": [ + { + "name": "selections", + "value": "选集" + }, + { + "name": "just", + "value": "只看TA" + }, + { + "name": "super", + "value": "超清" + }, + { + "name": "speed", + "value": "超清" + } + ] +} \ No newline at end of file -- Gitee From ffc2e0a8bfd8cfcbae9bd0d8970c60cfe0017f71 Mon Sep 17 00:00:00 2001 From: caoliwen1 <14658249+caoliwen1@user.noreply.gitee.com> Date: Mon, 23 Sep 2024 11:00:03 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/ets/view/RecommendedVideo.ets | 2 +- .../main/ets/constants/SearchConstants.ets | 22 +++++----- .../ets/viewmodel/SearchVideoImgViewModel.ets | 6 +-- .../main/resources/base/element/string.json | 40 +++++++++++++++++++ .../main/resources/en_US/element/string.json | 40 +++++++++++++++++++ .../main/resources/zh_CN/element/string.json | 40 +++++++++++++++++++ 6 files changed, 135 insertions(+), 15 deletions(-) diff --git a/features/home/src/main/ets/view/RecommendedVideo.ets b/features/home/src/main/ets/view/RecommendedVideo.ets index 2c0b0ea..ddafca0 100644 --- a/features/home/src/main/ets/view/RecommendedVideo.ets +++ b/features/home/src/main/ets/view/RecommendedVideo.ets @@ -97,7 +97,7 @@ export struct RecommendedVideo { return; } // Obtains all attributes of a component. - let obj: Record = JSON.parse(getRectangleById(JSON.stringify(item))); + let obj: Record = JSON.parse(getInspectorByKey(JSON.stringify(item))); let rectInfo: string[] = JSON.parse(HomeConstants.SQUARE_BRACKETS[0] + obj.$rect + HomeConstants.SQUARE_BRACKETS[1]); // Obtains the height of the component from the top. diff --git a/features/search/src/main/ets/constants/SearchConstants.ets b/features/search/src/main/ets/constants/SearchConstants.ets index 3294e14..61f952e 100644 --- a/features/search/src/main/ets/constants/SearchConstants.ets +++ b/features/search/src/main/ets/constants/SearchConstants.ets @@ -31,12 +31,12 @@ export class SearchConstants { * Search List for hua. */ static readonly HUA_LIST: ResourceStr[] = - ['华为游戏', $r('app.string.tv'), '华为开发者大会2023cloud主题演讲...', '华为发布会', - '华为发布会Harmonyos4', '华为会员电影专区']; + [ $r('app.string.tv'), $r('app.string.tv'), $r('app.string.tv'), $r('app.string.conference'), + $r('app.string.tv'), $r('app.string.tv')]; /** * Search result tab List. */ - static readonly SEARCH_RESULT_TAB_LIST: string[] = ['全部', '影视', '短视频', '用户']; + static readonly SEARCH_RESULT_TAB_LIST: ResourceStr[] = [$r('app.string.all'), $r('app.string.filmer'), $r('app.string.video'), $r('app.string.user')]; /** * Search video img title list. */ @@ -57,17 +57,17 @@ export class SearchConstants { /** * Search result title list. */ - static readonly SEARCH_RESULT_TITLES: string[] = ['华为折叠屏旗舰及全场景新品发布会', '华为旗舰新品发布会', - '2022华为全屋智能及全场景新品春季...']; + static readonly SEARCH_RESULT_TITLES: ResourceStr[] = [$r('app.string.flagship'), $r('app.string.flagship'), + $r('app.string.flagship')]; /** * Search result content list. */ - static readonly SEARCH_RESULT_CONTENTS: string[] = ['发布会 · 华为终端 · 202...', '发布会 · 华为终端 · 202...', - '2022华为全屋智能及全场景新品春季...']; + static readonly SEARCH_RESULT_CONTENTS: ResourceStr[] = [$r('app.string.press'), $r('app.string.press'), + $r('app.string.press')]; /** * Search result more info list. */ - static readonly SEARCH_RESULT_MORE: string[] = ['9.8万次播放', '75.2万次播放', '10.1万次播放']; + static readonly SEARCH_RESULT_MORE: ResourceStr[] = [$r('app.string.plays'), $r('app.string.plays'), $r('app.string.plays')]; /** * Search sub title list. */ @@ -99,11 +99,11 @@ export class SearchConstants { /** * Search result title. */ - static readonly SEARCH_RESULT_TITLE: string = '华为发布会'; + static readonly SEARCH_RESULT_TITLE: ResourceStr = $r('app.string.conference'); /** * Search result button text list. */ - static readonly SEARCH_RESULT_BUTTON_TEXTS: string[] = ['播放', '缓存']; + static readonly SEARCH_RESULT_BUTTON_TEXTS: ResourceStr[] = [$r('app.string.player'), $r('app.string.cache')]; /** * Video detail url. */ @@ -111,7 +111,7 @@ export class SearchConstants { /** * Search input list. */ - static readonly SEARCH_INPUT_LIST: string[] = ['华', '华为发布会']; + static readonly SEARCH_INPUT_LIST: ResourceStr[] = ['华', '华为发布会']; /** * Hot video divider stroke width. */ diff --git a/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets b/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets index ca0a819..028f095 100644 --- a/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets +++ b/features/search/src/main/ets/viewmodel/SearchVideoImgViewModel.ets @@ -90,9 +90,9 @@ export class SearchVideoImg { /** * Other information of the video. */ - private otherInfo: string; + private otherInfo: ResourceStr; - constructor(imgSrc: Resource, title: ResourceStr, content: ResourceStr, otherInfo: string) { + constructor(imgSrc: Resource, title: ResourceStr, content: ResourceStr, otherInfo: ResourceStr) { this.imgSrc = imgSrc; this.title = title; this.content = content; @@ -111,7 +111,7 @@ export class SearchVideoImg { return this.content; } - getOtherInfo(): string { + getOtherInfo(): ResourceStr { return this.otherInfo; } } \ No newline at end of file diff --git a/features/search/src/main/resources/base/element/string.json b/features/search/src/main/resources/base/element/string.json index 8feefe0..5a8df8b 100644 --- a/features/search/src/main/resources/base/element/string.json +++ b/features/search/src/main/resources/base/element/string.json @@ -59,6 +59,46 @@ { "name": "search1", "value": "搜索..." + }, + { + "name": "conference", + "value": "华为发布会" + }, + { + "name": "all", + "value": "All" + }, + { + "name": "filmer", + "value": "影视" + }, + { + "name": "video", + "value": "短视频" + }, + { + "name": "user", + "value": "用户" + }, + { + "name": "flagship", + "value": "华为旗舰新品发布会" + }, + { + "name": "press", + "value": "发布会 · 华为终端 · 202..." + }, + { + "name": "plays", + "value": "9.8万次播放" + }, + { + "name": "player", + "value": "播放" + }, + { + "name": "cache", + "value": "缓存" } ] } \ No newline at end of file diff --git a/features/search/src/main/resources/en_US/element/string.json b/features/search/src/main/resources/en_US/element/string.json index c8f2853..557986b 100644 --- a/features/search/src/main/resources/en_US/element/string.json +++ b/features/search/src/main/resources/en_US/element/string.json @@ -59,6 +59,46 @@ { "name": "search1", "value": "Search..." + }, + { + "name": "conference", + "value": "Huawei Conference" + }, + { + "name": "all", + "value": "all" + }, + { + "name": "filmer", + "value": "film" + }, + { + "name": "video", + "value": "video" + }, + { + "name": "user", + "value": "user" + }, + { + "name": "flagship", + "value": "Huawei's flagship product launch event" + }, + { + "name": "press", + "value": "Conference · Huawei Terminal · 202..." + }, + { + "name": "plays", + "value": "98,000 plays" + }, + { + "name": "player", + "value": "play" + }, + { + "name": "cache", + "value": "cache" } ] } \ No newline at end of file diff --git a/features/search/src/main/resources/zh_CN/element/string.json b/features/search/src/main/resources/zh_CN/element/string.json index 8feefe0..5a8df8b 100644 --- a/features/search/src/main/resources/zh_CN/element/string.json +++ b/features/search/src/main/resources/zh_CN/element/string.json @@ -59,6 +59,46 @@ { "name": "search1", "value": "搜索..." + }, + { + "name": "conference", + "value": "华为发布会" + }, + { + "name": "all", + "value": "All" + }, + { + "name": "filmer", + "value": "影视" + }, + { + "name": "video", + "value": "短视频" + }, + { + "name": "user", + "value": "用户" + }, + { + "name": "flagship", + "value": "华为旗舰新品发布会" + }, + { + "name": "press", + "value": "发布会 · 华为终端 · 202..." + }, + { + "name": "plays", + "value": "9.8万次播放" + }, + { + "name": "player", + "value": "播放" + }, + { + "name": "cache", + "value": "缓存" } ] } \ No newline at end of file -- Gitee From c68b9d3a9042f059fe3ede6df23cafc7232dbc1a Mon Sep 17 00:00:00 2001 From: caoliwen1 <14658249+caoliwen1@user.noreply.gitee.com> Date: Mon, 23 Sep 2024 21:10:35 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E9=95=BF=E6=8C=89=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/src/main/ets/constants/HomeConstants.ets | 2 +- features/home/src/main/ets/view/VideoDialog.ets | 2 +- .../home/src/main/resources/base/element/string.json | 12 ++++++++++++ .../src/main/resources/en_US/element/string.json | 12 ++++++++++++ .../src/main/resources/zh_CN/element/string.json | 12 ++++++++++++ .../src/main/resources/zh_CN/element/string.json | 2 +- 6 files changed, 39 insertions(+), 3 deletions(-) diff --git a/features/home/src/main/ets/constants/HomeConstants.ets b/features/home/src/main/ets/constants/HomeConstants.ets index 27b597d..85a3fda 100644 --- a/features/home/src/main/ets/constants/HomeConstants.ets +++ b/features/home/src/main/ets/constants/HomeConstants.ets @@ -181,7 +181,7 @@ export class HomeConstants { /** * Video dialog option list. */ - static readonly VIDEO_DIALOG_OPTIONS: string[] = ['追剧', '收藏', '点赞']; + static readonly VIDEO_DIALOG_OPTIONS: ResourceStr[] = [$r('app.string.binge_watch'), $r('app.string.Collect'), $r('app.string.like')]; /** * Side bar icon list height. */ diff --git a/features/home/src/main/ets/view/VideoDialog.ets b/features/home/src/main/ets/view/VideoDialog.ets index 88997a3..406f052 100644 --- a/features/home/src/main/ets/view/VideoDialog.ets +++ b/features/home/src/main/ets/view/VideoDialog.ets @@ -21,7 +21,7 @@ import { AvPlayerUtil, BreakpointConstants, CommonConstants } from '@ohos/common import { BreakpointType, Logger } from '@ohos/commons'; import { HomeConstants } from '../constants/HomeConstants'; -@Builder function MenuItemFunction(img: Resource, text: string) { +@Builder function MenuItemFunction(img: Resource, text: ResourceStr) { Row() { Image(img) .width($r('app.float.dialog_icon_size')) diff --git a/features/home/src/main/resources/base/element/string.json b/features/home/src/main/resources/base/element/string.json index 19051de..2f8ec58 100644 --- a/features/home/src/main/resources/base/element/string.json +++ b/features/home/src/main/resources/base/element/string.json @@ -163,6 +163,18 @@ { "name": "search", "value": "搜索..." + }, + { + "name": "binge_watch", + "value": "追剧" + }, + { + "name": "Collect", + "value": "Collect" + }, + { + "name": "like", + "value": "点赞" } ] } \ No newline at end of file diff --git a/features/home/src/main/resources/en_US/element/string.json b/features/home/src/main/resources/en_US/element/string.json index bd8df22..7b83743 100644 --- a/features/home/src/main/resources/en_US/element/string.json +++ b/features/home/src/main/resources/en_US/element/string.json @@ -163,6 +163,18 @@ { "name": "search", "value": "Search..." + }, + { + "name": "binge_watch", + "value": "Watch" + }, + { + "name": "Collect", + "value": "Collect" + }, + { + "name": "like", + "value": "Like" } ] } \ No newline at end of file diff --git a/features/home/src/main/resources/zh_CN/element/string.json b/features/home/src/main/resources/zh_CN/element/string.json index 0754316..331169b 100644 --- a/features/home/src/main/resources/zh_CN/element/string.json +++ b/features/home/src/main/resources/zh_CN/element/string.json @@ -162,6 +162,18 @@ { "name": "search", "value": "搜索..." + }, + { + "name": "binge_watch", + "value": "追剧" + }, + { + "name": "Collect", + "value": "收藏" + }, + { + "name": "like", + "value": "点赞" } ] } \ No newline at end of file diff --git a/features/videoPlayer/src/main/resources/zh_CN/element/string.json b/features/videoPlayer/src/main/resources/zh_CN/element/string.json index e876602..3806117 100644 --- a/features/videoPlayer/src/main/resources/zh_CN/element/string.json +++ b/features/videoPlayer/src/main/resources/zh_CN/element/string.json @@ -14,7 +14,7 @@ }, { "name": "speed", - "value": "超清" + "value": "倍速" } ] } \ No newline at end of file -- Gitee