[kune-commits] r1484 - in trunk/src/main/java: cc/kune/common/client/actions/gwtui cc/kune/common/client/ui/dialogs/tabbed cc/kune/core/client/sitebar cc/kune/core/client/state cc/kune/core/public cc/kune/gspace/client cc/kune/gspace/client/i18n cc/kune/gspace/client/options cc/kune/gspace/client/viewers org/ourproject/kune/app/public/html org/ourproject/kune/workspace/client/i18n

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Sat Aug 6 20:27:37 CEST 2011


Author: vjrj_
Date: 2011-08-06 20:27:37 +0200 (Sat, 06 Aug 2011)
New Revision: 1484

Added:
   trunk/src/main/java/cc/kune/core/public/i18n-recom.html
   trunk/src/main/java/cc/kune/gspace/client/i18n/I18nToTranslateGridPanel.java
   trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslateRecomendPanel.java
   trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatedGridPanel.java
Removed:
   trunk/src/main/java/org/ourproject/kune/app/public/html/i18n-recom.html
Modified:
   trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java
   trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java
   trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java
   trunk/src/main/java/cc/kune/core/public/ws.css
   trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
   trunk/src/main/java/cc/kune/gspace/client/i18n/I18nNewTranslatorPanel.java
   trunk/src/main/java/cc/kune/gspace/client/i18n/I18nNewTranslatorPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslator.java
   trunk/src/main/java/cc/kune/gspace/client/i18n/LanguageSelectorPanel.java
   trunk/src/main/java/cc/kune/gspace/client/i18n/SiteOptionsI18nTranslatorAction.java
   trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
