From e5405b497779e97bc40822bef18a7e34d6970cf7 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Thu, 18 Jan 2024 00:32:21 +0800 Subject: [PATCH] translate --- src/client.tsx | 2 +- src/provider.tsx | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/client.tsx b/src/client.tsx index bddb305..03287d6 100644 --- a/src/client.tsx +++ b/src/client.tsx @@ -44,7 +44,7 @@ export class Pushy { constructor(options: PushyOptions) { if (!options.appKey) { - throw new Error('appKey is required for withUpdates()'); + throw new Error('appKey is required'); } for (const [key, value] of Object.entries(options)) { if (value !== undefined) { diff --git a/src/provider.tsx b/src/provider.tsx index 1d72692..92efcda 100644 --- a/src/provider.tsx +++ b/src/provider.tsx @@ -67,14 +67,14 @@ export const PushyProvider = ({ stateListener.current && stateListener.current.remove(); showAlert('Download complete', 'Do you want to apply the update now?', [ { - text: 'Later', + text: '下次再说', style: 'cancel', onPress: () => { client.switchVersionLater(hash); }, }, { - text: 'Now', + text: '立即更新', style: 'default', onPress: () => { client.switchVersion(hash); @@ -106,7 +106,7 @@ export const PushyProvider = ({ 'A full update is required to download and install to continue.', [ { - text: 'OK', + text: '更新', onPress: () => { if (downloadUrl) { if (Platform.OS === 'android' && downloadUrl.endsWith('.apk')) { @@ -121,14 +121,12 @@ export const PushyProvider = ({ ); } else if ('update' in info) { showAlert( - `Version ${info.name} available`, - `What's new\n - ${info.description} - `, + '提示', + '检查到新的版本' + info.name + ',是否下载?\n' + info.description, [ - { text: 'Cancel', style: 'cancel' }, + { text: '取消', style: 'cancel' }, { - text: 'OK', + text: '确定', style: 'default', onPress: () => { doUpdate(info as UpdateAvailableResult);