mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-10-24 01:58:53 +08:00
Enhance Pushy class to support locale configuration in i18n initialization by adding optional locale property to ClientOptions interface.
This commit is contained in:
@@ -110,8 +110,7 @@ export class Pushy {
|
||||
this.clientType = clientType || 'Pushy';
|
||||
this.options.server = SERVER_PRESETS[this.clientType];
|
||||
|
||||
// Initialize i18n based on clientType
|
||||
i18n.setLocale(this.clientType === 'Pushy' ? 'zh' : 'en');
|
||||
i18n.setLocale(options.locale ?? this.clientType === 'Pushy' ? 'zh' : 'en');
|
||||
|
||||
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
||||
if (!options.appKey) {
|
||||
|
@@ -86,6 +86,7 @@ export interface ClientOptions {
|
||||
appKey: string;
|
||||
server?: UpdateServerConfig;
|
||||
logger?: UpdateEventsLogger;
|
||||
locale?: 'zh' | 'en';
|
||||
updateStrategy?:
|
||||
| 'alwaysAlert'
|
||||
| 'alertUpdateAndIgnoreError'
|
||||
|
Reference in New Issue
Block a user