Log:
NEW - # 79: I18n refactorization 
http://kune.ourproject.org/issues/ticket/79

Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtButtonGui.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -114,7 +114,7 @@
   @Override
   public void setEnabled(final boolean enabled) {
     button.setEnabled(enabled);
-    button.getElement().getStyle().setOpacity(enabled ? 1d : 0.5d);
+    button.getElement().getStyle().setOpacity(enabled ? 1d : 0.6d);
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -32,10 +32,12 @@
 import com.google.gwt.event.logical.shared.HasCloseHandlers;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.user.client.ui.DecoratedTabPanel;
+import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
 import com.google.gwt.user.client.ui.IsWidget;
 import com.google.gwt.user.client.ui.Widget;
 
 public abstract class AbstractTabbedDialogPanel implements AbstractTabbedDialogView {
+  private final boolean authohide;
   private BasicTopDialog dialog;
   private final String dialogId;
   private final String errorLabelId;
@@ -54,9 +56,9 @@
   private int width;
 
   public AbstractTabbedDialogPanel(final String dialogId, final String title, final boolean modal,
-      final NotifyLevelImages images, final String errorLabelId, final String firstBtnTitle,
-      final String firstBtnId, final String sndBtnTitle, final String sndBtnId,
-      final ProvidersCollection provCollection) {
+      final boolean authoHide, final NotifyLevelImages images, final String errorLabelId,
+      final String firstBtnTitle, final String firstBtnId, final String sndBtnTitle,
+      final String sndBtnId, final ProvidersCollection provCollection) {
     this.dialogId = dialogId;
     this.title = title;
     this.modal = modal;
@@ -67,16 +69,33 @@
     this.sndBtnTitle = sndBtnTitle;
     this.sndBtnId = sndBtnId;
     this.provCollection = provCollection;
+    this.authohide = authoHide;
   }
 
+  public AbstractTabbedDialogPanel(final String dialogId, final String title, final boolean modal,
+      final NotifyLevelImages images, final String errorLabelId, final String firstBtnTitle,
+      final String firstBtnId, final String sndBtnTitle, final String sndBtnId,
+      final ProvidersCollection provCollection) {
+    this(dialogId, title, modal, false, images, errorLabelId, firstBtnTitle, firstBtnId, sndBtnTitle,
+        sndBtnId, provCollection);
+  }
+
   public AbstractTabbedDialogPanel(final String dialogId, final String title, final int width,
+      final int height, final boolean modal, final boolean autoHide, final NotifyLevelImages images,
+      final String errorLabelId, final String firstBtnTitle, final String firstBtnId,
+      final String sndBtnTitle, final String sndBtnId, final ProvidersCollection provCollection) {
+    this(dialogId, title, modal, autoHide, images, errorLabelId, firstBtnTitle, firstBtnId, sndBtnTitle,
+        sndBtnId, provCollection);
+    this.width = width;
+    this.height = height;
+  }
+
+  public AbstractTabbedDialogPanel(final String dialogId, final String title, final int width,
       final int height, final boolean modal, final NotifyLevelImages images, final String errorLabelId,
       final String firstBtnTitle, final String firstBtnId, final String sndBtnTitle,
       final String sndBtnId, final ProvidersCollection provCollection) {
-    this(dialogId, title, modal, images, errorLabelId, firstBtnTitle, firstBtnId, sndBtnTitle, sndBtnId,
-        provCollection);
-    this.width = width;
-    this.height = height;
+    this(dialogId, title, width, height, modal, false, images, errorLabelId, firstBtnTitle, firstBtnId,
+        sndBtnTitle, sndBtnId, provCollection);
   }
 
   @Override
@@ -98,11 +117,12 @@
   }
 
   private void createDialog() {
-    dialog = new BasicTopDialog.Builder(dialogId, true, modal).autoscroll(true).width(width).height(
+    dialog = new BasicTopDialog.Builder(dialogId, authohide, modal).autoscroll(true).width(width).height(
         height).icon(iconCls).firstButtonId(firstBtnId).firstButtonTitle(firstBtnTitle).sndButtonId(
         dialogId).sndButtonTitle(sndBtnTitle).sndButtonId(sndBtnId).title(title).build();
     messageErrorBar = new MessageToolbar(images, errorLabelId);
     tabPanel = new DecoratedTabPanel();
+    provCollection.createAll();
     tabPanel.getDeckPanel().setSize(String.valueOf(width), String.valueOf(height));
     dialog.getInnerPanel().add(tabPanel);
     dialog.getFirstBtn().addClickHandler(new ClickHandler() {
@@ -111,7 +131,6 @@
         hide();
       }
     });
-    provCollection.createAll();
   }
 
   private void createDialogIfNecessary() {
@@ -138,6 +157,11 @@
     return dialog.getFirstBtn();
   }
 
+  public ForIsWidget getInnerPanel() {
+    createDialogIfNecessary();
+    return dialog.getInnerPanel();
+  }
+
   public HasClickHandlers getSecondBtn() {
     createDialogIfNecessary();
     return dialog.getSecondBtn();

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -107,7 +107,8 @@
     participant.setTarget(group);
     participant.putValue(Action.NAME, group.getLongName());
     participant.putValue(Action.SMALL_ICON, logoImageUrl);
-    participant.setParent(partiMenu);
+    participant.setParent(partiMenu, false);
+    siteOptions.getRightToolbar().add(participant);
   }
 
   private void createActions() {

Modified: trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -27,67 +27,79 @@
 import cc.kune.core.client.sitebar.AboutKuneDialog;
 import cc.kune.core.client.sitebar.spaces.Space;
 import cc.kune.core.client.sitebar.spaces.SpaceSelectEvent;
+import cc.kune.gspace.client.i18n.I18nTranslator;
 
 import com.google.gwt.event.shared.EventBus;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
 
+ at SuppressWarnings("serial")
 public class SiteTokenListeners extends HashMap<String, HistoryTokenCallback> {
-    private final Provider<AboutKuneDialog> aboutKuneDialog;
-    private final EventBus eventBus;
-    private final Provider<NewGroup> newGroup;
-    private final Provider<Register> register;
-    private final Provider<SignIn> signIn;
+  private final Provider<AboutKuneDialog> aboutKuneDialog;
+  private final EventBus eventBus;
+  private final Provider<NewGroup> newGroup;
+  private final Provider<Register> register;
+  private final Provider<SignIn> signIn;
+  private final Provider<I18nTranslator> translator;
 
-    @Inject
-    public SiteTokenListeners(final Session session, final EventBus eventBus, final Provider<SignIn> signIn,
-            final Provider<Register> register, final Provider<NewGroup> newGroup,
-            final Provider<AboutKuneDialog> aboutKuneDialog) {
-        this.eventBus = eventBus;
-        this.signIn = signIn;
-        this.register = register;
-        this.newGroup = newGroup;
-        this.aboutKuneDialog = aboutKuneDialog;
-        init();
-    }
+  @Inject
+  public SiteTokenListeners(final Session session, final EventBus eventBus,
+      final Provider<SignIn> signIn, final Provider<Register> register,
+      final Provider<NewGroup> newGroup, final Provider<AboutKuneDialog> aboutKuneDialog,
+      final Provider<I18nTranslator> translator) {
+    this.eventBus = eventBus;
+    this.signIn = signIn;
+    this.register = register;
+    this.newGroup = newGroup;
+    this.aboutKuneDialog = aboutKuneDialog;
+    this.translator = translator;
+    putValues();
+  }
 
-    private void init() {
-        put(SiteTokens.HOME, new HistoryTokenCallback() {
-            @Override
-            public void onHistoryToken() {
-                SpaceSelectEvent.fire(eventBus, Space.homeSpace);
-            }
-        });
-        put(SiteTokens.WAVEINBOX, new HistoryTokenCallback() {
-            @Override
-            public void onHistoryToken() {
-                SpaceSelectEvent.fire(eventBus, Space.userSpace);
-            }
-        });
-        put(SiteTokens.SIGNIN, new HistoryTokenCallback() {
-            @Override
-            public void onHistoryToken() {
-                signIn.get().showSignInDialog();
-            }
-        });
-        put(SiteTokens.REGISTER, new HistoryTokenCallback() {
-            @Override
-            public void onHistoryToken() {
-                register.get().doRegister();
-            }
-        });
-        put(SiteTokens.NEWGROUP, new HistoryTokenCallback() {
-            @Override
-            public void onHistoryToken() {
-                newGroup.get().doNewGroup();
-            }
-        });
-        put(SiteTokens.ABOUTKUNE, new HistoryTokenCallback() {
-            @Override
-            public void onHistoryToken() {
-                // FIXME, something to come back
-                aboutKuneDialog.get().showCentered();
-            }
-        });
-    }
+  private void putValues() {
+    put(SiteTokens.HOME, new HistoryTokenCallback() {
+      @Override
+      public void onHistoryToken() {
+        SpaceSelectEvent.fire(eventBus, Space.homeSpace);
+      }
+    });
+    put(SiteTokens.WAVEINBOX, new HistoryTokenCallback() {
+      @Override
+      public void onHistoryToken() {
+        SpaceSelectEvent.fire(eventBus, Space.userSpace);
+      }
+    });
+    put(SiteTokens.SIGNIN, new HistoryTokenCallback() {
+      @Override
+      public void onHistoryToken() {
+        signIn.get().showSignInDialog();
+      }
+    });
+    put(SiteTokens.REGISTER, new HistoryTokenCallback() {
+      @Override
+      public void onHistoryToken() {
+        register.get().doRegister();
+      }
+    });
+    put(SiteTokens.NEWGROUP, new HistoryTokenCallback() {
+      @Override
+      public void onHistoryToken() {
+        newGroup.get().doNewGroup();
+      }
+    });
+    put(SiteTokens.ABOUTKUNE, new HistoryTokenCallback() {
+      @Override
+      public void onHistoryToken() {
+        // FIXME, something to come back
+        aboutKuneDialog.get().showCentered();
+      }
+    });
+    put(SiteTokens.TRANSLATE, new HistoryTokenCallback() {
+      // FIXME, something to come back
+      @Override
+      public void onHistoryToken() {
+        translator.get().show();
+      }
+    });
+  }
 }

Copied: trunk/src/main/java/cc/kune/core/public/i18n-recom.html (from rev 1481, trunk/src/main/java/org/ourproject/kune/app/public/html/i18n-recom.html)
===================================================================
--- trunk/src/main/java/cc/kune/core/public/i18n-recom.html	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/public/i18n-recom.html	2011-08-06 18:27:37 UTC (rev 1484)
@@ -0,0 +1,120 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Common Translation Erros</title>
+<meta name="generator" content="HTML::TextToHTML v2.51"/>
+<link rel="stylesheet" type="text/css" href="frame-def.css"/>
+</head>
+<body>
+<script src="//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
+<script>
+  WebFont.load({
+    google : {
+      families : [ 'Ubuntu' ]
+    }
+  });
+</script>
+<h1><a name="common_translation_errors" id=
+"common_translation_errors">Common Translation Errors</a></h1>
+<div>
+<p>Translators - even professional translators - usually make these
+error when translating computer software.</p>
+</div>
+<h2><a name="overview_of_common_errors" id=
+"overview_of_common_errors">Overview of common errors</a></h2>
+<h3><a name="capitalisation" id=
+"capitalisation">Capitalisation</a></h3>
+<div>
+<p><strong>Wrong</strong>: no capitalisation in translation<br />
+<strong>Correct</strong>: translation follows translation language
+capitalisation convention</p>
+</div>
+<h3><a name="double_words" id="double_words">Double words</a></h3>
+<div>
+<p><em>Translator could not decide which word was more
+appropriate</em></p>
+<p><strong>Wrong</strong>: two translated words for one original
+word<br />
+<strong>Correct</strong>: choose one word if you have two
+options</p>
+</div>
+<h3><a name="translated_things_that_should_stay_in_english" id=
+"translated_things_that_should_stay_in_english">Translated things
+that should stay in English</a></h3>
+<div>
+<p><strong>Wrong</strong>: translating program function name like
+get_file_attributes()<br />
+<strong>Correct</strong>: leave program syntax or function names
+untranslated</p>
+</div>
+<h3><a name="variables" id="variables">Variables</a></h3>
+<div>
+<p><strong>Wrong</strong>: variables left out of translation<br />
+<strong>Correct</strong>: variable in translation in the correct
+order for the language</p>
+<p><strong>Wrong</strong>: environment variable names (eg. EDITOR)
+and possible fixed values (eg. COLOR, TRANSPARENT) translated<br />
+<strong>Correct</strong>: left in English and perhaps surrounded by
+single quotes to indicate that they are not in the target language
+on purpose.</p>
+</div>
+<h3><a name="punctuation" id="punctuation">Punctuation</a></h3>
+<div>
+<p><strong>Wrong</strong>: leaving out end punctuation and
+whitespace (eg. <code>“File: ”</code>)<br />
+<strong>Correct</strong>: copying end punctuation and whitespace
+almost exactly as the original into the translation.</p>
+<p><strong>Wrong</strong>: adding missing fullstops to translated
+sentence<br />
+<strong>Correct</strong>: if full sentences do not contain a
+fullstop in the original do not add one to the translation.</p>
+<p><strong>Wrong</strong>: adding exclamation marks (!) to the
+translation when they occur in the original<br />
+<strong>Correct</strong>: use exclamation marks to correspond with
+the tone of the application and the convention of the translated
+language. Ie you may leave them out of the translation.</p>
+<p><strong>Wrong</strong>: leaving out ellipses (…)<br />
+<strong>Correct</strong>: always add ellipses to the
+translation</p>
+</div>
+<h3><a name="accelerators" id="accelerators">Accelerators</a></h3>
+<div>
+<p><strong>Wrong</strong>: leaving out accelerators (either _&amp;~
+depending on the application)<br />
+<strong>Correct</strong>: if the original has an accelerator so
+should the translation</p>
+<p><strong>Wrong</strong>: placing the accelerator exactly in the
+same position as the original<br />
+<strong>Correct</strong>: place the accelerator on the word /
+syllable / part of the sentence that is accented in its
+pronunciation or is the focus of the sentence.</p>
+<p><strong>Wrong</strong>: using the same letter for accelerator
+keys<br />
+<strong>Correct</strong>: try to vary the letters chosen as the
+accelerator key (in some languages almost all words start with U or
+I. In this case make an effort to choose other letters)</p>
+</div>
+<h3><a name="html" id="html">HTML</a></h3>
+<div>
+<p><strong>Wrong</strong>: <acronym title=
+"HyperText Markup Language">HTML</acronym> tags are
+translated<br />
+<strong>Correct</strong>: <acronym title=
+"HyperText Markup Language">HTML</acronym> tags are not
+translated</p>
+<p><strong>Wrong</strong>: translatable <acronym title=
+"HyperText Markup Language">HTML</acronym> entities are not
+translated<br />
+<strong>Correct</strong>: translate items that will be viewable. Eg
+<acronym title="HyperText Markup Language">HTML</acronym> img tag's
+alt entity &lt;img alt=“translate me”&gt;, a tag's title entity
+&lt;a href=blah title=“translate me”&gt;.</p>
+<p>This recommendations are from <a href=
+"http://translate.sourceforge.net">Translate Toolkit &amp; Pootle
+Project</a> under <a href=
+"http://creativecommons.org/licenses/by-sa/3.0/">cc-by-sa
+license</a>.</p>
+</div>
+</body>
+</html>

Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/core/public/ws.css	2011-08-06 18:27:37 UTC (rev 1484)
@@ -923,11 +923,16 @@
   outline: 0 none;
 }
 
-button[disabled]:active,button[disabled],input[type="reset"][disabled]:active,input[type="reset"][disabled],input[type="button"][disabled]:active,input[type="button"][disabled],select[disabled]>input[type="button"],select[disabled]>input[type="button"]:active,input[type="submit"][disabled]:active,input[type="submit"][disabled],.k-button-disabled
+button[disabled]:active,button[disabled],input[type="reset"][disabled]:active,input[type="reset"][disabled],input[type="button"][disabled]:active,input[type="button"][disabled],select[disabled]>input[type="button"],select[disabled]>input[type="button"]:active,input[type="submit"][disabled]:active,input[type="submit"][disabled],.k-button-disabled, button.k-button-disabled
   {
   color: gray !important;
   border-color: #CCCCCC !important;
   background: inherits !important;
+  kfilter: alpha(opacity =                                                       60
+    ) !important;
+  -moz-opacity: 0.60 !important;
+  -khtml-opacity: 0.60 !important;
+  opacity: 0.60 !important;
 }
 
 /* end buttons */
@@ -1470,3 +1475,7 @@
   background-image: url(images/colors.gif) !important;
 }
 
