rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlu...@apache.org
Subject svn commit: r1231324 - in /incubator/rave/trunk: rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/ rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/ rave-components/rave-web/src/test/resources/ ra...
Date Fri, 13 Jan 2012 21:59:29 GMT
Author: carlucci
Date: Fri Jan 13 21:59:28 2012
New Revision: 1231324

URL: http://svn.apache.org/viewvc?rev=1231324&view=rev
Log:
Code in support of RAVE-299: Create mechanism for using message bundle text inside javascript code

TODO: improve performance by caching the javascript response content per locale in the controller rather than generating it with every request

Added:
    incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/MessageBundleController.java
    incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/MessageBundleControllerTest.java
    incubator/rave/trunk/rave-components/rave-web/src/test/resources/messages.properties
      - copied, changed from r1230789, incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties
    incubator/rave/trunk/rave-components/rave-web/src/test/resources/messages_nl.properties
      - copied, changed from r1230789, incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties
Modified:
    incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties
    incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/mobile_home.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/newaccount.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/userProfile.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/widget.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_api.js
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_forms.js
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_layout.js
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_opensocial.js
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_store.js
    incubator/rave/trunk/rave-portal-resources/src/test/javascript/raveApiSpec.js
    incubator/rave/trunk/rave-portal-resources/src/test/javascript/raveSpec.js

Added: incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/MessageBundleController.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/MessageBundleController.java?rev=1231324&view=auto
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/MessageBundleController.java (added)
+++ incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/MessageBundleController.java Fri Jan 13 21:59:28 2012
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.rave.portal.web.controller;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+/**
+ * MessageBundle Controller
+ */
+@Controller
+@RequestMapping("/messagebundle/*")
+public class MessageBundleController  {
+    private final Logger logger = LoggerFactory.getLogger(getClass());
+    private final String CLIENT_MESSAGE_IDENTIFIER = "_rave_client.";
+    private final String CLIENT_MESSAGES_BUNDLE_NAME = "messages";
+
+    /**
+     * Returns a javascript initialization script which adds language specific client-side messages needed for use
+     * in the Rave javascript namespace.  It uses the Locale specified by the client's browser to determine
+     * which message bundle language to use.
+     *
+     * @param request  The incoming HttpServletRequest
+     * @param response The outgoing HttpServletResponse
+     * @return the JavaScript content to load from the client
+     */
+    @RequestMapping(value = {"/rave_client_messages.js"}, method = RequestMethod.GET)
+    @ResponseBody
+    public String getClientMessages(HttpServletRequest request, HttpServletResponse response) {
+        response.setContentType("application/javascript");
+
+        AcceptHeaderLocaleResolver acceptHeaderLocaleResolver = new AcceptHeaderLocaleResolver();
+        ResourceBundle resourceBundle = ResourceBundle.getBundle(CLIENT_MESSAGES_BUNDLE_NAME, acceptHeaderLocaleResolver.resolveLocale(request));
+
+        return convertClientMessagesMapToJavaScriptOutput(convertResourceBundleToClientMessagesMap(resourceBundle));
+    }
+
+    private Map<String, String> convertResourceBundleToClientMessagesMap(ResourceBundle resourceBundle) {
+        Map<String, String> map = new HashMap<String, String>();
+        Enumeration<String> keys = resourceBundle.getKeys();
+        while (keys.hasMoreElements()) {
+            String key = keys.nextElement();
+            // only load the messages that are specifically used by the client code for performance reasons
+            // strip off the client. part of the key
+            if (key.startsWith(CLIENT_MESSAGE_IDENTIFIER)) {
+                map.put(key.replaceFirst(CLIENT_MESSAGE_IDENTIFIER,""), StringEscapeUtils.escapeJavaScript(resourceBundle.getString(key)));
+            }
+        }
+        return map;
+    }
+    
+    private String convertClientMessagesMapToJavaScriptOutput(Map<String, String> clientMessagesMap) {
+        StringBuilder sb = new StringBuilder();
+        for (Map.Entry<String, String> mapEntry : clientMessagesMap.entrySet()) {
+            sb.append("rave.addClientMessage(\"" + mapEntry.getKey() + "\",\"" + mapEntry.getValue() + "\");");
+        }
+        return sb.toString();
+    }
+}
\ No newline at end of file

Added: incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/MessageBundleControllerTest.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/MessageBundleControllerTest.java?rev=1231324&view=auto
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/MessageBundleControllerTest.java (added)
+++ incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/MessageBundleControllerTest.java Fri Jan 13 21:59:28 2012
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.rave.portal.web.controller;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.mock.web.MockHttpServletRequest;
+import org.springframework.mock.web.MockHttpServletResponse;
+import org.springframework.ui.ExtendedModelMap;
+import org.springframework.ui.Model;
+
+import java.util.Locale;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class MessageBundleControllerTest {
+    private MessageBundleController messageBundleController;
+    private MockHttpServletRequest request;
+    private MockHttpServletResponse response;
+
+    @Before
+    public void setup() {        
+        messageBundleController = new MessageBundleController();
+        request = new MockHttpServletRequest();
+        response = new MockHttpServletResponse();
+    }
+
+    @Test
+    public void getClientMessages_defaultLocale() {
+        final String EXPECTED_JS = buildExpectedJavaScript("mother", "father", "text with \\\"quotes\\\"");
+        assertThat(messageBundleController.getClientMessages(request, response), is(EXPECTED_JS));
+        assertThat(response.getContentType(), is("application/javascript"));
+    }
+
+    @Test
+    public void getClientMessages_nlLocale() {
+        Locale nlLocale = new Locale("nl","NL");
+        request.addPreferredLocale(nlLocale);
+
+        final String EXPECTED_JS = buildExpectedJavaScript("moeder", "vader", "tekst met \\\"quotes\\\"");
+        assertThat(messageBundleController.getClientMessages(request, response), is(EXPECTED_JS));
+        assertThat(response.getContentType(), is("application/javascript"));
+    }
+    
+    
+    private String buildExpectedJavaScript(String test1, String test2, String test3) {
+        StringBuilder sb = new StringBuilder();
+        sb.append("rave.addClientMessage(\"test1\",\"");
+        sb.append(test1);
+        sb.append("\");rave.addClientMessage(\"test2\",\"");
+        sb.append(test2);
+        sb.append("\");rave.addClientMessage(\"test3\",\"");
+        sb.append(test3);
+        sb.append("\");");
+        return sb.toString();
+    }
+}
\ No newline at end of file

