From dbb167a38b61dde05fa904d74079c6b70e3a2c01 Mon Sep 17 00:00:00 2001 From: dhf <1511447814@qq.com> Date: Mon, 3 Nov 2025 14:02:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=BE=8E=E5=8C=96=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E9=80=82=E9=85=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/constants/AlbumViewConstants.ets | 10 ++- .../main/resources/base/element/string.json | 59 ++++++++++++++++ .../main/resources/en_US/element/string.json | 67 +++++++++++++++++++ .../main/resources/zh_CN/element/string.json | 67 +++++++++++++++++++ .../ets/constants/PictureEditConstants.ets | 26 +++---- .../main/ets/viewmodel/AdaptiveViewModel.ets | 4 +- .../main/resources/base/element/string.json | 56 ++++++++++++++++ .../main/resources/en_US/element/string.json | 64 ++++++++++++++++++ .../main/resources/zh_CN/element/string.json | 64 ++++++++++++++++++ .../ets/constants/PictureViewConstants.ets | 14 ++-- .../src/main/ets/view/BottomBar.ets | 6 +- .../pictureView/src/main/ets/view/TopBar.ets | 9 +-- .../main/resources/base/element/string.json | 20 ++++++ .../main/resources/en_US/element/string.json | 28 ++++++++ .../main/resources/zh_CN/element/string.json | 28 ++++++++ .../main/resources/base/element/string.json | 2 +- .../main/resources/en_US/element/string.json | 2 +- 17 files changed, 494 insertions(+), 32 deletions(-) create mode 100644 features/albumView/src/main/resources/en_US/element/string.json create mode 100644 features/albumView/src/main/resources/zh_CN/element/string.json create mode 100644 features/pictureEdit/src/main/resources/en_US/element/string.json create mode 100644 features/pictureEdit/src/main/resources/zh_CN/element/string.json create mode 100644 features/pictureView/src/main/resources/en_US/element/string.json create mode 100644 features/pictureView/src/main/resources/zh_CN/element/string.json diff --git a/features/albumView/src/main/ets/constants/AlbumViewConstants.ets b/features/albumView/src/main/ets/constants/AlbumViewConstants.ets index c07a687..913bb33 100755 --- a/features/albumView/src/main/ets/constants/AlbumViewConstants.ets +++ b/features/albumView/src/main/ets/constants/AlbumViewConstants.ets @@ -72,9 +72,15 @@ export class AlbumViewConstants { /** * Default text. */ - static DES_TEXT = '图片'; + static DES_TEXT = $r('app.string.picture'); /** * Side constants. */ - static SideConstants: string[] = [' 照片、人物、地点...', '相册', '图片', '我的收藏', '12', '视频', '新建相册1', '新建相册1', '人像', '地点', '上海市', '北京市', '南京市', '分类']; + static SideConstants: ResourceStr[] = + [$r('app.string.sideConstants1'), $r('app.string.sideConstants2'), $r('app.string.sideConstants3'), + $r('app.string.sideConstants4'), + $r('app.string.sideConstants5'), $r('app.string.sideConstants6'), $r('app.string.sideConstants7'), + $r('app.string.sideConstants8'), $r('app.string.sideConstants9'), $r('app.string.sideConstants10'), + $r('app.string.sideConstants11'), $r('app.string.sideConstants12'), $r('app.string.sideConstants13'), + $r('app.string.sideConstants14')]; } \ No newline at end of file diff --git a/features/albumView/src/main/resources/base/element/string.json b/features/albumView/src/main/resources/base/element/string.json index 95ba6cb..902950d 100755 --- a/features/albumView/src/main/resources/base/element/string.json +++ b/features/albumView/src/main/resources/base/element/string.json @@ -3,6 +3,65 @@ { "name": "shared_desc", "value": "description" + }, + { + "name": "picture", + "value": "picture" + }, + { + "name": "sideConstants1", + "value": " Pics、Pers.、Loc..." + }, + { + "name": "sideConstants2", + "value": "Album" + }, + { + "name": "sideConstants3", + "value": "picture" + }, + { + "name": "sideConstants4", + "value": "Favorites" + }, + { + "name": "sideConstants5", + "value": "12" + }, + { + "name": "sideConstants6", + "value": "Viedo" + }, + { + "name": "sideConstants7", + "value": "New Album 1" + }, + { + "name": "sideConstants8", + "value": "New Album 2" + }, + { + "name": "sideConstants9", + "value": "Portrait" + }, + { + "name": "sideConstants10", + "value": "Places" + }, { + "name": "sideConstants11", + "value": "Shanghai" + }, + { + "name": "sideConstants12", + "value": "Beijing" + }, + { + "name": "sideConstants13", + "value": "Nanjing" + }, + { + "name": "sideConstants14", + "value": "classify" } ] } \ No newline at end of file diff --git a/features/albumView/src/main/resources/en_US/element/string.json b/features/albumView/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000..965047a --- /dev/null +++ b/features/albumView/src/main/resources/en_US/element/string.json @@ -0,0 +1,67 @@ +{ + "string": [ + { + "name": "shared_desc", + "value": "description" + }, + { + "name": "picture", + "value": "picture" + }, + { + "name": "sideConstants1", + "value": " Pics、Pers.、Loc..." + }, + { + "name": "sideConstants2", + "value": "Album" + }, + { + "name": "sideConstants3", + "value": "picture" + }, + { + "name": "sideConstants4", + "value": "Favorites" + }, + { + "name": "sideConstants5", + "value": "12" + }, + { + "name": "sideConstants6", + "value": "Viedo" + }, + { + "name": "sideConstants7", + "value": "New Album 1" + }, + { + "name": "sideConstants8", + "value": "New Album 2" + }, + { + "name": "sideConstants9", + "value": "Portrait" + }, + { + "name": "sideConstants10", + "value": "Places" + }, { + "name": "sideConstants11", + "value": "Shanghai" + }, + { + "name": "sideConstants12", + "value": "Beijing" + }, + { + "name": "sideConstants13", + "value": "Nanjing" + }, + { + "name": "sideConstants14", + "value": "classify" + } + ] +} \ No newline at end of file diff --git a/features/albumView/src/main/resources/zh_CN/element/string.json b/features/albumView/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000..d0b1a76 --- /dev/null +++ b/features/albumView/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,67 @@ +{ + "string": [ + { + "name": "shared_desc", + "value": "description" + }, + { + "name": "picture", + "value": "图片" + }, + { + "name": "sideConstants1", + "value": " 照片、人物、地点..." + }, + { + "name": "sideConstants2", + "value": "相册" + }, + { + "name": "sideConstants3", + "value": "图片" + }, + { + "name": "sideConstants4", + "value": "我的收藏" + }, + { + "name": "sideConstants5", + "value": "12" + }, + { + "name": "sideConstants6", + "value": "视频" + }, + { + "name": "sideConstants7", + "value": "新建相册1" + }, + { + "name": "sideConstants8", + "value": "新建相册2" + }, + { + "name": "sideConstants9", + "value": "人像" + }, + { + "name": "sideConstants10", + "value": "地点" + }, { + "name": "sideConstants11", + "value": "上海市" + }, + { + "name": "sideConstants12", + "value": "北京市" + }, + { + "name": "sideConstants13", + "value": "南京市" + }, + { + "name": "sideConstants14", + "value": "分类" + } + ] +} \ No newline at end of file diff --git a/features/pictureEdit/src/main/ets/constants/PictureEditConstants.ets b/features/pictureEdit/src/main/ets/constants/PictureEditConstants.ets index 9ead7a3..521bf6a 100755 --- a/features/pictureEdit/src/main/ets/constants/PictureEditConstants.ets +++ b/features/pictureEdit/src/main/ets/constants/PictureEditConstants.ets @@ -39,71 +39,71 @@ export default class PictureEditConstants { /** * Edit text. */ - static Edit_Text = '编辑'; + static Edit_Text = $r('app.string.edit'); /** * Tools name. */ static toolsAndName: ToolsAndName[] = [ { - pic: $r("app.media.tools_2"), pic_name: "截取" + pic: $r("app.media.tools_2"), pic_name: $r('app.string.ToolsAndName1') }, { - pic: $r("app.media.tools_1"), pic_name: "裁剪" + pic: $r("app.media.tools_1"), pic_name: $r('app.string.ToolsAndName2') }, { - pic: $r("app.media.tools_3"), pic_name: "调节" + pic: $r("app.media.tools_3"), pic_name: $r('app.string.ToolsAndName3') }, { - pic: $r("app.media.tools_4"), pic_name: "滤镜" + pic: $r("app.media.tools_4"), pic_name: $r('app.string.ToolsAndName4') }]; /** * Filter name. */ static filterAndName: PicAndName[] = [ { - pic: $r("app.media.photo"), pic_name: "原片", color_filter: [1, 0, 0, 0, 0, + pic: $r("app.media.photo"), pic_name: $r('app.string.PicAndName1'), color_filter: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] }, { - pic: $r("app.media.photo"), pic_name: "经典", color_filter: [1, 0, 0, 0, 0, + pic: $r("app.media.photo"), pic_name: $r('app.string.PicAndName2'), color_filter: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] }, { - pic: $r("app.media.photo"), pic_name: "晨光", color_filter: [1, 0, 0, 0, 0, + pic: $r("app.media.photo"), pic_name: $r('app.string.PicAndName3'), color_filter: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] }, { - pic: $r("app.media.photo"), pic_name: "黄昏", color_filter: [1, 0, 0, 0, 0, + pic: $r("app.media.photo"), pic_name: $r('app.string.PicAndName4'), color_filter: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] }, { - pic: $r("app.media.photo"), pic_name: "光晕", color_filter: [1, 0, 0, 0, 0, + pic: $r("app.media.photo"), pic_name: $r('app.string.PicAndName5'), color_filter: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] }, { - pic: $r("app.media.photo"), pic_name: "童年", color_filter: [1, 0, 0, 0, 0, + pic: $r("app.media.photo"), pic_name: $r('app.string.PicAndName6'), color_filter: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] }, { - pic: $r("app.media.photo"), pic_name: "怀旧", color_filter: [1, 0, 0, 0, 0, + pic: $r("app.media.photo"), pic_name: $r('app.string.PicAndName7'), color_filter: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0] }, { - pic: $r("app.media.photo"), pic_name: "老照片", color_filter: [1, 1, 0, 0, 0, + pic: $r("app.media.photo"), pic_name: $r('app.string.PicAndName8'), color_filter: [1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0] diff --git a/features/pictureEdit/src/main/ets/viewmodel/AdaptiveViewModel.ets b/features/pictureEdit/src/main/ets/viewmodel/AdaptiveViewModel.ets index db24500..bcb6a04 100755 --- a/features/pictureEdit/src/main/ets/viewmodel/AdaptiveViewModel.ets +++ b/features/pictureEdit/src/main/ets/viewmodel/AdaptiveViewModel.ets @@ -34,11 +34,11 @@ export class Adaptive { } export interface ToolsAndName { pic: Resource - pic_name: string + pic_name: ResourceStr } export interface PicAndName { pic: Resource - pic_name: string + pic_name: ResourceStr color_filter: number[] } \ No newline at end of file diff --git a/features/pictureEdit/src/main/resources/base/element/string.json b/features/pictureEdit/src/main/resources/base/element/string.json index 95ba6cb..cd68763 100755 --- a/features/pictureEdit/src/main/resources/base/element/string.json +++ b/features/pictureEdit/src/main/resources/base/element/string.json @@ -3,6 +3,62 @@ { "name": "shared_desc", "value": "description" + }, + { + "name": "edit", + "value": "Edit" + }, + { + "name": "ToolsAndName1", + "value": "capture" + }, + { + "name": "ToolsAndName2", + "value": "crop" + }, + { + "name": "ToolsAndName3", + "value": "adjust" + }, + { + "name": "ToolsAndName4", + "value": "filter" + }, + { + "name": "PicAndName1", + "value": "original" + }, + { + "name": "PicAndName2", + "value": "classic" + }, + { + "name": "PicAndName3", + "value": "AM Light" + }, + { + "name": "PicAndName4", + "value": "dusk" + }, + { + "name": "PicAndName5", + "value": "halo" + }, + { + "name": "PicAndName6", + "value": "childhood" + }, + { + "name": "PicAndName7", + "value": "nostalgic" + }, + { + "name": "PicAndName8", + "value": "vintage" + }, + { + "name": "subtitle_infomation", + "value": "4:00 PM, Hohhot" } ] } \ No newline at end of file diff --git a/features/pictureEdit/src/main/resources/en_US/element/string.json b/features/pictureEdit/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000..ba17f69 --- /dev/null +++ b/features/pictureEdit/src/main/resources/en_US/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "shared_desc", + "value": "description" + }, + { + "name": "edit", + "value": "Edit" + }, + { + "name": "ToolsAndName1", + "value": "capture" + }, + { + "name": "ToolsAndName2", + "value": "crop" + }, + { + "name": "ToolsAndName3", + "value": "adjust" + }, + { + "name": "ToolsAndName4", + "value": "filter" + }, + { + "name": "PicAndName1", + "value": "original" + }, + { + "name": "PicAndName2", + "value": "classic" + }, + { + "name": "PicAndName3", + "value": "AM Light" + }, + { + "name": "PicAndName4", + "value": "dusk" + }, + { + "name": "PicAndName5", + "value": "halo" + }, + { + "name": "PicAndName6", + "value": "childhood" + }, + { + "name": "PicAndName7", + "value": "nostalgic" + }, + { + "name": "PicAndName8", + "value": "vintage" + }, + { + "name": "subtitle_infomation", + "value": "4:00 PM, Hohhot" + } + ] +} \ No newline at end of file diff --git a/features/pictureEdit/src/main/resources/zh_CN/element/string.json b/features/pictureEdit/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000..9015001 --- /dev/null +++ b/features/pictureEdit/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "shared_desc", + "value": "description" + }, + { + "name": "edit", + "value": "编辑" + }, + { + "name": "ToolsAndName1", + "value": "截取" + }, + { + "name": "ToolsAndName2", + "value": "裁剪" + }, + { + "name": "ToolsAndName3", + "value": "调节" + }, + { + "name": "ToolsAndName4", + "value": "滤镜" + }, + { + "name": "PicAndName1", + "value": "原片" + }, + { + "name": "PicAndName2", + "value": "经典" + }, + { + "name": "PicAndName3", + "value": "晨光" + }, + { + "name": "PicAndName4", + "value": "黄昏" + }, + { + "name": "PicAndName5", + "value": "光晕" + }, + { + "name": "PicAndName6", + "value": "童年" + }, + { + "name": "PicAndName7", + "value": "怀旧" + }, + { + "name": "PicAndName8", + "value": "老照片" + }, + { + "name": "subtitle_infomation", + "value": "下午04:00 呼和浩特市" + } + ] +} \ No newline at end of file diff --git a/features/pictureView/src/main/ets/constants/PictureViewConstants.ets b/features/pictureView/src/main/ets/constants/PictureViewConstants.ets index a2d4343..a931ea0 100755 --- a/features/pictureView/src/main/ets/constants/PictureViewConstants.ets +++ b/features/pictureView/src/main/ets/constants/PictureViewConstants.ets @@ -15,7 +15,7 @@ export interface ActionInterface { icon: Resource - icon_name: string + icon_name: ResourceStr } export default class PictureViewConstants { @@ -32,25 +32,25 @@ export default class PictureViewConstants { /** * Edit icon name. */ - static readonly EDIT_ICON_NAME: string = '编辑'; + static readonly EDIT_ICON_NAME: ResourceStr = $r('app.string.ActionInterface3'); /** * Actions. */ static ACTIONS: ActionInterface[] = [ { - icon: $r('app.media.ic_public_share'), icon_name: "分享" + icon: $r('app.media.ic_public_share'), icon_name: $r('app.string.ActionInterface1') }, { - icon: $r('app.media.ic_public_favor'), icon_name: "收藏" + icon: $r('app.media.ic_public_favor'), icon_name: $r('app.string.ActionInterface2') }, { - icon: $r("app.media.ic_gallery_public_details_4"), icon_name: "编辑" + icon: $r("app.media.ic_gallery_public_details_4"), icon_name: $r('app.string.ActionInterface3') }, { - icon: $r("app.media.ic_gallery_public_details_5"), icon_name: "删除" + icon: $r("app.media.ic_gallery_public_details_5"), icon_name: $r('app.string.ActionInterface4') }, { - icon: $r('app.media.ic_public_more'), icon_name: "更多" + icon: $r('app.media.ic_public_more'), icon_name: $r('app.string.ActionInterface5') } ]; /** diff --git a/features/pictureView/src/main/ets/view/BottomBar.ets b/features/pictureView/src/main/ets/view/BottomBar.ets index f1e7b3f..24723a5 100755 --- a/features/pictureView/src/main/ets/view/BottomBar.ets +++ b/features/pictureView/src/main/ets/view/BottomBar.ets @@ -38,12 +38,14 @@ export struct BottomBar { .padding({ top: $r('app.float.icon_padding_top') }) } .onClick(() => { - if (item.icon_name === PictureViewConstants.EDIT_ICON_NAME) { + let pushPath = + this.getUIContext().getHostContext()?.resourceManager.getStringSync(item.icon_name as Resource) as string; + if (pushPath === '编辑' || pushPath === 'edit') { this.pageInfos.pushPath(new NavPathInfo('pictureEdit', [])); } }) .width(PictureViewConstants.ICON_LIST_WIDTH) - },(item: ActionInterface, index: number) => index + JSON.stringify(item)) + }, (item: ActionInterface, index: number) => index + JSON.stringify(item)) } .height($r('app.float.icon_list_height')) } diff --git a/features/pictureView/src/main/ets/view/TopBar.ets b/features/pictureView/src/main/ets/view/TopBar.ets index 3588b29..2af1d70 100755 --- a/features/pictureView/src/main/ets/view/TopBar.ets +++ b/features/pictureView/src/main/ets/view/TopBar.ets @@ -16,8 +16,7 @@ import { BaseConstants, BreakpointConstants } from '@ohos/commons'; import PictureViewConstants, { ActionInterface } from '../constants/PictureViewConstants'; -const TITLE: string = '2020年12月24日'; -const SUBTITLE: string = '下午04:00 呼和浩特市'; +const TITLE: string = '2020.12.24'; @Preview @Component @@ -46,7 +45,7 @@ export struct TopBar { .fontFamily(BaseConstants.FONT_FAMILY_MEDIUM) .fontSize(BaseConstants.FONT_SIZE_TWENTY) .fontWeight(BaseConstants.FONT_WEIGHT_FIVE) - Text(SUBTITLE) + Text($r('app.string.subtitle_infomation')) .fontFamily(BaseConstants.FONT_FAMILY_NORMAL) .fontSize(BaseConstants.FONT_SIZE_FOURTEEN) .fontWeight(BaseConstants.FONT_WEIGHT_FOUR) @@ -74,7 +73,9 @@ export struct TopBar { .width(BaseConstants.DEFAULT_ICON_SIZE) .margin({ left: $r('app.float.detail_image_left') }) .onClick(() => { - if (item.icon_name === PictureViewConstants.EDIT_ICON_NAME) { + let pushPath = this.getUIContext() + .getHostContext()?.resourceManager.getStringSync(item.icon_name as Resource) as string; + if (pushPath === '编辑' || pushPath === 'edit') { this.pageInfos.pushPath(new NavPathInfo('pictureEdit', [])); } }) diff --git a/features/pictureView/src/main/resources/base/element/string.json b/features/pictureView/src/main/resources/base/element/string.json index 95ba6cb..bd9e368 100755 --- a/features/pictureView/src/main/resources/base/element/string.json +++ b/features/pictureView/src/main/resources/base/element/string.json @@ -3,6 +3,26 @@ { "name": "shared_desc", "value": "description" + }, + { + "name": "ActionInterface1", + "value": "share" + }, + { + "name": "ActionInterface2", + "value": "save" + }, + { + "name": "ActionInterface3", + "value": "edit" + }, + { + "name": "ActionInterface4", + "value": "delete" + }, + { + "name": "ActionInterface5", + "value": "more" } ] } \ No newline at end of file diff --git a/features/pictureView/src/main/resources/en_US/element/string.json b/features/pictureView/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000..e7f7d70 --- /dev/null +++ b/features/pictureView/src/main/resources/en_US/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "shared_desc", + "value": "description" + }, + { + "name": "ActionInterface1", + "value": "share" + }, + { + "name": "ActionInterface2", + "value": "save" + }, + { + "name": "ActionInterface3", + "value": "edit" + }, + { + "name": "ActionInterface4", + "value": "delete" + }, + { + "name": "ActionInterface5", + "value": "more" + } + ] +} \ No newline at end of file diff --git a/features/pictureView/src/main/resources/zh_CN/element/string.json b/features/pictureView/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000..4270186 --- /dev/null +++ b/features/pictureView/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,28 @@ +{ + "string": [ + { + "name": "shared_desc", + "value": "description" + }, + { + "name": "ActionInterface1", + "value": "分享" + }, + { + "name": "ActionInterface2", + "value": "收藏" + }, + { + "name": "ActionInterface3", + "value": "编辑" + }, + { + "name": "ActionInterface4", + "value": "删除" + }, + { + "name": "ActionInterface5", + "value": "更多" + } + ] +} \ No newline at end of file diff --git a/product/phone/src/main/resources/base/element/string.json b/product/phone/src/main/resources/base/element/string.json index f60d1b9..d1855b9 100755 --- a/product/phone/src/main/resources/base/element/string.json +++ b/product/phone/src/main/resources/base/element/string.json @@ -10,7 +10,7 @@ }, { "name": "PhoneAbility_label", - "value": "label" + "value": "MultiPictureBeautification" } ] } \ No newline at end of file diff --git a/product/phone/src/main/resources/en_US/element/string.json b/product/phone/src/main/resources/en_US/element/string.json index f60d1b9..d1855b9 100755 --- a/product/phone/src/main/resources/en_US/element/string.json +++ b/product/phone/src/main/resources/en_US/element/string.json @@ -10,7 +10,7 @@ }, { "name": "PhoneAbility_label", - "value": "label" + "value": "MultiPictureBeautification" } ] } \ No newline at end of file -- Gitee