Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Getting the current language using ISettings

An application can query and set the language of the device using ISettings functions and the "BREW/UI/Language" key, as shown in the following code sample. Applications do not need any privileges to query the device language, but they must have the AEEPRIVID_BREWSettings privilege to change the language.

The following example gets the current language and then sets the language to Korean:

...          
 // Create ISettings          
 pMe->pSettings = NULL;          
 nErr = ISHELL_CreateInstance(pMe->pIShell,          
                              AEECLSID_SettingsReg,          
                              (void **)&pMe->pSettings);          
          
 nErr = ISettings_Get(pMe->pSettings,          
                      "/BREW/UI/Language",          
                      buf,          
                      MYAPP_BUFSIZE,          
                      NULL);          
          
 nErr = ISettings_Set(pMe->pSettings, "/BREW/UI/Language", "ko  ");          
...

Notes for device manufacturers

  • The ISetting API for /BREW/UI/Language relies on the implementation of OEM_SVCGetConfig() for the case where nItem is CFGI_LNG. Device manufacturers must ensure that this function is implemented for the case where nItem is CFGI_LNG. Return one of the language codes from the AEELngCodes.h header file.
  • Brew MP automatically issues the "Device Info Changed" system callback whenever ICONFIG_SetItem() is called for CFGI_LNG. To ensure that the callback is issued upon language changes, device manufacturers must make sure to call ICONFIG_SetItem(CFGI_LNG) whenever the language setting changes on the device.