diff --git a/features/albumView/src/main/ets/constants/AlbumViewConstants.ets b/features/albumView/src/main/ets/constants/AlbumViewConstants.ets index c07a687d2b7a23cd4c60670f88edde9bff93eb9d..913bb332366acab0d33a9baca7e8f36630ee4305 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 95ba6cbabb98622d7723dcd5f616d3326345eb95..902950de89c22514c411ea60bcf963b294b05c67 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 0000000000000000000000000000000000000000..965047af1d86bdcbcf2a5e712b21192d6e71a741 --- /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 0000000000000000000000000000000000000000..d0b1a765d9b779d7585734fdca132801fc986619 --- /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 9ead7a31e1312b10227fe054992468c7ac1f6cb5..521bf6abbee5e7e587869f06548822f6619698d8 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 db2450055a8734ba21f6e554d6e7b13a48914c43..bcb6a0445d92802c8d14e92f6cb14ba0c1a7210d 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 95ba6cbabb98622d7723dcd5f616d3326345eb95..cd687630315fd33967e1ff23edb39b4a532dd48d 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 0000000000000000000000000000000000000000..ba17f695d1acc37a79d9c6a0dd03b992900b159c --- /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 0000000000000000000000000000000000000000..90150013eee42e0e3165aefb8325ae825e55bd19 --- /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 a2d4343452acf877e8ee2e9689ac21adfe6f6b6d..a931ea06cdc18e99593626e0cb01c4d2b18792b8 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 f1e7b3fba30e4b361fda91ab2b2eb26154033b82..24723a505f6025a9d10d84b7178324593b13c7f6 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 3588b299f3b727e8905950658a5ca7f01e8fd3eb..2af1d70948769751bd899de392f679c44b51ee1e 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 95ba6cbabb98622d7723dcd5f616d3326345eb95..bd9e36820d06b9bf46bc3dedc8505b01c91626cb 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 0000000000000000000000000000000000000000..e7f7d7070e9cbca6eed494376d19e43d8ca36b85 --- /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 0000000000000000000000000000000000000000..427018677058ff55325afe17e9f992271abf546e --- /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 f60d1b9237c768567603c9147dddc10463e5154d..d1855b900651d11631b4ef450a4cf1231169ec0f 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 f60d1b9237c768567603c9147dddc10463e5154d..d1855b900651d11631b4ef450a4cf1231169ec0f 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