[kune-commits] r1548 - in trunk/src: main/java/cc/kune/domain main/java/cc/kune/gspace/client/i18n test/java/cc/kune/core/server/manager
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Sun Oct 9 12:59:29 CEST 2011
Author: vjrj_
Date: 2011-10-09 12:59:28 +0200 (Sun, 09 Oct 2011)
New Revision: 1548
Added:
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorSaver.java
Removed:
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTraslatorSaver.java
Modified:
trunk/src/main/java/cc/kune/domain/I18nTranslation.java
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nCellList.java
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java
trunk/src/test/java/cc/kune/core/server/manager/I18nManagerDefaultTest.java
Log:
NEW - # 138: Add change password functionality to the User Interface
http://kune.ourproject.org/issues/ticket/138
Modified: trunk/src/main/java/cc/kune/domain/I18nTranslation.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/I18nTranslation.java 2011-10-08 23:47:25 UTC (rev 1547)
+++ trunk/src/main/java/cc/kune/domain/I18nTranslation.java 2011-10-09 10:59:28 UTC (rev 1548)
@@ -85,7 +85,7 @@
private String type;
public I18nTranslation() {
- this(null, null, null, null, null, null, null, null, null, null);
+ this(null, null, null, null, null, "", null, null, null, null);
}
public I18nTranslation(final I18nLanguage language, final String text, final I18nTranslation parent,
Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nCellList.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nCellList.java 2011-10-08 23:47:25 UTC (rev 1547)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nCellList.java 2011-10-09 10:59:28 UTC (rev 1548)
@@ -126,7 +126,7 @@
@Inject
public I18nCellList(final I18nTranslationDataProvider data, final I18nUITranslationService i18n,
- final I18nTraslatorSaver saver) {
+ final I18nTranslatorSaver saver) {
this.data = data;
final TranslationCell cell = new TranslationCell();
Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java 2011-10-08 23:47:25 UTC (rev 1547)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java 2011-10-09 10:59:28 UTC (rev 1548)
@@ -59,7 +59,7 @@
Label noteForTranslators;
@UiField
Label noteForTranslatorsTittle;
- private I18nTraslatorSaver saver;
+ private I18nTranslatorSaver saver;
@UiField
Label toLanguageTitle;
@UiField
@@ -122,7 +122,7 @@
}
public void init(final I18nTranslationDataProvider dataProvider, final I18nTranslationService i18n,
- final I18nTraslatorSaver saver) {
+ final I18nTranslatorSaver saver) {
this.dataProvider = dataProvider;
this.i18n = i18n;
this.saver = saver;
Copied: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorSaver.java (from rev 1546, trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTraslatorSaver.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorSaver.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorSaver.java 2011-10-09 10:59:28 UTC (rev 1548)
@@ -0,0 +1,53 @@
+package cc.kune.gspace.client.i18n;
+
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.errors.AccessViolationException;
+import cc.kune.core.client.i18n.I18nUITranslationService;
+import cc.kune.core.client.rpcservices.I18nServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.dto.I18nTranslationDTO;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class I18nTranslatorSaver {
+ private final I18nUITranslationService i18n;
+ private final Provider<I18nServiceAsync> i18nService;
+ private final Session session;
+
+ @Inject
+ public I18nTranslatorSaver(final Session session, final Provider<I18nServiceAsync> i18nService,
+ final I18nUITranslationService i18n) {
+ this.session = session;
+ this.i18nService = i18nService;
+ this.i18n = i18n;
+ }
+
+ public void save(final I18nTranslationDTO item) {
+ NotifyUser.showProgress(i18n.t("Saving"));
+ i18nService.get().setTranslation(session.getUserHash(), item.getId(), item.getText(),
+ new AsyncCallback<String>() {
+ @Override
+ public void onFailure(final Throwable caught) {
+ NotifyUser.hideProgress();
+ if (caught instanceof AccessViolationException) {
+ NotifyUser.error(
+ i18n.t("Only to authorized translators"),
+ i18n.t("To help with the translation of this software please contact before with this site administrators"));
+ } else {
+ NotifyUser.error(i18n.t("Server error saving the translation"));
+ }
+ }
+
+ @Override
+ public void onSuccess(final String result) {
+ NotifyUser.hideProgress();
+ i18n.setTranslationAfterSave(item.getTrKey(), result);
+ }
+ });
+ }
+
+}
Deleted: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTraslatorSaver.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTraslatorSaver.java 2011-10-08 23:47:25 UTC (rev 1547)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTraslatorSaver.java 2011-10-09 10:59:28 UTC (rev 1548)
@@ -1,53 +0,0 @@
-package cc.kune.gspace.client.i18n;
-
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.core.client.errors.AccessViolationException;
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.rpcservices.I18nServiceAsync;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.shared.dto.I18nTranslationDTO;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.Singleton;
-
- at Singleton
-public class I18nTraslatorSaver {
- private final I18nUITranslationService i18n;
- private final Provider<I18nServiceAsync> i18nService;
- private final Session session;
-
- @Inject
- public I18nTraslatorSaver(final Session session, final Provider<I18nServiceAsync> i18nService,
- final I18nUITranslationService i18n) {
- this.session = session;
- this.i18nService = i18nService;
- this.i18n = i18n;
- }
-
- public void save(final I18nTranslationDTO item) {
- NotifyUser.showProgress(i18n.t("Saving"));
- i18nService.get().setTranslation(session.getUserHash(), item.getId(), item.getText(),
- new AsyncCallback<String>() {
- @Override
- public void onFailure(final Throwable caught) {
- NotifyUser.hideProgress();
- if (caught instanceof AccessViolationException) {
- NotifyUser.error(
- i18n.t("Only to authorized translators"),
- i18n.t("To help with the translation of this software please contact before with this site administrators"));
- } else {
- NotifyUser.error(i18n.t("Server error saving the translation"));
- }
- }
-
- @Override
- public void onSuccess(final String result) {
- NotifyUser.hideProgress();
- i18n.setTranslationAfterSave(item.getTrKey(), result);
- }
- });
- }
-
-}
Modified: trunk/src/test/java/cc/kune/core/server/manager/I18nManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/manager/I18nManagerDefaultTest.java 2011-10-08 23:47:25 UTC (rev 1547)
+++ trunk/src/test/java/cc/kune/core/server/manager/I18nManagerDefaultTest.java 2011-10-09 10:59:28 UTC (rev 1548)
@@ -62,6 +62,11 @@
}
@Test
+ public void emptyI18n() {
+ new I18nTranslation();
+ }
+
+ @Test
public void getLexiconList() {
assertTrue(translationManager.getTranslatedLexicon("en").size() > 0);
assertTrue(translationManager.getUntranslatedLexicon("en").size() == 0);
More information about the kune-commits
mailing list