+.k-i18n-recommend {
+  border: 1px solid gray;
+  background-color: #F2F2F2;
+}
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -27,7 +27,9 @@
 import cc.kune.gspace.client.i18n.I18nNewTranslatorPanel;
 import cc.kune.gspace.client.i18n.I18nNewTranslatorPresenter;
 import cc.kune.gspace.client.i18n.I18nNewTranslatorPresenter.I18nNewTranslatorView;
+import cc.kune.gspace.client.i18n.I18nTranslator;
 import cc.kune.gspace.client.i18n.SiteOptionsI18nTranslatorAction;
+import cc.kune.gspace.client.i18n.TranslatorTabsCollection;
 import cc.kune.gspace.client.licensewizard.LicenseChangeAction;
 import cc.kune.gspace.client.licensewizard.LicenseWizard;
 import cc.kune.gspace.client.licensewizard.LicenseWizardPanel;
@@ -140,6 +142,7 @@
 
     s(UserOptionsCollection.class);
     s(GroupOptionsCollection.class);
+    s(TranslatorTabsCollection.class);
 
     s(GroupOptDefLicense.class, GroupOptDefLicensePresenter.class);
     s(GroupOptDefLicenseView.class, GroupOptDefLicensePanel.class);
@@ -179,7 +182,7 @@
 
     // I18nTranslator
     s(I18nNewTranslatorView.class, I18nNewTranslatorPanel.class);
