# Translate push notifications (/en/realtime-media/im/build/notifications-and-event-handling/offline-push/translate-push-notifications)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

<_PlatformTabsGroup groupMode="structured" canonicalPlatform="web" platforms="[&#x22;android&#x22;,&#x22;ios&#x22;,&#x22;web&#x22;,&#x22;flutter&#x22;,&#x22;react-native&#x22;,&#x22;windows&#x22;,&#x22;unity&#x22;]" showTabs="true">
  <_PlatformPanel platform="android">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="android" />

    Push notifications work in conjunction with the translation feature. If a user enables the auto-translate feature and sends a message, the SDK will send both the original message and the translated message.

    A recipient can set the preferred language for push notifications. If the language of the translated message matches their setting, the translated message is displayed in the push notification bar; otherwise, the original message is displayed.

    The following sample code shows how to set and get the preferred language for push notifications:

    ```java
    // Set the preferred language for offline push.
    ChatClient.getInstance().pushManager().setPreferredNotificationLanguage("en", new CallBack(){});

    // Get the preferred language for offline push.
    ChatClient.getInstance().pushManager().getPreferredNotificationLanguage(new ValueCallBack(){});
    ```

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="ios">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="ios" />

    Push notifications work in conjunction with the translation feature. If a user enables the auto-translate feature and sends a message, the SDK will send both the original message and the translated message.

    A recipient can set the preferred language for push notifications. If the language of the translated message matches their setting, the translated message is displayed in the push notification bar; otherwise, the original message is displayed.

    The following sample code shows how to set and get the preferred language for push notifications:

    ```objc
    // Set the preferred language for offline push.
    [[AgoraChatClient sharedClient].pushManager setPreferredNotificationLanguage:@"EU" completion:^(AgoraChatError *aError) {
        if (aError) {
            NSLog(@"setPushPerformLanguageCompletion error---%@",aError.errorDescription);
        }
    }];
    // Get the preferred language for offline push settings.
    [[AgoraChatClient sharedClient].pushManager getPreferredNotificationLanguageCompletion:^(NSString *aLanguageCode, AgoraChatError *aError) {
        if (!aError) {
            NSLog(@"getPushPerformLanguage---%@",aLanguageCode);
        }
    }];
    ```

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="web">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="web" />

    Push notifications work in conjunction with the translation feature. If a user enables the auto-translate feature and sends a message, the SDK will send both the original message and the translated message.

    A recipient can set the preferred language for push notifications. If the language of the translated message matches their setting, the translated message is displayed in the push notification bar; otherwise, the original message is displayed.

    The following sample code shows how to set and get the preferred language for push notifications:

    Push notifications work with the translation feature. If a user enables the automatic translation feature and sends a message, the SDK will send both the original message and the translated message.

    As a recipient, the user can set the preferred language for push notifications they want to receive when offline. If the language of the translated message matches their preferred language, the translated message is displayed in the push notification; otherwise, the original message is displayed.

    Call `setPushPerformLanguage` to set the preferred language for push notifications. The sample code is as follows:

    ```javascript
    // Set the preferred language for push notifications.
    const params = {
      language: "EU",
    };
    chatClient.setPushPerformLanguage(params);

    // Get the preferred language for push notifications.
    chatClient.getPushPerformLanguage();
    ```

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="flutter">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="flutter" />

    Push notifications work in conjunction with the translation feature. If a user enables the auto-translate feature and sends a message, the SDK will send both the original message and the translated message.

    A recipient can set the preferred language for push notifications. If the language of the translated message matches their setting, the translated message is displayed in the push notification bar; otherwise, the original message is displayed.

    The following sample code shows how to set and get the preferred language for push notifications:

    ```dart
    // Set the preferred language for offline push.
    try {
      await ChatClient.getInstance.pushManager.setPreferredNotificationLanguage('en');
    } on ChatError catch (e) {}
    // Get the preferred language for offline push settings.
    try {
      String? language = await ChatClient.getInstance.pushManager.fetchPreferredNotificationLanguage();
    } on ChatError catch (e) {}
    ```

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="react-native">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="react-native" />

    Push notifications work in conjunction with the translation feature. If a user enables the auto-translate feature and sends a message, the SDK will send both the original message and the translated message.

    A recipient can set the preferred language for push notifications. If the language of the translated message matches their setting, the translated message is displayed in the push notification bar; otherwise, the original message is displayed.

    The following sample code shows how to set and get the preferred language for push notifications:

    ```typescript
    ChatClient.getInstance()
      .pushManager.setPreferredNotificationLanguage(languageCode)
      .then(() => {
        console.log("Succeeded in setting the preferred notification language.");
      })
      .catch((reason) => {
        console.log("Failed to set the preferred notification language.", reason);
      });
    ```

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="windows">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="windows" />

    **This feature is not supported for this platform.**

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>

  <_PlatformPanel platform="unity">
    <_PlatformProcessedMarker groupMode="structured" canonicalPlatform="web" platform="unity" />

    **This feature is not supported for this platform.**

    <_PlatformProcessedMarker close="true" />
  </_PlatformPanel>
</_PlatformTabsGroup>
