Skip to content

Multilingual Best Practices ​

This guide is for App developers. For minigame language support, see Minigame Multilingual Best Practices.

1. Determine the Current Language ​

Use the language selected by the user in the App. When the user selects “Follow system,” use a system language supported by the App. Use BCP 47 language tags, such as zh-CN and en-US.

Use the same current language for the App's loading screens, menus, dialogs, game information queries, game startup, and the getAppBaseInfo callback. Keep the behavior consistent across Android and iOS.

2. Provide the Language to the Minigame ​

Implement getAppBaseInfo in the registered SUDOPWrappedClient (Android) or SUDOPWrappedClientDelegate (iOS). When the SDK invokes this synchronous callback, provide the current App language while preserving other existing fields.

The examples below use zh-CN. Replace it with the App's current language.

Android:

java
@Override
public void getAppBaseInfo(JSONObject appInfo) {
    try {
        appInfo.put("language", "zh-CN");
    } catch (JSONException e) {
        throw new IllegalStateException(e);
    }
}

iOS:

objectivec
- (NSDictionary *)getAppBaseInfo {
    return @{ @"language": @"zh-CN" };
}

3. Configure the Language for Game Information and Loading Screens ​

When querying game information or starting a game, pass the current App language through the language parameter. The following examples use an existing game ID and callback objects.

Android:

java
String language = "zh-CN";
SUDOP.getGameInformation(gameId, language, informationListener);
SUDOP.startGame(gameId, language, startListener);

iOS:

objectivec
NSString *language = @"zh-CN";
[SUDOP getGameInformationWithGameID:gameID language:language completion:informationCompletion];
[SUDOP startGame:gameID
       language:language
       didGameViewCreated:viewCreated
       didGameHandleCreated:handleCreated
       progress:progress
       completion:startCompletion];

Set the getAppBaseInfo callback language and the startup API's language parameter separately. When displaying localized game names, descriptions, icons, or policy links in the App, read the value for the desired language key. If that value is missing or empty, read the default content under default.

4. Change the App Language ​

Update the language used by the getAppBaseInfo callback, refresh the App UI and related display caches, and pass the new language in subsequent game queries and startup calls.

Coordinate with the CP on when running minigames should refresh. The CP can refresh the UI or call sud.restart() to reinitialize the game. If the minigame has its own language setting, preserve the user's selection.