-    s(I18nNewTranslatorPresenter.class);
+    s(I18nTranslator.class, I18nNewTranslatorPresenter.class);
     s(SiteOptionsI18nTranslatorAction.class);
   }
 }
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -23,7 +23,9 @@
 import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.sitebar.search.SitebarSearchPresenter;
 import cc.kune.core.client.state.Session;
+import cc.kune.gspace.client.i18n.I18nToTranslateGridPanel;
 import cc.kune.gspace.client.i18n.SiteOptionsI18nTranslatorAction;
+import cc.kune.gspace.client.i18n.TranslatorTabsCollection;
 import cc.kune.gspace.client.options.GroupOptions;
 import cc.kune.gspace.client.options.GroupOptionsCollection;
 import cc.kune.gspace.client.options.UserOptions;
@@ -61,7 +63,9 @@
       final Provider<GroupOptTools> gtc, final Provider<UserOptDefLicense> udl,
       final Provider<UserOptStyle> ups, final Provider<UserOptLogo> ul,
       final Provider<UserOptTools> utc, final Provider<SitebarSearchPresenter> siteSearch,
-      final Provider<SiteOptionsI18nTranslatorAction> transAction) {
+      final Provider<SiteOptionsI18nTranslatorAction> transAction,
+      final Provider<I18nToTranslateGridPanel> toTrans,
+      final Provider<TranslatorTabsCollection> gtranslator) {
 
     session.onAppStart(true, new AppStartHandler() {
       @Override
@@ -90,6 +94,7 @@
 
         // i18n
         transAction.get();
+        gtranslator.get().add(toTrans);
       }
     });
   }

Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nNewTranslatorPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nNewTranslatorPanel.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nNewTranslatorPanel.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -1,8 +1,8 @@
 package cc.kune.gspace.client.i18n;
 
