MLtext within Javascript Webscript
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2010 09:13 AM
Hello,
I'm trying to figure out how to set or select language used inside a JavaScript back-end Webscript
I'm currently setting title and description of a node
fileHandleFile.properties.title = titreHandleFile;
fileHandleFile.properties.description = descriptionHandleFile;
fileHandleFile.save();
but i can't manage to set the language used for this.
Moreover, if i use native web client interface (alfdicoms/faces/jsp/dialog/container.jsp) and set profile preference "Content Language Filter" to "French" I can read the new value but when i go back to "All Language"
so two questions :
1. How to set MLText lang at setting time inside a webscript ?
2. how to set MLText lange at reading time inside a webscript ?
If we must use it trough user profile preference, how can we change it trough Web Script ?
Regards
I'm trying to figure out how to set or select language used inside a JavaScript back-end Webscript
I'm currently setting title and description of a node
fileHandleFile.properties.title = titreHandleFile;
fileHandleFile.properties.description = descriptionHandleFile;
fileHandleFile.save();
but i can't manage to set the language used for this.
Moreover, if i use native web client interface (alfdicoms/faces/jsp/dialog/container.jsp) and set profile preference "Content Language Filter" to "French" I can read the new value but when i go back to "All Language"
so two questions :
1. How to set MLText lang at setting time inside a webscript ?
2. how to set MLText lange at reading time inside a webscript ?
If we must use it trough user profile preference, how can we change it trough Web Script ?
Regards
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2010 04:46 PM
Each webscript executes in a locale specified by the Accept Language http header.
You could change this by calling the Java API.
I18NUtil.setLocale
You could change this by calling the Java API.
I18NUtil.setLocale
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2010 08:38 AM
Ok for the Java API but I'm in a Javascript context so I can't simply put "I18NUtil.setLocale" into the js file.
Does Alfresco expose such functionality for Javascript Side or is it required to create a new BaseScopableProcessorExtension and would this work ?
Regards.
Does Alfresco expose such functionality for Javascript Side or is it required to create a new BaseScopableProcessorExtension and would this work ?
Regards.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2010 05:15 AM
Unfortunately changing the locale for MLText is not exposed via the JavaScript API. As the user in the post above mentions, the script executes with the locale as per the request for the webscript. Yes you could Spring in your own JavaScript root helper object to do this, or use a Java backed webscript.
Kev
Kev
