cancel
Showing results for 
Search instead for 
Did you mean: 

Language Dependency

sid-desh
Advisor
Advisor
0 Kudos

Hi,

I am developing a Webdynpro apllication which will be displayed as as Webdynpro iview in the portal.

Now the user can log in to portal it two languages.

If i am able to maintain the texts in both the language then how will my webdynpro application understand which language is being used at the moment and hence show the appropriate texts.

Do we need to do something to get this.

Regards

Sidharth

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Sidharth,

For most of parts of your applications -- no, i18n in WD does not require additional programming, but makes you use certain "correct" API-s.

Localization of WD Component View, Component Messages & Data Types texts performed via S2X tool and WD automatically applied necessary locale at run-time. This saves you from extra-work in 99% of possible scenarios.

However, if you need to use your own source of localizable data (property files, database etc) or your business objects has translatable fields, you can easily get current locale:

import java.util.Locale;

import com.sap.tc.webdynpro.services.sal.localization.api.WDResourceHandler;
import com.sap.tc.webdynpro.services.sal.localization.api.IWDResourceHandler;
...
final Locale locale = WDResourceHandler.getCurrentSessionLocale()

Or create localized resource handler for formatting

and resource loading:


final IWDResourceHandler handler = WDResourceHandler
    .createResourceHandlerForCurrentSession();
/* handler.formatCurrency(100); */
/* handler.getResourceBundle("MyResources"); */

Happy coding,

VS