on 09-15-2004 6:34 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.