-
 import cc.kune.common.client.notify.NotifyLevelImages;
 import cc.kune.common.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
+import cc.kune.core.shared.dto.I18nLanguageDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.gspace.client.i18n.I18nNewTranslatorPresenter.I18nNewTranslatorView;
 
@@ -13,21 +13,45 @@
   private static final int HEIGHT = 400;
   private static final String TRANSLATOR_ERROR_ID = "i18n-trans-panel-error";
   private static final String TRANSLATOR_PANEL_ID = "i18n-trans-panel";
-  private static final int WIDTH = 270;
+  private static final int WIDTH = 400;
+  private final LanguageSelectorPanel lanSelectorPanel;
+  private final I18nToTranslateGridPanel toTranslateGrid;
+  private final I18nTranslatedGridPanel translatedGrid;
+  private final I18nTranslateRecomendPanel transRecommend;
 
   @Inject
   public I18nNewTranslatorPanel(final I18nTranslationService i18n, final NotifyLevelImages images,
-      final TranslatorTabsCollection transGroup) {
-    super(TRANSLATOR_PANEL_ID, "", WIDTH, HEIGHT + 80, false, images, TRANSLATOR_ERROR_ID,
+      final TranslatorTabsCollection transGroup, final LanguageSelectorPanel lanSelectorPanel,
+      final I18nToTranslateGridPanel toTranslateGrid, final I18nTranslatedGridPanel translatedGrid,
+      final I18nTranslateRecomendPanel transRecommend) {
+    super(TRANSLATOR_PANEL_ID, "", WIDTH, HEIGHT + 80, false, false, images, TRANSLATOR_ERROR_ID,
         i18n.t("Close"), null, null, null, transGroup);
+    this.lanSelectorPanel = lanSelectorPanel;
+    this.toTranslateGrid = toTranslateGrid;
+    this.translatedGrid = translatedGrid;
+    this.transRecommend = transRecommend;
     super.setIconCls("k-options-icon");
     super.setTitle(i18n.t("Help to translate kune"));
+    super.getInnerPanel().insert(lanSelectorPanel, 0);
+    lanSelectorPanel.setLangTitle(i18n.t(""));
+    lanSelectorPanel.setLangSeparator("");
   }
 
   @Override
-  public void hideTranslatorAndIcon() {
-    // TODO Auto-generated method stub
+  public void init() {
+    addTab(toTranslateGrid, toTranslateGrid.getTabTitle());
+    addTab(translatedGrid, translatedGrid.getTabTitle());
+    addTab(transRecommend, transRecommend.getTabTitle());
+  }
 
+  @Override
+  public void setLanguage(final I18nLanguageDTO currentLanguage) {
+    lanSelectorPanel.setLanguage(currentLanguage.getCode());
   }
 
+  @Override
+  public void show() {
+    super.show();
+  }
+
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nNewTranslatorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nNewTranslatorPresenter.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nNewTranslatorPresenter.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -1,10 +1,17 @@
 package cc.kune.gspace.client.i18n;
 
-
+import cc.kune.common.client.notify.NotifyUser;
 import cc.kune.common.client.ui.dialogs.tabbed.AbstractTabbedDialog;
 import cc.kune.common.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
+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.I18nLanguageDTO;
 
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.IsWidget;
 import com.google.inject.Inject;
+import com.google.inject.Provider;
 
 public class I18nNewTranslatorPresenter extends AbstractTabbedDialogPresenter implements
     AbstractTabbedDialog, I18nTranslator {
@@ -14,24 +21,75 @@
     @Override
     void hide();
 
-    void hideTranslatorAndIcon();
+    void init();
 
+    void setLanguage(I18nLanguageDTO currentLanguage);
+
     @Override
     void show();
   }
+  private final I18nUITranslationService i18n;
+  private final Provider<I18nServiceAsync> i18nService;
+  private final Session session;
   private I18nNewTranslatorView view;
 
   @Inject
-  public I18nNewTranslatorPresenter() {
+  public I18nNewTranslatorPresenter(final Session session, final I18nUITranslationService i18n,
+      final I18nNewTranslatorView view, final Provider<I18nServiceAsync> i18nService) {
+    this.session = session;
+    this.i18n = i18n;
+    this.i18nService = i18nService;
+    init(view);
   }
 
+  public void doClose() {
+    view.hide();
+  }
+
+  public void doTranslation(final String id, final String trKey, final String translation) {
+    NotifyUser.showProgress(i18n.t("Saving"));
+    i18nService.get().setTranslation(session.getUserHash(), id, translation,
+        new AsyncCallback<String>() {
+          @Override
+          public void onFailure(final Throwable caught) {
+            NotifyUser.hideProgress();
+            NotifyUser.error(i18n.t("Server error saving the translation"));
+          }
+
+          @Override
+          public void onSuccess(final String result) {
+            NotifyUser.hideProgress();
+            i18n.setTranslationAfterSave(trKey, result);
+          }
+        });
+  }
+
   @Override
-  public void doShowTranslator() {
-    view.show();
+  public IsWidget getView() {
+    return view;
   }
 
+  @Override
+  public void hide() {
+    view.hide();
+  }
+
   public void init(final I18nNewTranslatorView view) {
     super.init(view);
     this.view = view;
+    view.init();
   }
+
+  @Override
+  public void show() {
+    NotifyUser.showProgressLoading();
+    if (session.isLogged()) {
+      view.setLanguage(session.getCurrentLanguage());
+      view.show();
+    } else {
+      NotifyUser.info(i18n.t("Sign in or register to help with the translation"));
+    }
+    NotifyUser.hideProgress();
+  }
+
 }

Added: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nToTranslateGridPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nToTranslateGridPanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nToTranslateGridPanel.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -0,0 +1,25 @@
+package cc.kune.gspace.client.i18n;
+
+import cc.kune.common.client.utils.TextUtils;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.Label;
+import com.google.inject.Inject;
+
+public class I18nToTranslateGridPanel extends Composite {
+
+  private final Label tabTitle;
+
+  @Inject
+  public I18nToTranslateGridPanel(final I18nTranslationService i18n) {
+    tabTitle = new Label(i18n.t("Untranslated"));
+    initWidget(new Label(TextUtils.IN_DEVELOPMENT));
+
+  }
+
+  public IsWidget getTabTitle() {
+    return tabTitle;
+  }
+}

Added: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslateRecomendPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslateRecomendPanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslateRecomendPanel.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -0,0 +1,27 @@
+package cc.kune.gspace.client.i18n;
+
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.Label;
+import com.google.inject.Inject;
+
+public class I18nTranslateRecomendPanel extends Composite {
+
+  private final Label tabTitle;
+
+  @Inject
+  public I18nTranslateRecomendPanel(final I18nTranslationService i18n) {
+    tabTitle = new Label(i18n.t("Recommendations"));
+    final Frame recommFrame = new Frame("i18n-recom.html");
+    recommFrame.setHeight("auto");
+    recommFrame.setStyleName("k-i18n-recommend");
+    initWidget(recommFrame);
+  }
+
+  public IsWidget getTabTitle() {
+    return tabTitle;
+  }
+}

Added: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatedGridPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatedGridPanel.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatedGridPanel.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -0,0 +1,25 @@
+package cc.kune.gspace.client.i18n;
+
+import cc.kune.common.client.utils.TextUtils;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.Label;
+import com.google.inject.Inject;
+
+public class I18nTranslatedGridPanel extends Composite {
+
+  private final Label tabTitle;
+
+  @Inject
+  public I18nTranslatedGridPanel(final I18nTranslationService i18n) {
+    tabTitle = new Label(i18n.t("Translated"));
+    initWidget(new Label(TextUtils.IN_DEVELOPMENT));
+
+  }
+
+  public IsWidget getTabTitle() {
+    return tabTitle;
+  }
+}

Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslator.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslator.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslator.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -21,6 +21,6 @@
 
 public interface I18nTranslator {
 
-    void doShowTranslator();
+    void show();
 
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/LanguageSelectorPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/LanguageSelectorPanel.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/LanguageSelectorPanel.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -68,8 +68,11 @@
     this.i18n = i18n;
     this.session = session;
     setBorders(false);
+    setFrame(false);
+    setHeaderVisible(false);
     createLangCombo();
     super.add(langCombo);
+    setBodyBorder(false);
   }
 
   public void addChangeListener(final SimpleCallback onChange) {
@@ -125,6 +128,10 @@
     langCombo.reset();
   }
 
+  public void setLangSeparator(final String separator) {
+    langCombo.setLabelSeparator(separator);
+  }
+
   public void setLangTitle(final String langFieldTitle) {
     if (langFieldTitle == null) {
       setHideLabels(true);

Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/SiteOptionsI18nTranslatorAction.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/SiteOptionsI18nTranslatorAction.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/SiteOptionsI18nTranslatorAction.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -46,7 +46,7 @@
     this.translatorPanel = translatorPanel;
     putValue(Action.NAME, i18n.t("Help with the translation"));
     putValue(Action.SMALL_ICON, img.language());
-    final MenuItemDescriptor item = new MenuItemDescriptor(siteOptions.getOptionsMenu(), this);
+    MenuItemDescriptor.build(siteOptions.getOptionsMenu(), this);
     // item.setPosition(1);
   }
 
@@ -57,6 +57,6 @@
       presenter.init(translatorPanel.get());
       translator = presenter;
     }
-    translator.doShowTranslator();
+    translator.show();
   }
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -37,7 +37,7 @@
   @Inject
   public GroupOptionsPanel(final EntityHeader entityHeader, final I18nTranslationService i18n,
       final NotifyLevelImages images, final GroupOptionsCollection entityOptionsGroup) {
-    super(GROUP_OP_PANEL_ID, "", WIDTH, HEIGHT + 80, false, images, GROUP_OPTIONS_ERROR_ID,
+    super(GROUP_OP_PANEL_ID, "", WIDTH, HEIGHT + 80, false, false, images, GROUP_OPTIONS_ERROR_ID,
         i18n.t("Close"), null, null, null, entityOptionsGroup);
     this.entityHeader = entityHeader;
     super.setIconCls("k-options-icon");

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -166,7 +166,7 @@
       if (stateContent.isParticipant()) {
         // is already participant, show wave editor
         if (org.waveprotocol.box.webclient.client.Session.get().isLoggedIn()) {
-          final String typeId = stateContent.getTypeId();
+          // final String typeId = stateContent.getTypeId();
           // if (typeId.equals(BartersConstants.TYPE_BARTER)
           // || typeId.equals(MeetingsConstants.TYPE_MEETING)) {
           // NotifyUser.important("Currently we are experiencing problems with this tool. We'll fix ASAP...");

Deleted: trunk/src/main/java/org/ourproject/kune/app/public/html/i18n-recom.html
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/html/i18n-recom.html	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/org/ourproject/kune/app/public/html/i18n-recom.html	2011-08-06 18:27:37 UTC (rev 1484)
@@ -1,117 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
-dir="ltr">
-<head>
-<meta name="generator" content=
-"HTML Tidy for MkLinux (vers 6 November 2007), see www.w3.org" />
-<meta http-equiv="Content-Type" content=
-"text/html; charset=utf-8" />
-<title>Common Translation Erros</title>
-<link rel="stylesheet" type="text/css" href=
-"http://yui.yahooapis.com/2.4.1/build/base/base-min.css" />
-</head>
-<body>
-<h1><a name="common_translation_errors" id=
-"common_translation_errors">Common Translation Errors</a></h1>
-<div>
-<p>Translators - even professional translators - usually make these
-error when translating computer software.</p>
-</div>
-<h2><a name="overview_of_common_errors" id=
-"overview_of_common_errors">Overview of common errors</a></h2>
-<h3><a name="capitalisation" id=
-"capitalisation">Capitalisation</a></h3>
-<div>
-<p><strong>Wrong</strong>: no capitalisation in translation<br />
-<strong>Correct</strong>: translation follows translation language
-capitalisation convention</p>
-</div>
-<h3><a name="double_words" id="double_words">Double words</a></h3>
-<div>
-<p><em>Translator could not decide which word was more
-appropriate</em></p>
-<p><strong>Wrong</strong>: two translated words for one original
-word<br />
-<strong>Correct</strong>: choose one word if you have two
-options</p>
-</div>
-<h3><a name="translated_things_that_should_stay_in_english" id=
-"translated_things_that_should_stay_in_english">Translated things
-that should stay in English</a></h3>
-<div>
-<p><strong>Wrong</strong>: translating program function name like
-get_file_attributes()<br />
-<strong>Correct</strong>: leave program syntax or function names
-untranslated</p>
-</div>
-<h3><a name="variables" id="variables">Variables</a></h3>
-<div>
-<p><strong>Wrong</strong>: variables left out of translation<br />
-<strong>Correct</strong>: variable in translation in the correct
-order for the language</p>
-<p><strong>Wrong</strong>: environment variable names (eg. EDITOR)
-and possible fixed values (eg. COLOR, TRANSPARENT) translated<br />
-<strong>Correct</strong>: left in English and perhaps surrounded by
-single quotes to indicate that they are not in the target language
-on purpose.</p>
-</div>
-<h3><a name="punctuation" id="punctuation">Punctuation</a></h3>
-<div>
-<p><strong>Wrong</strong>: leaving out end punctuation and
-whitespace (eg. <code>“File: ”</code>)<br />
-<strong>Correct</strong>: copying end punctuation and whitespace
-almost exactly as the original into the translation.</p>
-<p><strong>Wrong</strong>: adding missing fullstops to translated
-sentence<br />
-<strong>Correct</strong>: if full sentences do not contain a
-fullstop in the original do not add one to the translation.</p>
-<p><strong>Wrong</strong>: adding exclamation marks (!) to the
-translation when they occur in the original<br />
-<strong>Correct</strong>: use exclamation marks to correspond with
-the tone of the application and the convention of the translated
-language. Ie you may leave them out of the translation.</p>
-<p><strong>Wrong</strong>: leaving out ellipses (…)<br />
-<strong>Correct</strong>: always add ellipses to the
-translation</p>
-</div>
-<h3><a name="accelerators" id="accelerators">Accelerators</a></h3>
-<div>
-<p><strong>Wrong</strong>: leaving out accelerators (either _&amp;~
-depending on the application)<br />
-<strong>Correct</strong>: if the original has an accelerator so
-should the translation</p>
-<p><strong>Wrong</strong>: placing the accelerator exactly in the
-same position as the original<br />
-<strong>Correct</strong>: place the accelerator on the word /
-syllable / part of the sentence that is accented in its
-pronunciation or is the focus of the sentence.</p>
-<p><strong>Wrong</strong>: using the same letter for accelerator
-keys<br />
-<strong>Correct</strong>: try to vary the letters chosen as the
-accelerator key (in some languages almost all words start with U or
-I. In this case make an effort to choose other letters)</p>
-</div>
-<h3><a name="html" id="html">HTML</a></h3>
-<div>
-<p><strong>Wrong</strong>: <acronym title=
-"HyperText Markup Language">HTML</acronym> tags are
-translated<br />
-<strong>Correct</strong>: <acronym title=
-"HyperText Markup Language">HTML</acronym> tags are not
-translated</p>
-<p><strong>Wrong</strong>: translatable <acronym title=
-"HyperText Markup Language">HTML</acronym> entities are not
-translated<br />
-<strong>Correct</strong>: translate items that will be viewable. Eg
-<acronym title="HyperText Markup Language">HTML</acronym> img tag's
-alt entity &lt;img alt=“translate me”&gt;, a tag's title entity
-&lt;a href=blah title=“translate me”&gt;.</p>
-<p>This recommendations are from <a href=
-"http://translate.sourceforge.net">Translate Toolkit &amp; Pootle
-Project</a> under <a href=
-"http://creativecommons.org/licenses/by-sa/3.0/">cc-by-sa
-license</a>.</p>
-</div>
-</body>
-</html>

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java	2011-08-06 10:41:10 UTC (rev 1483)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java	2011-08-06 18:27:37 UTC (rev 1484)
@@ -53,7 +53,7 @@
         view.hide();
     }
 
-    public void doShowTranslator() {
+    public void show() {
         OldNotifyUser.showProgressLoading();
         if (session.isLogged()) {
             view.show();




More information about the kune-commits mailing list