Copied: incubator/rave/trunk/rave-components/rave-web/src/test/resources/messages.properties (from r1230789, incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/test/resources/messages.properties?p2=incubator/rave/trunk/rave-components/rave-web/src/test/resources/messages.properties&p1=incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties&r1=1230789&r2=1231324&rev=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties (original)
+++ incubator/rave/trunk/rave-components/rave-web/src/test/resources/messages.properties Fri Jan 13 21:59:28 2012
@@ -16,209 +16,9 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+test.key1=hello
+test.key2=world
 
-username.required=Username required
-username.invalid.length=Username must be at least 2 characters long
-username.invalid.pattern=Username must be at least 2 characters long and may only contain letters, numbers, \
-  _-+.@
-username.exists=Username already exists
-
-password.required=Password required
-password.invalid.length=Password must be at least 4 characters long
-
-confirmPassword.required=Confirm Password required
-confirmPassword.mismatch=Password mismatch
-
-email.required=Email required
-email.invalid=This is not a valid email address
-email.exists=This email address already exists for a user
-
-form.some.fields.required=Field marked with * are required
-form.all.fields.required=All fields are required.
-form.field.error.required=This field is required
-
-page.error.title=Rave has suffered a brief meltdown
-page.error.message=Please bear with us while we fetch some ice cubes.  In the meantime please try
-page.error.reload=reloading
-page.error.details=technical details
-
-page.general.back=Back to Rave
-page.general.addnewpage=Add a New Page
-page.general.confirmpassword=Confirm password:
-page.general.deletepage=Delete Page
-page.general.editpage=Edit Page
-page.general.email=Email address:
-page.general.empty=Add widgets to this page
-page.general.logout=Logout
-page.general.movepage=Move Page
-page.general.movethispage=Move this page:
-page.general.movethispage.after=After {0}
-page.general.movethispage.tofirst=To First Tab (Set as Default)
-page.general.password=Password:
-page.general.screenshot=screenshot
-page.general.title=Rave
-page.general.thumbnail=thumbnail
-page.general.toadmininterface=Admin interface
-page.general.username=Username:
-
-page.general.addpage.title=Title
-page.general.addpage.layout.columns_1=One Column
-page.general.addpage.layout.columns_2=Two Columns
-page.general.addpage.layout.columns_2wn=Two Columns (wide/narrow)
-page.general.addpage.layout.columns_3=Three Columns
-page.general.addpage.layout.columns_3nwn=Three Columns (narrow/wide/narrow)
-page.general.addpage.layout.columns_3_newuser=Three Columns (new user)
-page.general.addpage.layout.columns_4=Four Columns
-page.general.addpage.layout.columns_3nwn_1_bottom=Four Columns (narrow/wide/narrow/bottom)
-page.general.addpage.selectlayout=Select Page Layout:
-
-page.getWidgetMetadata.button=Get widget metadata
-
-page.home.title=Home
-page.mobile_home.title=Home
-page.home.welcome=Hello {0}, welcome to Rave!
-
-page.menu.title=Page Actions Menu
-
-page.layout.newuser.introtext=This is the default page layout for new users.  We suggest you play with some of the Rave features:<ul><li>Rename this page and change the widget layout</li><li>Add a new page</li><li>Add widgets from the Widget Store</li><li>Edit the preferences for a widget</li><li>Move widgets around on a page</li><li>Collapse and restore a widget</li><li>much more...</li></ul>
-page.layout.newuser.subtitle=We have provided a few sample widgets for you to try out.  Click on the Widget Store link above to add more widgets!
-
-page.login.title=Login
-page.login.createaccount=New User
-page.login.createaccount.label=Register:
-page.login.createaccount.button=Create New Account
-page.login.openid=OpenID Identity
-page.login.openid.button=Login with OpenID
-page.login.openid.fail=OpenID identification failed.
-page.login.openid.identifier=Identity:
-page.login.rememberme=Remember me
-page.login.usernamepassword=Username and Password
-page.login.usernamepassword.fail=The username or password is incorrect.
-page.login.usernamepassword.login=Login
-
-page.newaccount.title=New Account Application
-page.newaccount.button=Create Account
-
-page.store.title=Widget Store
-page.store.search=Search in widget store
-page.store.search.button=Search
-page.store.list.noresult=No widgets found
-page.store.list.result.x.to.y=Showing {0} - {1} of {2} widgets
-page.store.list.search.noresult=No widgets found for ''{0}''
-page.store.list.search.result.x.to.y=Showing {0} - {1} of {2} widgets that match ''{3}''
-page.store.list.widgets.mine=My Widgets
-page.store.list.widgets.all=All Widgets
-
-page.userprofile.title=Update user profile
-page.userprofile.button=Update profile
-page.userprofile.openid.url=OpenID URL:
-
-page.widget.title=Widget Detail
-page.widget.addToPage=Add to Page
-page.widget.backToStore=Back to Store
-page.widget.widgetPreview=Widget Preview
-page.widget.rate=Rate:
-page.widget.rate.like=Like
-page.widget.rate.dislike=Dislike
-page.widget.comments=Comments
-page.widget.comment.edit=Edit Comment
-page.widget.usercount=users
-page.widget.rate.likes=Likes: 
-page.widget.rate.dislikes=Dislikes:
-page.widget.tags.title=Tags:
-page.widget.tags.add=Add New Tag:
-
-page.addwidget.title=Add new widget
-page.addwidget.form.header=Widget
-page.addwidget.form.submit=Add widget
-page.addwidget.result.exists=The widget you submitted already exists.
-page.addwidget.result.success=The widget was successfully added.
-
-admin.home.title=Rave admin interface
-admin.home.shorttitle=Home
-admin.home.subtitle=Welcome to the Rave admin interface
-admin.home.intro=<p>For help, go to the \
-  <a href="http://incubator.apache.org/rave/documentation/admin-interface.html" target="_blank">documentation site</a>.</p>
-admin.widgets.title=Rave admin interface - Widgets
-admin.widgets.shorttitle=Widgets
-admin.users.title=Rave admin interface - Users
-admin.users.shorttitle=Users
-admin.users.search=Search Users
-admin.users.add=Add user
-admin.userdetail.title=Rave admin interface - User detail
-admin.userdetail.goback=\u00ab Back to users
-admin.userdetail.editdata=Edit user data
-admin.userdetail.action.delete.success=The user profile has been removed
-admin.userdetail.action.delete.confirm=Yes I want to delete this user
-admin.userdetail.action.delete.confirm.required=Checkbox must be checked
-admin.userdetail.action.update.success=The user profile has been updated
-admin.userdata.username=Username
-admin.userdata.email=Email
-admin.userdata.accountstatus=Account status:
-admin.userdata.enabled=Account enabled
-admin.userdata.expired=Account expired
-admin.userdata.locked=Account locked
-admin.userdata.authorities=Authorities:
-admin.widgets.search=Search Widgets
-admin.widgets.search.choosetype=Choose Type...
-admin.widgets.search.choosestatus=Choose Status...
-admin.widgetdetail.title=Rave admin interface - Widget detail
-admin.widgetdetail.goback=\u00ab Back to widgets
-admin.widgetdetail.editdata=Edit widget data
-admin.widgetdetail.updatebutton=Update widget
-admin.widgetdetail.action.delete.success=The widget has been removed
-admin.widgetdetail.action.update.success=The widget has been updated
-admin.preferences.title=Rave admin interface - Preferences
-admin.preferences.shorttitle=Preferences
-admin.preferences.edit=Edit preferences
-admin.preferencedetail.title=Rave admin interface - Preferences
-admin.preferencedetail.titleSuffix=Page title suffix
-admin.preferencedetail.pageSize=Number of items per page (list)
-admin.preferencedetail.pageSize.malformed=Enter a whole number greater than 0
-admin.preferencedetail.updateButton=Update preferences
-admin.preferencedetail.action.update.success=Preferences have been updated
-admin.preferencedetail.goback=\u00ab Back to overview
-admin.clearsearch=Clear search
-admin.delete=Delete
-
-admin.list.noresult=No results found
-admin.list.result.x.to.y=Showing {0} - {1} of {2} results
-admin.list.search.noresult=No results found for ''{0}''
-admin.list.search.result.x.to.y=Showing {0} - {1} of {2} results that match ''{3}''
-
-widget.author=Author
-widget.authorEmail=Author's email address
-widget.description=Description
-widget.description.required=Description is required
-widget.disableRendering=Disable Widget
-widget.disableRenderingMessage=Disable Widget Message
-widget.screenshotUrl=Screenshot
-widget.screenshotUrl.malformed=URL is malformed
-widget.thumbnailUrl=Thumbnail
-widget.thumbnailUrl.malformed=URL is malformed
-widget.title=Title
-widget.title.required=Title is required
-widget.titleUrl=URL the widget title links to
-widget.titleUrl.malformed=URL is malformed
-widget.type=Type
-widget.type.OpenSocial=OpenSocial
-widget.type.W3C=W3C Widget
-widget.type.required=Choose a widget type
-widget.url=Location (URL)
-widget.url.malformed=URL is malformed
-widget.url.required=URL is required
-widget.url.exists=A Widget already exists for this URL
-widget.widgetStatus=Status
-widget.widgetStatus.PREVIEW=This widget is waiting for approval by the site administrator.
-widget.widgetStatus.PUBLISHED=
-
-widget.chrome.toggle=Collapse/Restore Widget
-widget.chrome.disabled=This widget is currently disabled
-
-widget.menu.about=About this Widget
-widget.menu.delete=Delete Widget
-widget.menu.editprefs=Edit Preferences
-widget.menu.maximize=Maximize
-widget.menu.movethiswidget=Move this widget to page:
-widget.menu.movetopage=Move to Page
-widget.menu.title=Widget Actions
+_rave_client.test1=mother
+_rave_client.test2=father
+_rave_client.test3=text with "quotes"

Copied: incubator/rave/trunk/rave-components/rave-web/src/test/resources/messages_nl.properties (from r1230789, incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/test/resources/messages_nl.properties?p2=incubator/rave/trunk/rave-components/rave-web/src/test/resources/messages_nl.properties&p1=incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties&r1=1230789&r2=1231324&rev=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties (original)
+++ incubator/rave/trunk/rave-components/rave-web/src/test/resources/messages_nl.properties Fri Jan 13 21:59:28 2012
@@ -16,220 +16,9 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+test.key1=hallo
+test.key2=wereld
 
-username.required=Gebruikersnaam verplicht
-username.invalid.length=Gebruikersnaam moet minimaal 2 tekens lang zijn
-username.invalid.pattern=Gebruikersnaam moet minimaal 2 tekens lang zijn en mag enkel letters, cijfers en de volgende karakters bevatten \
-  _-+.@
-username.exists=Gebruikersnaam bestaat al
-
-password.required=Wachtwoord verplicht
-password.invalid.length=Wachtwoord moet minimaal 4 tekens lang zijn
-
-confirmPassword.required=Wachtwoord bevestigen verplicht
-confirmPassword.mismatch=Wachtwoord komt niet overeen
-
-email.required=Email verplicht
-email.invalid=Dit is geen geldig email adres
-email.exists=Dit email adres bestaat al voor een gebruiker
-
-form.some.fields.required=Velden met een * zijn verplicht
-form.all.fields.required=Alle velden zijn verplicht
-form.field.error.required=Dit veld is verplicht
-
-page.error.title=Oeps, er is iets misgegaan
-page.error.message=Kaboutertjes zullen proberen het probleem op te lossen. Ondertussen kun je proberen de pagina te
-page.error.reload=herladen
-page.error.details=Technische details
-
-page.general.back=Terug naar Rave
-page.general.addnewpage=Voeg een nieuwe pagina toe
-page.general.confirmpassword=Bevestig wachtwoord:
-page.general.deletepage=Verwijder pagina
-page.general.editpage=Pas Pagina aan
-page.general.email=Email adres:
-page.general.empty=Voeg widgets aan deze pagina toe
-page.general.logout=Uitloggen
-page.general.movepage=Verplaats pagina
-page.general.movethispage=Verplaats deze pagina:
-page.general.movethispage.after=Na {0}
-page.general.movethispage.tofirst=Naar eerste tab
-page.general.password=Wachtwoord:
-page.general.screenshot=screenshot
-page.general.title=Rave
-page.general.thumbnail=miniatuur
-page.general.toadmininterface=Beheeromgeving
-page.general.username=Gebruikersnaam:
-
-page.general.addpage.title=Titel
-page.general.addpage.layout.columns_1=Een kolom
-page.general.addpage.layout.columns_2=Twee kolommen
-page.general.addpage.layout.columns_2wn=Twee kolommen (breed/smal)
-page.general.addpage.layout.columns_3=Drie kolommen
-page.general.addpage.layout.columns_3nwn=Drie kolommen (smal/breed/smal)
-page.general.addpage.layout.columns_3_newuser=Drie kolommen (nieuwe gebruiker)
-page.general.addpage.layout.columns_4=Vier kolommen
-page.general.addpage.layout.columns_3nwn_1_bottom=Vier kolommen (smal/breed/smal/beneden)
-page.general.addpage.selectlayout=Selecteer paginaindeling:
-
-page.getWidgetMetadata.button=Haal widget metadata op
-
-page.home.title=Home
-page.mobile_home.title=Home
-page.home.welcome=Hallo {0}, welkom bij Rave!
-
-page.menu.title=Pagina Acties Menu
-
-page.layout.newuser.introtext=Dit is de standaard pagina-indeling voor nieuwe gebruikers. \
-  Wij raden je aan een aantal van de Rave kenmerken uit te proberen:\
-  <ul><li>Hernoem deze pagina en wijzig de widget layout</li>\
-  <li>Voeg een nieuwe pagina toe</li>\
-  <li>Voeg widgets toe van de Widgetwinkel</li>\
-  <li>Bewerk de voorkeuren voor een widget</li>\
-  <li>Verplaats widgets op een pagina</li>\
-  <li>Klap een widget in en uit</li>\
-  <li>nog veel meer ...</li></ul>
-page.layout.newuser.subtitle=We hebben een paar voorbeeldwidgets voor je toegevoegd om uit te proberen. \
-  Klik op de Widgetwinkel link hierboven om meer widgets toe te voegen!
-
-page.login.title=Inloggen
-page.login.createaccount=Nieuwe gebruiker
-page.login.createaccount.label=Registreer:
-page.login.createaccount.button=Cre\u00EBer een nieuw account
-page.login.openid=OpenID Identiteit
-page.login.openid.button=Inloggen met OpenID
-page.login.openid.fail=OpenID identificatie mislukt.
-page.login.openid.identifier=Identiteit:
-page.login.rememberme=Onthoud mij
-page.login.usernamepassword=Gebruikersnaam en wachtwoord
-page.login.usernamepassword.fail=De gebruikersnaam of het wachtwoord is incorrect.
-page.login.usernamepassword.login=Inloggen
-
-page.newaccount.title=Nieuw account applicatie
-page.newaccount.button=Cre\u00EBer account
-
-page.store.title=Widgetwinkel
-page.store.search=Zoek in de widgetwinkel
-page.store.search.button=Zoek
-page.store.list.noresult=Geen widgets gevonden
-page.store.list.result.x.to.y={0} - {1} van {2} widgets getoond
-page.store.list.search.noresult=Geen widgets gevonden voor ''{0}''
-page.store.list.search.result.x.to.y={0} - {1} van {2} widgets getoond welke overeenkomen met ''{3}''
-page.store.list.widgets.mine=Mijn widgets
-page.store.list.widgets.all=Alle widgets
-
-page.userprofile.title=Update gebruikersprofiel
-page.userprofile.button=Update profiel
-page.userprofile.openid.url=OpenID URL:
-
-page.widget.title=Widgetdetail
-page.widget.addToPage=Voeg toe aan pagina
-page.widget.backToStore=Terug naar de winkel
-page.widget.widgetPreview=Widget preview
-page.widget.rate=Waardering:
-page.widget.rate.like=Leuk
-page.widget.rate.dislike=Niet leuk
-page.widget.comments=Opmerkingen
-page.widget.comment.edit=Bewerk opmerking
-page.widget.usercount=gebruikers
-page.widget.rate.likes=Leuk: 
-page.widget.rate.dislikes=Niet leuk: 
-page.widget.tags.title=Labels:
-page.widget.tags.add=Nieuwe tag toevoegen:
-page.widget.tags.or=--of--
-page.widget.tags.select=Selecteer uit lijst:
-
-page.addwidget.title=Voeg nieuwe widget toe
-page.addwidget.form.header=Widget
-page.addwidget.form.submit=Voeg widget toe
-page.addwidget.result.exists=Deze widget bestaat al
-page.addwidget.result.success=De widget is succesvol toegevoegd.
-
-admin.home.title=Rave admin interface
-admin.home.shorttitle=Home
-admin.home.subtitle=Welkom in de Rave admin interface
-admin.home.intro=<p>Voor hulp, ga naar de \
-  <a href="http://incubator.apache.org/rave/documentation/admin-interface.html">documentatie site</a> (Engels).</p>
-admin.widgets.title=Rave admin interface - Widgets
-admin.widgets.shorttitle=Widgets
-admin.users.title=Rave admin interface - Gebruikers
-admin.users.shorttitle=Gebruikers
-admin.users.search=Zoek Gebruikers
-admin.users.add=Voeg Gebruiker toe
-admin.userdetail.title=Rave admin interface - Gebruiker details
-admin.userdetail.goback=\u00AB Terug naar gebruikers
-admin.userdetail.editdata=Pas gebruikers gegevens aan
-admin.userdetail.action.delete.success=Het gebruikersprofiel is verwijderd
-admin.userdetail.action.delete.confirm=Ja, ik wil deze gebruiker verwijderen
-admin.userdetail.action.delete.confirm.required=Checkbox moet aangevinkt zijn
-admin.userdetail.action.update.success=Het gebruikersprofiel is bijgewerkt
-admin.userdata.username=Gebruikersnaam
-admin.userdata.email=Email
-admin.userdata.accountstatus=Account status:
-admin.userdata.enabled=Account ingeschakeld
-admin.userdata.expired=Account verlopen
-admin.userdata.locked=Account op slot
-admin.userdata.authorities=Authoriteiten:
-admin.widgets.search=Zoek widgets
-admin.widgets.search.choosetype=Kies Type...
-admin.widgets.search.choosestatus=Kies Status...
-admin.widgetdetail.title=Rave admin interface - Widget details
-admin.widgetdetail.goback=\u00AB Terug naar widgets
-admin.widgetdetail.editdata=Pas widget gegevens aan
-admin.widgetdetail.updatebutton=Widget bijwerken
-admin.widgetdetail.action.delete.success=De widget is verwijderd
-admin.widgetdetail.action.update.success=De widget is bijgewerkt
-admin.preferences.title=Rave admin interface - Voorkeuren
-admin.preferences.shorttitle=Voorkeuren
-admin.preferences.edit=Pas voorkeuren aan
-admin.preferencedetail.title=Rave admin interface - Voorkeuren
-admin.preferencedetail.titleSuffix=Toevoeging pagina titel
-admin.preferencedetail.pageSize=Aantal items per pagina (lijst)
-admin.preferencedetail.pageSize.malformed=Voer een geheel getal in groter dan 0
-admin.preferencedetail.updateButton=Wijzig voorkeuren
-admin.preferencedetail.action.update.success=De voorkeuren zijn bijgewerkt
-admin.preferencedetail.goback=\u00AB Terug naar overzicht
-admin.clearsearch=Maak zoekveld leeg
-admin.delete=Verwijder
-
-admin.list.noresult=Geen resultaten gevonden
-admin.list.result.x.to.y={0} - {1} van {2} resultaten getoond
-admin.list.search.noresult=Geen resultaten gevonden voor ''{0}''
-admin.list.search.result.x.to.y={0} - {1} van {2} resultaten getoond welke overeenkomen met ''{3}''
-
-widget.author=Eigenaar
-widget.authorEmail=E-mail adres eigenaar
-widget.description=Beschrijving
-widget.description.required=Beschrijving is verplicht
-widget.disableRendering=Schakel widget uit
-widget.disableRenderingMessage=Tekst uitgeschakelde widget
-widget.screenshotUrl=Screenshot
-widget.screenshotUrl.malformed=URL is niet correct
-widget.thumbnailUrl=Miniatuur
-widget.thumbnailUrl.malformed=URL is niet correct
-widget.title=Titel
-widget.title.required=Title is verplicht
-widget.titleUrl=URL waar de widget naartoe wijst
-widget.titleUrl.malformed=URL is niet correct
-widget.type=Type
-widget.type.OpenSocial=OpenSocial
-widget.type.W3C=W3C Widget
-widget.type.required=Kies een widgettype
-widget.url=Locatie (URL)
-widget.url.malformed=URL is niet correct
-widget.url.required=URL is verplicht
-widget.url.exists=Er bestaat al een widget met deze URL
-widget.widgetStatus=Status
-widget.widgetStatus.PREVIEW=Deze widget wacht op goedkeuring door de sitebeheerder
-widget.widgetStatus.PUBLISHED=
-
-widget.chrome.toggle=In-/uitklappen widget
-widget.chrome.disabled=Deze widget is momenteel uitgeschakeld
-
-widget.menu.about=Over deze widget
-widget.menu.delete=Verwijder widget
-widget.menu.editprefs=Pas voorkeursinstellingen aan
-widget.menu.maximize=Maximaliseer
-widget.menu.movethiswidget=Verplaats deze widget naar pagina:
-widget.menu.movetopage=Verplaats naar Pagina
-widget.menu.title=Widget acties
+_rave_client.test1=moeder
+_rave_client.test2=vader
+_rave_client.test3=tekst met "quotes"
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties Fri Jan 13 21:59:28 2012
@@ -223,3 +223,28 @@ widget.menu.maximize=Maximize
 widget.menu.movethiswidget=Move this widget to page:
 widget.menu.movetopage=Move to Page
 widget.menu.title=Widget Actions
+
+#######################################################################################################################
+# messages available to the client javascript via the MessageBundleController must start with "_rave_client."
+#######################################################################################################################
+_rave_client.api.error=Rave encountered an error while trying to contact the server.  Please reload the page and try again. Error:
+_rave_client.api.rpc.error.invalid_params=Rave attempted to update the server with your recent changes, but the changes were rejected by the server as invalid.
+_rave_client.api.rpc.error.internal=Rave attempted to update the server with your recent changes, but the server encountered an internal error.
+_rave_client.api.widget_metadata.invalid_params=Both url and type are needed to get the metadata
+_rave_client.api.widget_metadata.parse_error=Unable to parse Widget for its metadata.\n\nPlease verify that the url is pointing to a valid Widget of the type specified.
+_rave_client.common.add=Add
+_rave_client.common.cancel=Cancel
+_rave_client.common.move=Move
+_rave_client.common.save=Save
+_rave_client.common.update=Update
+_rave_client.form.password.invalid_match=The password does not match
+_rave_client.opensocial.render_error=Unable to render OpenSocial Gadget:
+_rave_client.page.add=Add a New Page
+_rave_client.page.duplicate_name=A page with that name already exists
+_rave_client.page.update=Update Page
+_rave_client.widget.add_prefix=The widget
+_rave_client.widget.add_suffix= has been added to your page
+_rave_client.widget.prefs.required.title=* indicates a required input
+_rave_client.widget.provider.error=This widget type is currently unsupported.  Check with your administrator and be sure the correct provider is registered.
+_rave_client.widget.remove_confirm=Are you sure you want to remove this widget from your page?
+_rave_client.widget.users.added_by=has been added by...
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties Fri Jan 13 21:59:28 2012
@@ -234,3 +234,28 @@ widget.menu.maximize=Maximaliseer
 widget.menu.movethiswidget=Verplaats deze widget naar pagina:
 widget.menu.movetopage=Verplaats naar Pagina
 widget.menu.title=Widget acties
+
+#######################################################################################################################
+# boodschappen ter beschikking van de opdrachtgever javascript via de MessageBundleController moet beginnen met "_rave_client."
+#######################################################################################################################
+_rave_client.api.error=Rave is een fout opgetreden tijdens een poging om de server contact. Laad de pagina opnieuw en probeer het opnieuw. fout:
+_rave_client.api.rpc.error.invalid_params=Rave geprobeerd de server met uw recente wijzigingen bij te werken, maar de veranderingen waren geweigerd door de server als ongeldig.
+_rave_client.api.rpc.error.internal=Rave geprobeerd de server met uw recente wijzigingen bij te werken, maar de server heeft een interne fout.
+_rave_client.api.widget_metadata.invalid_params=Zowel de url en het type zijn nodig om de metadata te krijgen
+_rave_client.api.widget_metadata.parse_error=Kan Widget parsen voor haar metadata.\n\nControleer te controleren of de url verwijst naar een geldige Widget van de opgegeven type.
+_rave_client.common.add=Toevoegen
+_rave_client.common.cancel=Annuleren
+_rave_client.common.move=Bewegen
+_rave_client.common.save=Besparen
+_rave_client.common.update=Updaten
+_rave_client.form.password.invalid_match=Het wachtwoord komt niet overeen
+_rave_client.opensocial.render_error=Kan OpenSocial Gadget maken:
+_rave_client.page.add=Voeg een nieuwe pagina
+_rave_client.page.duplicate_name=Een pagina met die naam bestaat al
+_rave_client.page.update=Update-pagina
+_rave_client.widget.add_prefix=De widget
+_rave_client.widget.add_suffix= is toegevoegd aan uw pagina
+_rave_client.widget.prefs.required.title=* geeft een vereist ingang
+_rave_client.widget.provider.error=Deze widget type is momenteel niet ondersteund. Neem contact op met uw beheerder en zorg ervoor dat de juiste provider is geregistreerd.
+_rave_client.widget.remove_confirm=Weet je zeker dat je deze widget te verwijderen van uw pagina?
+_rave_client.widget.users.added_by=is toegevoegd door...
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.jsp?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/addwidget.jsp Fri Jan 13 21:59:28 2012
@@ -172,6 +172,7 @@
 <script src="//ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/jquery-ui.min.js"></script>
 <script src="<spring:url value="/script/rave.js"/>"></script>
 <script src="<spring:url value="/script/rave_api.js"/>"></script>
+<script src="<spring:url value="/app/messagebundle/rave_client_messages.js"/>"></script>
 <script>
     $(function() {
         rave.setContext("<spring:url value="/app/" />");

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/mobile_home.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/mobile_home.jsp?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/mobile_home.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/mobile_home.jsp Fri Jan 13 21:59:28 2012
@@ -171,6 +171,7 @@
     <script src="<spring:url value="/script/rave_opensocial.js"/>"></script>
     <script src="<spring:url value="/script/rave_wookie.js"/>"></script>
     <script src="<spring:url value="/script/rave_layout.js"/>"></script>
+    <script src="<spring:url value="/app/messagebundle/rave_client_messages.js"/>"></script>
     <portal:render-script location="${'AFTER_RAVE'}" />
     <script>
         $(function() {

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/newaccount.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/newaccount.jsp?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/newaccount.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/newaccount.jsp Fri Jan 13 21:59:28 2012
@@ -91,5 +91,6 @@ under the License.
 <script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
 <script src="<spring:url value="/script/rave.js"/>"></script>
 <script src="<spring:url value="/script/rave_forms.js"/>"></script>
+<script src="<spring:url value="/app/messagebundle/rave_client_messages.js"/>"></script>
 
 <script>$(document).ready(rave.forms.validateNewAccountForm());</script>
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp Fri Jan 13 21:59:28 2012
@@ -173,6 +173,7 @@
 <script src="<spring:url value="/script/rave_opensocial.js"/>"></script>
 <script src="<spring:url value="/script/rave_wookie.js"/>"></script>
 <script src="<spring:url value="/script/rave_layout.js"/>"></script>
+<script src="<spring:url value="/app/messagebundle/rave_client_messages.js"/>"></script>
 <portal:render-script location="${'AFTER_RAVE'}" />
 <script>
     $(function() {

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp Fri Jan 13 21:59:28 2012
@@ -281,6 +281,7 @@
 <script src="<spring:url value="/script/rave.js"/>"></script>
 <script src="<spring:url value="/script/rave_api.js"/>"></script>
 <script src="<spring:url value="/script/rave_store.js"/>"></script>
+<script src="<spring:url value="/app/messagebundle/rave_client_messages.js"/>"></script>
 <script>
     $(function () {
         rave.setContext("<spring:url value="/app/" />");

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/userProfile.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/userProfile.jsp?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/userProfile.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/userProfile.jsp Fri Jan 13 21:59:28 2012
@@ -68,5 +68,6 @@
 <script src="//ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script>
 <script src="<spring:url value="/script/rave.js"/>"></script>
 <script src="<spring:url value="/script/rave_forms.js"/>"></script>
+<script src="<spring:url value="/app/messagebundle/rave_client_messages.js"/>"></script>
 
 <script>$(document).ready(rave.forms.validateUserProfileForm());</script>
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/widget.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/widget.jsp?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/widget.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/widget.jsp Fri Jan 13 21:59:28 2012
@@ -222,6 +222,7 @@
 <script src="<spring:url value="/script/rave.js"/>"></script>
 <script src="<spring:url value="/script/rave_api.js"/>"></script>
 <script src="<spring:url value="/script/rave_store.js"/>"></script>
+<script src="<spring:url value="/app/messagebundle/rave_client_messages.js"/>"></script>
 <script>
     $(function () {
         rave.setContext("<spring:url value="/app/" />");

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js Fri Jan 13 21:59:28 2012
@@ -17,11 +17,10 @@
  * under the License.
  */
 var rave = rave || (function() {
-    var WIDGET_PROVIDER_ERROR = "This widget type is currently unsupported.  Check with your administrator and be sure the correct provider is registered.";
-
     var providerMap = {};
     var widgetByIdMap = {};
     var context = "";
+    var clientMessages = {};
 
     /**
      * Separate sub-namespace for isolating UI functions and state management
@@ -35,8 +34,8 @@ var rave = rave || (function() {
         var SELECT_OPTION_TEMPLATE = "<option value='{value}' {selected}>{displayValue}</option>";
         var TEXTAREA_TEMPLATE = "<tr>{prefLabelTemplate}<td><textarea id='{name}' name='{name}' rows='5' cols='12' class='{class}'>{value}</textarea></td></tr>";
         var HIDDEN_FIELD_TEMPLATE = "<input type='hidden' id='{name}' name='{name}' value='{value}'>";
-        var PREFS_SAVE_BUTTON_TEMPLATE = "<button type='button' id='{elementId}'>Save</button>";
-        var PREFS_CANCEL_BUTTON_TEMPLATE = "<button type='button' id='{elementId}'>Cancel</button>";
+        var PREFS_SAVE_BUTTON_TEMPLATE = "<button type='button' id='{elementId}'>{buttonText}</button>";
+        var PREFS_CANCEL_BUTTON_TEMPLATE = "<button type='button' id='{elementId}'>{buttonText}</button>";
 
         var NAME_REGEX = /{name}/g;        
         var VALUE_REGEX = /{value}/g;
@@ -48,6 +47,7 @@ var rave = rave || (function() {
         var ELEMENT_ID_REGEX = /{elementId}/g;
         var PREF_LABEL_TEMPLATE_REGEX = /{prefLabelTemplate}/g;
         var CLASS_REGEX = /{class}/g;
+        var BUTTON_TEXT_REGEX = /{buttonText}/g;
         
         var WIDGET_PREFS_LABEL_CLASS = "widget-prefs-label";
         var WIDGET_PREFS_LABEL_REQUIRED_CLASS = "widget-prefs-label-required";
@@ -159,8 +159,7 @@ var rave = rave || (function() {
                 var widget = rave.getRegionWidgetById(widgetId);
                             
                 // init the collapse/restore toggle for the title bar                
-                $(this).find(".widget-title-bar-mobile").click({id: widgetId}, toggleCollapseAction); 
-                $(this).find(".widget-title-bar-mobile").bind( "touchstart", function(e){alert('Span Clicked!')});
+                $(this).find(".widget-title-bar-mobile").click({id: widgetId}, toggleCollapseAction);
             });
         }
         
@@ -376,16 +375,15 @@ var rave = rave || (function() {
             
             // if this widget has one or more required inputs display the helper message
             if (hasRequiredUserPrefs) {
-                prefsFormMarkup.push("<tr><td colspan='2' class='widget-prefs-required-text'>* indicates a required input</td></tr>");
+                prefsFormMarkup.push("<tr><td colspan='2' class='widget-prefs-required-text'>" + rave.getClientMessage("widget.prefs.required.title") + "</td></tr>");
             }
 
             prefsFormMarkup.push("<tr><td colspan='2'>");
-            prefsFormMarkup.push(PREFS_SAVE_BUTTON_TEMPLATE.replace(ELEMENT_ID_REGEX,
-                    WIDGET_PREFS_SAVE_BUTTON(regionWidget.regionWidgetId)));
-            prefsFormMarkup.push(PREFS_CANCEL_BUTTON_TEMPLATE.replace(ELEMENT_ID_REGEX,
-                    WIDGET_PREFS_CANCEL_BUTTON(regionWidget.regionWidgetId)));
+            prefsFormMarkup.push(PREFS_SAVE_BUTTON_TEMPLATE.replace(ELEMENT_ID_REGEX, WIDGET_PREFS_SAVE_BUTTON(regionWidget.regionWidgetId))
+                                                           .replace(BUTTON_TEXT_REGEX, rave.getClientMessage("common.save")));
+            prefsFormMarkup.push(PREFS_CANCEL_BUTTON_TEMPLATE.replace(ELEMENT_ID_REGEX, WIDGET_PREFS_CANCEL_BUTTON(regionWidget.regionWidgetId))
+                                                             .replace(BUTTON_TEXT_REGEX, rave.getClientMessage("common.cancel")));
             prefsFormMarkup.push("</td></tr>");
-
             prefsFormMarkup.push("</table>");
 
             var prefsElement = $("#" + WIDGET_PREFS_CONTENT(regionWidget.regionWidgetId));
@@ -549,7 +547,7 @@ var rave = rave || (function() {
                 }
                 html+="</ul>";
 
-                $("<div class='dialog widget-users-dialog' title='" + $("#widget-" + widgetId + "-title").text().trim() + " has been added by...'>" + html + "</div>").dialog({
+                $("<div class='dialog widget-users-dialog' title='" + $("#widget-" + widgetId + "-title").text().trim() + " " + rave.getClientMessage("widget.users.added_by") + "'>" + html + "</div>").dialog({
                     modal: true,
                     buttons: [{text: "Close", click: function(){$(this).dialog("close");}}]
                 });
@@ -584,6 +582,14 @@ var rave = rave || (function() {
 
     })();
 
+    function getClientMessage(key) {
+        return clientMessages[key];
+    }
+
+    function addClientMessage(key, message) {
+        return clientMessages[key] = message;
+    }
+
     function registerWidget(widgetsByRegionIdMap, regionId, widget) {
         if (!widgetsByRegionIdMap.hasOwnProperty(regionId)) {
             widgetsByRegionIdMap[regionId] = [];
@@ -652,7 +658,7 @@ var rave = rave || (function() {
         }
         var provider = providerMap[widget.type];
         if (typeof provider == "undefined") {
-            renderErrorWidget(widget.regionWidgetId, WIDGET_PROVIDER_ERROR);
+            renderErrorWidget(widget.regionWidgetId, rave.getClientMessage("widget.provider.error"));
         } else {
             provider.initWidget(widget);
         }
@@ -912,6 +918,21 @@ var rave = rave || (function() {
          * Displays an info message at the top of the page.
          * @param message The message to display.
          */
-        showInfoMessage: ui.showInfoMessage
+        showInfoMessage: ui.showInfoMessage,
+
+        /**
+         * Returns a language specific message based on the supplied key
+         *
+         * @param key the key of the message
+         */
+        getClientMessage: getClientMessage,
+
+        /**
+         * Adds a message to the internal client message map
+         *
+         * @param key
+         * @param message
+         */
+        addClientMessage: addClientMessage
     }
 })();

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_api.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_api.js?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_api.js (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_api.js Fri Jan 13 21:59:28 2012
@@ -23,7 +23,7 @@ var rave = rave || {};
  */
 rave.api = rave.api || (function() {
     function handleError(jqXhr, status, error) {
-        alert("Rave encountered an error while trying to contact the server.  Please reload the page and try again. error: " + error);
+        alert(rave.getClientMessage("api.error") + error);
     }
 
     var restApi = (function() {
@@ -252,13 +252,13 @@ rave.api = rave.api || (function() {
                     if (result.error) {
                         handleRpcError(result);
                     } else {
-                        var widgetTitle = "The widget";
+                        var widgetTitle = rave.getClientMessage("widget.add_prefix");
                         var addedWidget = result.result != undefined ? result.result.widget : undefined;
 
                         if (addedWidget != undefined && addedWidget.title != undefined && addedWidget.title.length > 0) {
                             widgetTitle = addedWidget.title;
                         }
-                        rave.showInfoMessage(widgetTitle + " has been added to your page");
+                        rave.showInfoMessage(widgetTitle + rave.getClientMessage("widget.add_suffix"));
                     }
                 }).error(handleError);
         }
@@ -287,7 +287,7 @@ rave.api = rave.api || (function() {
                     if (result.error) {
                         // check to see if a duplicate page name error occurred
                         if (result.errorCode == 'DUPLICATE_ITEM') {                        
-                            $("#pageFormErrors").html("A page with that name already exists");
+                            $("#pageFormErrors").html(rave.getClientMessage("page.duplicate_name"));
                         } else {                        
                             handleRpcError(result);
                         }
@@ -373,12 +373,10 @@ rave.api = rave.api || (function() {
                 case "NO_ERROR" :
                     break;
                 case "INVALID_PARAMS":
-                    alert("Rave attempted to update the server with your recent changes, " +
-                        " but the changes were rejected by the server as invalid.");
+                    alert(rave.getClientMessage("api.rpc.error.invalid_params"));
                     break;
                 case "INTERNAL_ERROR":
-                    alert("Rave attempted to update the server with your recent changes, " +
-                        " but the server encountered an internal error.");
+                    alert(rave.getClientMessage("api.rpc.error.internal"));
                     break;                
             }
         }
@@ -387,14 +385,14 @@ rave.api = rave.api || (function() {
             var url = args.url;
             var providerType = args.providerType;
             if ( url == null || providerType == null ) {
-                alert('Both url and type are needed to get the metadata');
+                alert(rave.getClientMessage("api.widget_metadata.invalid_params"));
                 return;
             }
             $.post(rave.getContext() + path + "widget/metadata/get",
                {"url": url, "type": providerType},
                function(result) {
                    if (result.error) {
-                       alert("Unable to parse Widget for its metadata.\n\nPlease verify that the url is pointing to a valid Widget of the type specified.");
+                       alert(rave.getClientMessage("api.widget_metadata.parse_error"));
                    }
                    else {
                        if (typeof args.successCallback == 'function') {

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_forms.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_forms.js?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_forms.js (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_forms.js Fri Jan 13 21:59:28 2012
@@ -42,7 +42,7 @@ rave.forms = rave.forms || (function() {
             },
             messages: {
                 confirmPassword: {
-                    equalTo: "The password does not match"
+                    equalTo: rave.getClientMessage("form.password.invalid_match")
                 }
             }
         });
@@ -63,7 +63,7 @@ rave.forms = rave.forms || (function() {
             },
             messages: {
                 passwordConfirm: {
-                    equalTo: "The password does not match"
+                    equalTo: rave.getClientMessage("form.password.invalid_match")
                 }
             }
         });
@@ -81,7 +81,7 @@ rave.forms = rave.forms || (function() {
 
     return {
         validateNewAccountForm : validateNewAccountForm,
-	validateUserProfileForm: validateUserProfileForm,
+	    validateUserProfileForm: validateUserProfileForm,
         validatePageForm: validatePageForm
     };
 })();

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_layout.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_layout.js?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_layout.js (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_layout.js Fri Jan 13 21:59:28 2012
@@ -20,42 +20,71 @@
 var rave = rave || {};
 rave.layout = rave.layout || (function() {
     var MOVE_PAGE_DEFAULT_POSITION_IDX = -1;
+    var $dialog;
+    var $movePageDialog;
+    var $moveWidgetDialog;
     
     var $tab_title_input = $("#tab_title"),
         $tab_id = $("#tab_id"),
         $page_layout_input = $("#pageLayout");
+
+    // define the form object    
+    var $form = $("#pageForm", $dialog);  
+    
+    // page menu related functions
+    var pageMenu = (function() {
+        var $button = $("#pageMenuButton");
+        var $menu = $("#pageMenu");
+        var $menuItemEdit = $("#pageMenuEdit");
+        var $menuItemDelete = $("#pageMenuDelete");
+        var $menuItemMove = $("#pageMenuMove");
+                        
+        function hideMenu() {
+            $menu.hide();
+        }
         
-    // modal dialog init: custom buttons and a "close" callback reseting the form inside
-    var $dialog = $( "#dialog" ).dialog({
-            autoOpen: false,
-            modal: true,
-            buttons: [
-                {
-                    text: "Add",
-                    id: "AddPageBtn",
-                    click: function() {
-                        addPage();
-                    }
-                },
-                {
-                    text: "Update",
-                    id: "UpdatePageBtn",
-                    click: function() {
-                        updatePage();
-                    }
-                },
-                {
-                    text: "Cancel",
-                    id: "CancelPageBtn",
-                    click: function() {
-                        $(this).dialog("close");
+        function showMenu() {
+            $menu.show();
+        }
+        
+        /**
+         * Initializes the private pageMenu closure
+         * - binds click event handler to menu button
+         * - binds menu item click event handlers
+         * - binds body click event handler to close the menu
+         */
+        function init() {
+            // modal dialog init: custom buttons and a "close" callback reseting the form inside
+            $dialog = $( "#dialog" ).dialog({
+                autoOpen: false,
+                modal: true,
+                buttons: [
+                    {
+                        text: rave.getClientMessage("common.add"),
+                        id: "AddPageBtn",
+                        click: function() {
+                            addPage();
+                        }
+                    },
+                    {
+                        text: rave.getClientMessage("common.update"),
+                        id: "UpdatePageBtn",
+                        click: function() {
+                            updatePage();
+                        }
+                    },
+                    {
+                        text: rave.getClientMessage("common.cancel"),
+                        id: "CancelPageBtn",
+                        click: function() {
+                            $(this).dialog("close");
+                        }
                     }
-                }
-            ],
-            open: function(event, ui) {
+                ],
+                open: function(event, ui) {
                     $dialog.unbind("submit");
                     if ($tab_id.val() == '') {
-                        $("#"+this.id).dialog("option", "title", "Add a New Page");
+                        $("#"+this.id).dialog("option", "title", rave.getClientMessage("page.add"));
                         $("#UpdatePageBtn").hide();
                         $("#AddPageBtn").show();
                         $dialog.submit(function() {
@@ -64,7 +93,7 @@ rave.layout = rave.layout || (function()
                         });
                     }
                     else {
-                        $("#"+this.id).dialog("option", "title", "Update Page");
+                        $("#"+this.id).dialog("option", "title", rave.getClientMessage("page.update"));
                         $("#UpdatePageBtn").show();
                         $("#AddPageBtn").hide();
                         $dialog.submit(function() {
@@ -73,66 +102,66 @@ rave.layout = rave.layout || (function()
                         });
 
                     }
-            },
-            close: function() {
+                },
+                close: function() {
                     $form[ 0 ].reset();
                     $tab_id.val('');
                     $("#pageFormErrors").html("");
-            }
-    });
+                }
+            });
 
-    // the modal dialog for moving a page
-    var $movePageDialog = $("#movePageDialog").dialog({
-            autoOpen: false,
-            modal: true,
-            buttons: [
-                {
-                    text: "Move",
-                    click: function() {
-                        movePage();
+            // the modal dialog for moving a page
+            $movePageDialog = $("#movePageDialog").dialog({
+                autoOpen: false,
+                modal: true,
+                buttons: [
+                    {
+                        text: rave.getClientMessage("common.move"),
+                        click: function() {
+                            movePage();
+                        }
+                    },
+                    {
+                        text: rave.getClientMessage("common.cancel"),
+                        click: function() {
+                            $( this ).dialog( "close" );
+                        }
                     }
+                ],
+                open: function() {
+                    $("#moveAfterPageId").focus();
                 },
-                {
-                    text: "Cancel",
-                    click: function() {
-                        $( this ).dialog( "close" );
+                close: function() {
+                    $("#movePageForm")[0].reset();
+                }
+            });
+
+            // the modal dialog for moving a widget
+            $moveWidgetDialog = $("#moveWidgetDialog").dialog({
+                autoOpen: false,
+                modal: true,
+                buttons: [
+                    {
+                        text: rave.getClientMessage("common.move"),
+                        click: function() {
+                            moveWidgetToPage($(this).data('regionWidgetId'));
+                        }
+                    },
+                    {
+                        text: rave.getClientMessage("common.cancel"),
+                        click: function() {
+                            $(this).dialog("close");
+                        }
                     }
+                ],
+                open: function() {
+                    $("#moveToPageId").focus();
+                },
+                close: function() {
+                    $("#moveWidgetForm")[0].reset();
                 }
-            ],
-            open: function() {
-                    $("#moveAfterPageId").focus();
-            },
-            close: function() {
-                    $("#movePageForm")[0].reset();                    
-            }
-    });        
-   
-    // define the form object    
-    var $form = $("#pageForm", $dialog);  
-    
-    // page menu related functions
-    var pageMenu = (function() {
-        var $button = $("#pageMenuButton");
-        var $menu = $("#pageMenu");
-        var $menuItemEdit = $("#pageMenuEdit");
-        var $menuItemDelete = $("#pageMenuDelete");
-        var $menuItemMove = $("#pageMenuMove");
-                        
-        function hideMenu() {
-            $menu.hide();
-        }
-        
-        function showMenu() {
-            $menu.show();
-        }
-        
-        /**
-         * Initializes the private pageMenu closure
-         * - binds click event handler to menu button
-         * - binds menu item click event handlers
-         * - binds body click event handler to close the menu
-         */
-        function init() {
+            });
+
             // initialize the page menu and button
             $button.bind('click', function(event) {  
                 $menu.toggle();
@@ -192,34 +221,6 @@ rave.layout = rave.layout || (function()
         }
     })();
 
-
-    // the modal dialog for moving a widget
-    var $moveWidgetDialog = $("#moveWidgetDialog").dialog({
-            autoOpen: false,
-            modal: true,
-            buttons: [
-                {
-                    text: "Move",
-                    click: function() {
-                        moveWidgetToPage($(this).data('regionWidgetId'));
-                    }
-                },
-                {
-                    text: "Cancel",
-                    click: function() {
-                        $(this).dialog("close");
-                    }
-                }
-            ],
-            open: function() {
-                    $("#moveToPageId").focus();
-            },
-            close: function() {
-                    $("#moveWidgetForm")[0].reset();
-            }
-    });
-
-
     // widget menu related functions
     var widgetMenu = (function() {
         var $menu;
@@ -440,12 +441,11 @@ rave.layout = rave.layout || (function()
     
     /**
      * Invokes the RPC call to delete a regionWidget from a page
-     * TODO: RAVE-299 - how can we load the confirmation text from the message bundles 
-     * 
+     *
      * @param regionWidgetId the regionWidgetId to delete
      */
     function deleteRegionWidget(regionWidgetId) {
-        if (confirm("Are you sure you want to remove this widget from your page?")) {
+        if (confirm(rave.getClientMessage("widget.remove_confirm"))) {
             rave.api.rpc.removeWidget({
                 regionWidgetId: regionWidgetId,
                 successCallback: function() {

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_opensocial.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_opensocial.js?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_opensocial.js (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_opensocial.js Fri Jan 13 21:59:28 2012
@@ -102,7 +102,7 @@ rave.opensocial = rave.opensocial || (fu
             container.preloadCaches(preloadConfig);
             renderNewGadget(gadget);
         } else {
-            rave.errorWidget(gadget.regionWidgetId, "Unable to render OpenSocial Gadget: <br /><br />" + validationResult.error);
+            rave.errorWidget(gadget.regionWidgetId, rave.getClientMessage("opensocial.render_error") +  "<br /><br />" + validationResult.error);
         }
     }
 

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_store.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_store.js?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_store.js (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_store.js Fri Jan 13 21:59:28 2012
@@ -114,7 +114,7 @@ rave.store = rave.store || (function() {
                modal: true,
                buttons : [
                     {
-                        text : "Update",
+                        text : rave.getClientMessage("common.update"),
                         click : function() {
                            rave.api.rest.updateWidgetComment({widgetId: widgetId,
                                                             commentId: commentId,

Modified: incubator/rave/trunk/rave-portal-resources/src/test/javascript/raveApiSpec.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/test/javascript/raveApiSpec.js?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/test/javascript/raveApiSpec.js (original)
+++ incubator/rave/trunk/rave-portal-resources/src/test/javascript/raveApiSpec.js Fri Jan 13 21:59:28 2012
@@ -339,6 +339,7 @@ describe("Rave API", function() {
 
         describe("Error handling", function() {
             it("displays the appropriate alert when invalid parameters are passed", function() {
+                var errorText = "Rave attempted to update the server with your recent changes, but the changes were rejected by the server as invalid.";
 
                 $.post = function(url, data, handler) {
                     handler({error: true, errorCode: "INVALID_PARAMS"});
@@ -348,15 +349,16 @@ describe("Rave API", function() {
                     }
                 };
                 alert = function(str) {
-                    expect(str).toEqual("Rave attempted to update the server with your recent changes, " +
-                        " but the changes were rejected by the server as invalid.");
+                    expect(str).toEqual(errorText);
                 };
+
+                rave.addClientMessage("api.rpc.error.invalid_params", errorText);
                 rave.api.rpc.moveWidget({targetRegion: {id:"region-1"}, currentRegion: {id:"region-2"}, targetIndex: 3, widget:{id:"widget-3-body"}});
 
             });
 
             it("displays the appropriate alert when a server error occurs", function() {
-
+                var errorText = "Rave attempted to update the server with your recent changes, but the server encountered an internal error.";
                 $.post = function(url, data, handler) {
                     handler({error: true, errorCode: "INTERNAL_ERROR"});
                     return {
@@ -365,9 +367,9 @@ describe("Rave API", function() {
                     }
                 };
                 alert = function(str) {
-                    expect(str).toEqual("Rave attempted to update the server with your recent changes, " +
-                        " but the server encountered an internal error.");
+                    expect(str).toEqual(errorText);
                 };
+                rave.addClientMessage("api.rpc.error.internal", errorText);
                 rave.api.rpc.moveWidget({targetRegion: {id:"region-1"}, currentRegion: {id:"region-2"}, targetIndex: 3, widget:{id:"widget-3-body"}});
             });
         });

Modified: incubator/rave/trunk/rave-portal-resources/src/test/javascript/raveSpec.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/test/javascript/raveSpec.js?rev=1231324&r1=1231323&r2=1231324&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/test/javascript/raveSpec.js (original)
+++ incubator/rave/trunk/rave-portal-resources/src/test/javascript/raveSpec.js Fri Jan 13 21:59:28 2012
@@ -42,6 +42,16 @@ describe("Rave", function() {
         })();
     }
 
+    describe("client message add and get", function() {
+        it("adds a client message to the internal map based on a key and verifies it can be returned via getter", function() {
+            var theKey = "myKey";
+            var theMessage = "my message";
+            expect(rave.getClientMessage(theKey)).toEqual(null);
+            rave.addClientMessage(theKey, theMessage);
+            expect(rave.getClientMessage(theKey)).toEqual(theMessage);
+        });
+    });
+
     describe("initProviders", function() {
 
         it("initializes all providers", function() {
@@ -205,6 +215,7 @@ describe("Rave", function() {
             var provider2 = getMockProvider("BAR");
             rave.registerProvider(provider1);
             rave.registerProvider(provider2);
+            rave.addClientMessage("widget.provider.error", "This widget type is currently unsupported.  Check with your administrator and be sure the correct provider is registered.");
             rave.initWidgets(widgetsByRegionIdMap);
             expect($().expression()).toEqual("#widget-43-body");
             expect($().html()).toEqual("This widget type is currently unsupported.  Check with your administrator and be sure the correct provider is registered.");
@@ -328,7 +339,10 @@ describe("Rave", function() {
             sortableArgs.stop({}, mockItem);
         });
         it("displays the appropriate alert when invalid parameters are passed", function() {
+            var errorText = "Rave attempted to update the server with your recent changes, but the changes were rejected by the server as invalid.";
             createMockJQuery();
+
+            rave.addClientMessage("api.rpc.error.invalid_params", errorText);
             rave.initUI();
             var sortableArgs = $().getSortableArgs();
             var mockItem = getMockItem();
@@ -339,14 +353,16 @@ describe("Rave", function() {
                     }
             };
             alert = function(str) {
-                expect(str).toEqual("Rave attempted to update the server with your recent changes, " +
-                              " but the changes were rejected by the server as invalid.");
+                expect(str).toEqual(errorText);
             };
             sortableArgs.start({}, mockItem);
             sortableArgs.stop({}, mockItem);
         });
         it("displays the appropriate alert when a server error occurs", function() {
+            var errorText = "Rave attempted to update the server with your recent changes, but the server encountered an internal error.";
             createMockJQuery();
+
+            rave.addClientMessage("api.rpc.error.internal", errorText);
             rave.initUI();
             var sortableArgs = $().getSortableArgs();
             var mockItem = getMockItem();
@@ -358,8 +374,7 @@ describe("Rave", function() {
                     }
             };
             alert = function(str) {
-                expect(str).toEqual("Rave attempted to update the server with your recent changes, " +
-                              " but the server encountered an internal error.");
+                expect(str).toEqual(errorText);
             };
             sortableArgs.start({}, mockItem);
             sortableArgs.stop({}, mockItem);



Mime
View raw message