!287 多语言切换界面更新

Merge pull request !287 from fanchenxuan/master-
This commit is contained in:
openharmony_ci 2024-08-02 02:00:26 +00:00 committed by Gitee
commit 1336f67ea7
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -29,6 +29,7 @@ import { GlobalContext } from '../common/utils/globalContext';
let storage = LocalStorage.getShared();
const TAG = 'PermissionManager_Log:';
const RESOURCE_TYPE: number = 10003;
@Entry(storage)
@Component
@ -36,7 +37,7 @@ struct SecurityDialog {
private context = getContext(this) as common.ServiceExtensionContext;
@LocalStorageLink('want') want: WantInfo = new WantInfo([]);
@LocalStorageLink('win') win: window.Window = {} as window.Window;
@State appName: string = 'ToBeInstead';
@State appName: ResourceStr = 'ToBeInstead';
@State index: number = 0;
@State scrollBarWidth: number = Constants.SCROLL_BAR_WIDTH_DEFAULT;
@ -191,13 +192,9 @@ struct SecurityDialog {
let bundleName: string = this.want.parameters['ohos.aafwk.param.callerBundleName'];
bundleManager.getApplicationInfo(bundleName, bundleManager.ApplicationFlag.GET_APPLICATION_INFO_DEFAULT)
.then(data => {
this.context.resourceManager.getStringValue(data.labelResource)
.then(data => {
this.appName = data;
})
.catch((error: BusinessError) => {
Log.error('getStringValue failed. err is ' + JSON.stringify(error));
});
data.labelResource.params = [];
data.labelResource.type = RESOURCE_TYPE;
this.appName = data.labelResource;
})
.catch((error: BusinessError) => {
Log.error('getApplicationInfo failed. err is ' + JSON.stringify(error));