[kune-commits] r1522 - in trunk: script src/main/java/cc/kune src/main/java/cc/kune/core/client/actions/xml src/main/java/cc/kune/core/client/i18n src/main/java/cc/kune/core/client/notify/confirm src/main/java/cc/kune/core/client/rpcservices src/main/java/cc/kune/core/client/sitebar src/main/java/cc/kune/core/server/manager src/main/java/cc/kune/core/server/manager/impl src/main/java/cc/kune/core/server/rpc src/main/java/cc/kune/core/shared/dto src/main/java/cc/kune/domain src/main/java/cc/kune/domain/finders src/main/java/cc/kune/gspace/client/i18n src/main/java/cc/kune/gspace/client/options/general src/main/java/cc/kune/gspace/client/themes src/test/java/cc/kune/core/server/integration/site

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Mon Sep 19 22:25:08 CEST 2011


Author: vjrj_
Date: 2011-09-19 22:25:07 +0200 (Mon, 19 Sep 2011)
New Revision: 1522

Added:
   trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java
   trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties
   trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties
Modified:
   trunk/script/i18n-db2gwt.sh
   trunk/src/main/java/cc/kune/Kune.gwt.xml
   trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
   trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
   trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java
   trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java
   trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java
   trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java
   trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.java
   trunk/src/main/java/cc/kune/core/server/manager/UserManager.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
   trunk/src/main/java/cc/kune/core/shared/dto/I18nLanguageSimpleDTO.java
   trunk/src/main/java/cc/kune/core/shared/dto/I18nTranslationDTO.java
   trunk/src/main/java/cc/kune/domain/I18nTranslation.java
   trunk/src/main/java/cc/kune/domain/finders/I18nTranslationFinder.java
   trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java
   trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java
   trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java
   trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java
Log:
NEW - # 79: I18n refactorization 
http://kune.ourproject.org/issues/ticket/79

Modified: trunk/script/i18n-db2gwt.sh
===================================================================
--- trunk/script/i18n-db2gwt.sh	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/script/i18n-db2gwt.sh	2011-09-19 20:25:07 UTC (rev 1522)
@@ -7,7 +7,7 @@
     echo "$0 -l en"
 }
 
-while getopts “hl:” OPTION
+while getopts “hl:j” OPTION
 do
     case $OPTION in
 	h)
@@ -17,6 +17,9 @@
 	l)
 	    L=$OPTARG
 	    ;;
+	j)
+	    J=1
+	    ;;
 	?)
             usage
             exit
@@ -29,6 +32,63 @@
     usage
     exit 1
 fi
+if [[ $L = "en" ]]
+then
+  SEL="SELECT g.tr_key,g.tr_key,g.text,l.code,g.noteForTranslators FROM globalize_translations g, globalize_languages l where g.language_id = l.id AND l.code='en';"
+else 
+  SEL="SELECT g.tr_key,p.tr_key,g.text,l.code,g.noteForTranslators FROM globalize_translations g, globalize_translations p, globalize_languages l where g.language_id = l.id AND l.code='$L' AND (g.parent_id = p.id OR g.parent_id = NULL) AND g.text != '';"
+fi
 
+if [[ $J -eq 1 ]] 
+then
+mysql -B --skip-column-names --password="db4kune" -u kune kune_dev -e "$SEL" \
+| sed 's/	/ł/g' \
+| awk -F "ł" '
+BEGIN {
+  print "public interface KuneConstants extends ConstantsWithLookup {"
+}
+{
+  lang=$4
+  nt=$5
+  if (lang != "en") {
+    trkey=$2
+    trad=$3
+  } else {
+    trkey=$1
+    trad=$2
+  }
 
+  cmd="echo \"  String \"`bin/convertI18nMsgToMethods.sh \""trkey" "nt"\"`\"();\""
+  result = system(cmd)
+}
+END {
+  print "}"
+}'
+else
+mysql -B --skip-column-names --password="db4kune" -u kune kune_dev -e "$SEL" \
+| sed 's/	/ł/g' \
+| awk -F "ł" '
+BEGIN {
+}
+{
+  lang=$4
+  nt=$5
+  if (lang != "en") {
+    trkey=$2
+    trad=$3
+  } else {
+    trkey=$1
+    trad=$2
+  }
+  #gsub(/\[/, "\\[", trkey)
+  #gsub(/\]/, "\\]", trkey)
+  #print trkey "--->" trad
+  cmd="echo `bin/convertI18nMsgToMethods.sh \""trkey" "nt"\"` = \""trad"\""
+  #print cmd
+  #exit
+  result = system(cmd)
+}
+END {
+}'
 
+fi
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/Kune.gwt.xml	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/Kune.gwt.xml	2011-09-19 20:25:07 UTC (rev 1522)
@@ -2,6 +2,7 @@
 <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/src/gwt-module.dtd">
 <module rename-to="ws">
   <inherits name="com.google.gwt.user.User" />
+  <inherits name="com.google.gwt.i18n.I18N"/>
   <inherits name='com.google.gwt.logging.Logging' />
   <inherits name="cc.kune.core.KuneCore" />
   <inherits name="cc.kune.wave.KuneWave" />
@@ -53,9 +54,11 @@
   <!-- For make CSS obfuscation more pretty -->
   <set-configuration-property name="CssResource.style"
     value="pretty" />
+  <!-- I18n ===================================================== -->
+  <extend-property name="locale" values="en" />
+  <extend-property name="locale" values="es" />
   <!-- Hardcoded locale (to override emite italian support) ===== -->
-  <extend-property name="locale" values="en" />
-  <set-property name="locale" value="en" />
+  <!--   <set-property name="locale" value="en" /> -->
   <!-- Hardcoded log level ====================================== -->
   <!-- Turn off logging in wave -->
   <set-property name="loglevel" value="none" />

Modified: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -157,7 +157,10 @@
             @Override
             public GuiActionDescrip get() {
               final MenuItemDescriptor menuItem = new MenuItemDescriptor(action);
-              menuItem.withText(descrip.getDescName()).withToolTip(descrip.getDescription());
+              // Warning: getDescription returns \n we have to replace this to
+              // spaces before use i18n in the tooltips (anyway tooltips are not
+              // working in menu items)
+              menuItem.withText(i18n.t(descrip.getDescName())).withToolTip(descrip.getDescription());
               menuItem.setParent(TextUtils.notEmpty(path) ? submenu : menu, false);
               return menuItem;
             }

Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -21,8 +21,10 @@
 
 import java.util.Date;
 import java.util.HashMap;
+import java.util.MissingResourceException;
 
 import cc.kune.common.client.log.Log;
+import cc.kune.common.client.notify.NotifyUser;
 import cc.kune.common.client.utils.Location;
 import cc.kune.common.client.utils.TextUtils;
 import cc.kune.common.client.utils.WindowUtils;
@@ -41,14 +43,16 @@
   private I18nLanguageDTO currentLang;
   private String currentLanguageCode;
   private final I18nServiceAsync i18nService;
+  private final KuneConstants kuneConstants;
   private HashMap<String, String> lexicon;
   private final Session session;
 
   @Inject
   public I18nUITranslationService(final Session session, final I18nServiceAsync i18nService,
-      final EventBus eventBus) {
+      final EventBus eventBus, final KuneConstants kuneConstants) {
     this.session = session;
     this.i18nService = i18nService;
+    this.kuneConstants = kuneConstants;
     final Location loc = WindowUtils.getLocation();
     final String locale = loc.getParameter("locale");
     i18nService.getInitialLanguage(locale, new AsyncCallback<I18nLanguageDTO>() {
@@ -60,6 +64,7 @@
       @Override
       public void onSuccess(final I18nLanguageDTO result) {
         currentLang = result;
+        NotifyUser.info("lang: " + result.getCode());
         currentLanguageCode = currentLang.getCode();
         session.setCurrentLanguage(currentLang);
         i18nService.getLexicon(currentLang.getCode(), new AsyncCallback<HashMap<String, String>>() {
@@ -193,36 +198,39 @@
    */
   @Override
   public String tWithNT(final String text, final String noteForTranslators) {
-    if (lexicon == null) {
-      Log.warn("i18n not initialized");
-      return text;
-    }
     final String encodeText = TextUtils.escapeHtmlLight(text);
-    String translation = lexicon.get(encodeText);
-    if (lexicon.containsKey(encodeText)) {
-      if (translation == UNTRANSLATED_VALUE) {
-        // Not translated but in db, return text
-        translation = encodeText;
+    try {
+      return kuneConstants.getString(I18nUtils.convertMethodName(text + " " + noteForTranslators));
+    } catch (final MissingResourceException e) {
+      if (lexicon == null) {
+        Log.warn("i18n not initialized");
+        return text;
       }
-    } else {
-      // Not translated and not in db, make a petition for translation
-      if (session.isLogged()) {
-        i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text, noteForTranslators,
-            new AsyncCallback<String>() {
-              @Override
-              public void onFailure(final Throwable caught) {
-              }
+      String translation = lexicon.get(encodeText);
+      if (lexicon.containsKey(encodeText)) {
+        if (translation == UNTRANSLATED_VALUE) {
+          // Not translated but in db, return text
+          translation = encodeText;
+        }
+      } else {
+        // Not translated and not in db, make a petition for translation
+        if (session.isLogged()) {
+          i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text,
+              noteForTranslators, new AsyncCallback<String>() {
+                @Override
+                public void onFailure(final Throwable caught) {
+                }
 
-              @Override
-              public void onSuccess(final String result) {
-              }
-            });
-        Log.debug("Registering in db '" + text + "' as pending translation");
-        lexicon.put(encodeText, UNTRANSLATED_VALUE);
+                @Override
+                public void onSuccess(final String result) {
+                }
+              });
+          Log.debug("Registering in db '" + text + "' as pending translation");
+          lexicon.put(encodeText, UNTRANSLATED_VALUE);
+        }
+        translation = encodeText;
       }
-      translation = encodeText;
+      return decodeHtml(translation);
     }
-    return decodeHtml(translation);
   }
-
 }

Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -15,7 +15,9 @@
     final char[] delimiters = { ' ', '.', '?', ',', ';', '&', '(', ')', '"', '$', '!', '/', '\'', '-',
         '%', ':', '{', '}', '[', ']', '©', '«', '»' };
     result = TextUtils.capitalizeFully(result, delimiters);
-    result = result.replaceAll("[ \\.\\?,;&\\(\\)\"\\$!\\/\\'\\-%:{}\\[\\]]", "");
+    // result = result.replaceAll("[ \\.\\?,;&\\(\\)\"\\$!\\/\\'\\-%:{}\\[\\]]",
+    // "");
+    result = result.replaceAll("[^a-zA-Z0-9]", "");
     return TextUtils.abbreviate(
         new StringBuffer(result.length()).append(Character.toLowerCase(result.charAt(0))).append(
             result.substring(1)).toString(), 0, 100, "");

Added: trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -0,0 +1,513 @@
+package cc.kune.core.client.i18n;
+
+import com.google.gwt.i18n.client.ConstantsWithLookup;
+
+public interface KuneConstants extends ConstantsWithLookup {
+  String aboutKune();
+
+  String aboutKuneTitleOfDialog();
+
+  String acceptThisMember();
+
+  String actions();
+
+  String addANewBuddy();
+
+  String addAsABuddie();
+
+  String admins();
+
+  String allowAnyUsesOfYourWorkIncludingCommercial();
+
+  String allowModificationsOfYourWork();
+
+  String alsoYouCanUploadABackground();
+
+  String anOrganizationWorksAsAProjectButOrganizationsMustBeALegalEntity();
+
+  String anyone();
+
+  String apacheWavePowered();
+
+  String aProjectIsAKindOfGroupInWhichNewMembersJoiningIsModeratedByTheProjectAdministratorsAnAdministratorIs();
+
+  String areYouSure();
+
+  String autoAcceptRequestToJoin();
+
+  String available();
+
+  String availableForChat();
+
+  String away();
+
+  String backusedInButton();
+
+  String blackwhiteAThemeName();
+
+  String blueAThemeName();
+
+  String buddies();
+
+  String busy();
+
+  String calendar();
+
+  String campAThemeName();
+
+  String cancel();
+
+  String change();
+
+  String changeThisWorkspaceTheme();
+
+  String changeToAdmin();
+
+  String changeToCollaborator();
+
+  String chat();
+
+  String chatAbout();
+
+  String chatAndCommentThis();
+
+  String chatWithThisMember();
+
+  String chatWithThisPerson();
+
+  String chatWithYourBuddie();
+
+  String choose();
+
+  String clear();
+
+  String clickToRename();
+
+  String clickToSelectAndConfigureThisTheme();
+
+  String close();
+
+  String closed();
+
+  String closedForNewMembers();
+
+  String closedGroupsAreSocialGroupsOfPersonsLikeFamilyFriendsBuddiesEtcWhichAreModeratedToNewMembersAndWithP();
+
+  String collaborators();
+
+  String commonLicensesForCulturalWorks();
+
+  String communitiesAreSocialGroupsOfPersonsWithSharedInterestsWhichAreOpenToNewMembersForInstanceTheEnvironm();
+
+  String community();
+
+  String connecting();
+
+  String copyleft();
+
+  String copyTheTextToTranslate();
+
+  String create();
+
+  String createANewBlog();
+
+  String createANewBlogPost();
+
+  String createANewChatRoom();
+
+  String createANewDocumentHereThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt();
+
+  String createANewDocumentThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt();
+
+  String createANewFolder();
+
+  String createANewFolderHereAFolderWillBeASectionInThePublicWeb();
+
+  String createANewList();
+
+  String createANewMeetingHere();
+
+  String createANewPost();
+
+  String createANewTask();
+
+  String createANewWikipageHereThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt();
+
+  String createNewGroup();
+
+  String currentBackgroundImage();
+
+  String defaultAThemeName();
+
+  String delete();
+
+  String doNotParticipateAnymoreInThisGroup();
+
+  String doubleClickToOpen();
+
+  String edit();
+
+  String enterLanguage();
+
+  String enterToThisGroupPublicChatRoom();
+
+  String enterToThisGroupPublicChatRoomAndInviteMembers();
+
+  String enterToThisRoom();
+
+  String errorsInfo();
+
+  String finishusedInButton();
+
+  String general();
+
+  String goUpOpenTheContainerFolder();
+
+  String greenAThemeName();
+
+  String greyAThemeName();
+
+  String groupAndPersonalSpaceWhereYouCanCreateAndPublishContentsForYourPersonalOrGroupWebSpaces();
+
+  String groupMembers();
+
+  String groupOptions();
+
+  String groupsInWhichThisUserParticipates();
+
+  String groupSPublicRoom();
+
+  String groupTags();
+
+  String groupType();
+
+  String helpToTranslateKune();
+
+  String helpWithTheTranslation();
+
+  String hereYouCanChangeThisValues();
+
+  String hereYouCanSelectTheToolsUsed();
+
+  String hereYouWillSeeTheArchiveOfOldConversationsInDevelopment();
+
+  String highcontrastAThemeName();
+
+  String hisHerNetwork();
+
+  String keywordsOrTermsAssociatedWithThisGroup();
+
+  String kuneDevelopmentSite();
+
+  String leaveThisGroup();
+
+  String license();
+
+  String licenseWizard();
+
+  String loading();
+
+  String longName();
+
+  String makeThisListNotPublic();
+
+  String media();
+
+  String moderateRequestToJoin();
+
+  String name();
+
+  String nConversationsUnread();
+
+  String newBlog();
+
+  String newDocument();
+
+  String newFolder();
+
+  String newGadget();
+
+  String newList();
+
+  String newMeeting();
+
+  String newMembersPolicy();
+
+  String newPoll();
+
+  String newPost();
+
+  String newRoom();
+
+  String newTask();
+
+  String newTaskFolder();
+
+  String newWikipage();
+
+  String nextusedInButton();
+
+  String no();
+
+  String notes();
+
+  String notPublicable();
+
+  String nSubscribedNPosts();
+
+  String offline();
+
+  String ok();
+
+  String onlyAdmins();
+
+  String onlyMembers();
+
+  String onlyYou();
+
+  String onlyYourBuddies();
+
+  String oopsSomethingHasGoneWrongWithOurServersRetryLaterPlease();
+
+  String open();
+
+  String openArchive();
+
+  String openTheConversationsArchiveOfThisRoom();
+
+  String options();
+
+  String organization();
+
+  String otherKindOfLicenses();
+
+  String otherPeopleThatCollaborateWithThisGroup();
+
+  String others();
+
+  String paramCreatednewContentCreatedForInstance();
+
+  String paramUnderLicenseParam();
+
+  String participate();
+
+  String participatesIn();
+
+  String pending();
+
+  String peopleAndGroupsCollaboratingInThisGroup();
+
+  String peoplePendingToBeAcceptedInThisGroupByTheAdmins();
+
+  String peopleThatCanAdminThisGroup();
+
+  String pinkAThemeName();
+
+  String pleaseConfirm();
+
+  String post();
+
+  String preview();
+
+  String project();
+
+  String publicDescription();
+
+  String publicSpaceInThisSpaceYouCanSeeAPreviewOfHowThePersonalOrGroupSpaceLooksLikeOnTheWebOutsideThisSite();
+
+  String pulseAltpageupOrAltpagedownToMoveUpDownInTheListWhileTranslatingAndAltVToCopyTheOriginalTextTheTrans();
+
+  String purpleAThemeName();
+
+  String reasonsNotToUseANonCommercialLicense();
+
+  String recommendations();
+
+  String redAThemeName();
+
+  String redblackAThemeName();
+
+  String register();
+
+  String registerANewGroup();
+
+  String rejectAsMember();
+
+  String reloadCurrentPage();
+
+  String reloadThis();
+
+  String removeCurrentBackgroundImage();
+
+  String removeThisMember();
+
+  String reportKuneIssuesProblems();
+
+  String requestToParticipateInThisGroup();
+
+  String saharaAThemeName();
+
+  String saving();
+
+  String search();
+
+  String searching();
+
+  String select();
+
+  String selectACreativeCommonsLicenseRecommendedForCulturalWorks();
+
+  String selectALicenseToShareYourGroupContentsWithOtherPeople();
+
+  String selectAndConfigureThePublicSpaceThemeOfThisGroup();
+
+  String selectAnImageInYourComputerAsTheLogoForThisGroupForBestResultsUseANxnPixelImageWeWillAutomaticallyRe();
+
+  String selectAnImageInYourComputerAsYourAvatarForBestResultsUseANxnPixelImageWeWillAutomaticallyResizeBigge();
+
+  String selectAsTheHomepage();
+
+  String selectLicense();
+
+  String selectOtherKindOfLicenses();
+
+  String selectTheLicenseType();
+
+  String setYourChatStatus();
+
+  String setYourGroupPreferencesHere();
+
+  String shortName();
+
+  String showHideTheChatWindow();
+
+  String signInToCollaborate();
+
+  String signOut();
+
+  String signOutOfChat();
+
+  String startAPublicAssemblyWithMembers();
+
+  String style();
+
+  String subscribe();
+
+  String subscribeToThisList();
+
+  String tags();
+
+  String theLicensorPermitsOthersToCopyDistributeDisplayAndPerformOnlyUnalteredCopiesOfTheWorkNotDerivativeWo();
+
+  String theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkAsWellAsMakeDerivativeWorksBasedOnIt();
+
+  String theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkForNonCommercialPurposesOnly();
+
+  String theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkIncludingForCommercialPurposes();
+
+  String theLicensorPermitsOthersToDistributeDerivativeWorksOnlyUnderTheSameLicenseOrOneCompatibleWithTheOneT();
+
+  String theMembersOfThisGroupAreNotPublic();
+
+  String theNameMustBeBetween3And15LowercaseCharactersItCanOnlyContainWesternCharactersAndNumbers();
+
+  String theNameMustContainOnlyCharactersNumbersAndDashes();
+
+  String thisFolderIsEmpty();
+
+  String thisIsACopyleftLicense();
+
+  String thisIsAnOrphanedProjectIfYouAreInterestedPleaseRequestToJoinToWorkOnIt();
+
+  String thisIsAppropriateForFreeCulturalWorks();
+
+  String thisIsNotACopyleftLicense();
+
+  String thisIsNotAppropriateForFreeCulturalWorks();
+
+  String thisIsOnlyAPreviewOfHowThisPageLooksLikeToTheGeneralPublicOnTheWebOutsideThisSite();
+
+  String thisIsTheDefaultLicenseForAllTheContentsOfThisGroupYouCanAlsoSelectAnotherDifferentLicensePerContent();
+
+  String thisPageIsNotPublicable();
+
+  String thisUserBuddies();
+
+  String thisUserBuddiesAndGroupsWhereParticipes();
+
+  String thisUserDoesNotHaveAHomepage();
+
+  String thoseWhoCanViewThisMemberList();
+
+  String thoseWhoCanViewYourNetwork();
+
+  String tip();
+
+  String to();
+
+  String tools();
+
+  String toParamForExampleToSpanish();
+
+  String translated();
+
+  String translateThis();
+
+  String transparentAThemeName();
+
+  String typeSomeKeywordThatDefineYourGroup();
+
+  String typeSomethingToSearchUsersAndGroupsInThisSite();
+
+  String untranslated();
+
+  String useACopyleftLicenseRecommended();
+
+  String useAnotherKindOfLicenseAdvanced();
+
+  String userOptions();
+
+  String userSpaceItShowsAListOfAllYourDocumentsAndContentsInWhichYouParticipate();
+
+  String useTheGnuLicensesRecommendedForFreeSoftwareWorksAndOtherKindOfLicenses();
+
+  String visitHisHerHomepage();
+
+  String visitThisGroupHomepage();
+
+  String visitThisMemberHomepage();
+
+  String visitYourHomepage();
+
+  String voting();
+
+  String welcomeToTheParamPublicChatRoom();
+
+  String weRecommendParamLicensesSpeciallyForPracticalWorks();
+
+  String whiteblackAThemeName();
+
+  String whyDoWeNeedALicense();
+
+  String withACreativeCommonsLicenseYouKeepYourCopyrightButAllowPeopleToCopyAndDistributeYourWorkProvidedThey();
+
+  String yes();
+
+  String yesAsLongAsOtherShareAlike();
+
+  String youCanChangeThisLicenseLater();
+
+  String youCannotDisableThisToolBecauseItSWhereTheCurrentGroupHomePageIsLocatedToDoThatYouHaveToSelectOtherC();
+
+  String yourGroups();
+
+  String yourHomepage();
+
+  String yourHomePageInThisSite();
+
+  String yourLanguage();
+
+  String yourPreferences();
+
+  String youWillDeleteItWithAllItsContentsAreYouSure();
+}

Added: trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties	2011-09-19 20:25:07 UTC (rev 1522)
@@ -0,0 +1,256 @@
+chatWithYourBuddie = Chat with your buddie
+chatWithThisMember = Chat with this member
+addAsABuddie = Add as a buddie
+chat = Chat ;)
+thisIsOnlyAPreviewOfHowThisPageLooksLikeToTheGeneralPublicOnTheWebOutsideThisSite = This is only a preview of how this page looks like to the general public on the web, outside this site.
+preview = Preview
+paramUnderLicenseParam = © [%s], under license: [%s]
+clickToRename = Click to rename
+createANewDocumentThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt = Create a New Document. This document will be a new 'Page' in the public web if you publish it
+reloadCurrentPage = Reload current page
+newDocument = New document
+goUpOpenTheContainerFolder = Go up: Open the container folder
+edit = Edit
+chatAndCommentThis = Chat and comment this
+chatAbout = Chat about
+available = Available
+nConversationsUnread = [%d] conversations unread
+offline = Offline
+connecting = Connecting
+newGadget = New Gadget
+voting = Voting
+calendar = Calendar
+media = Media
+others = Others
+loading = Loading
+participate = Participate
+options = Options
+doNotParticipateAnymoreInThisGroup = Do not participate anymore in this group
+requestToParticipateInThisGroup = Request to participate in this group
+leaveThisGroup = Leave this group
+thoseWhoCanViewThisMemberList = Those who can view this member list
+newMembersPolicy = New members policy
+anyone = anyone
+onlyMembers = only members
+onlyAdmins = only admins
+moderateRequestToJoin = moderate request to join
+autoAcceptRequestToJoin = auto accept request to join
+closedForNewMembers = closed for new members
+addANewBuddy = Add a new buddy
+thoseWhoCanViewYourNetwork = Those who can view your network
+onlyYourBuddies = only your buddies
+onlyYou = only you
+groupMembers = Group members
+peopleAndGroupsCollaboratingInThisGroup = People and groups collaborating in this group
+admins = Admins
+peopleThatCanAdminThisGroup = People that can admin this group
+collaborators = Collaborators
+otherPeopleThatCollaborateWithThisGroup = Other people that collaborate with this group
+pending = Pending
+peoplePendingToBeAcceptedInThisGroupByTheAdmins = People pending to be accepted in this group by the admins
+thisIsAnOrphanedProjectIfYouAreInterestedPleaseRequestToJoinToWorkOnIt = This is an orphaned project, if you are interested please request to join to work on it
+theMembersOfThisGroupAreNotPublic = The members of this group are not public
+changeToCollaborator = Change to collaborator
+changeToAdmin = Change to admin
+removeThisMember = Remove this member
+acceptThisMember = Accept this member
+rejectAsMember = Reject as member
+visitThisGroupHomepage = Visit this group homepage
+visitThisMemberHomepage = Visit this member homepage
+visitYourHomepage = Visit your homepage
+visitHisHerHomepage = Visit his/her homepage
+hisHerNetwork = His/her network:
+thisUserBuddiesAndGroupsWhereParticipes = This user buddies and groups where participes
+buddies = Buddies
+thisUserBuddies = This user buddies
+participatesIn = Participates in
+groupsInWhichThisUserParticipates = Groups in which this user participates
+yourGroups = Your groups
+yourHomepage = Your homepage
+yourHomePageInThisSite = Your home page in this site
+userSpaceItShowsAListOfAllYourDocumentsAndContentsInWhichYouParticipate = User space: it shows a list of all your documents and contents in which you participate
+groupAndPersonalSpaceWhereYouCanCreateAndPublishContentsForYourPersonalOrGroupWebSpaces = Group and personal space: Where you can create and publish contents for your personal or group web spaces
+publicSpaceInThisSpaceYouCanSeeAPreviewOfHowThePersonalOrGroupSpaceLooksLikeOnTheWebOutsideThisSite = Public space: In this space you can see a preview of how the Personal or Group Space looks like on the web, outside this site
+tags = Tags
+keywordsOrTermsAssociatedWithThisGroup = Keywords or terms associated with this group
+typeSomethingToSearchUsersAndGroupsInThisSite = Type something to search users and groups in this site
+search = Search
+close = Close
+groupOptions = Group options
+setYourGroupPreferencesHere = Set your group preferences here
+userOptions = User options
+yourPreferences = Your preferences
+helpWithTheTranslation = Help with the translation
+showHideTheChatWindow = Show/hide the chat window
+setYourChatStatus = Set your chat status
+availableForChat = Available for chat
+away = Away
+busy = Busy
+signOutOfChat = Sign out of chat
+groupSPublicRoom = Group's public room
+enterToThisGroupPublicChatRoom = Enter to this group public chat room
+startAPublicAssemblyWithMembers = Start a public assembly with members
+enterToThisGroupPublicChatRoomAndInviteMembers = Enter to this group public chat room and invite members
+reportKuneIssuesProblems = Report Kune issues/problems
+apacheWavePowered = Apache Wave powered
+aboutKune = About kune
+errorsInfo = Errors info
+signInToCollaborate = Sign in to collaborate
+signOut = Sign out
+createNewGroup = Create New Group
+kuneDevelopmentSite = kune development site
+enterLanguage = Enter language
+searching = Searching...
+copyTheTextToTranslate = Copy the text to translate
+translateThis = translate this:
+notes = Notes:
+tip = Tip:
+pulseAltpageupOrAltpagedownToMoveUpDownInTheListWhileTranslatingAndAltVToCopyTheOriginalTextTheTrans = Pulse Alt+PageUp or Alt+PageDown to move up/down in the list while translating, and Alt-V to copy the original text. The translations are autosaved
+untranslated = Untranslated
+translated = Translated
+recommendations = Recommendations
+helpToTranslateKune = Help to translate kune
+to = to
+general = General
+name = Name
+hereYouCanChangeThisValues = Here you can change this values:
+tools = Tools
+hereYouCanSelectTheToolsUsed = Here you can select the tools used:
+choose = Choose
+selectAnImageInYourComputerAsYourAvatarForBestResultsUseANxnPixelImageWeWillAutomaticallyResizeBigge = Select an image in your computer as your avatar. For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.
+style = Style
+changeThisWorkspaceTheme = Change this workspace theme:
+currentBackgroundImage = Current background image:
+alsoYouCanUploadABackground = Also you can upload a background:
+change = Change
+clear = Clear
+thisUserDoesNotHaveAHomepage = This user does not have a homepage
+removeCurrentBackgroundImage = Remove current background image
+selectAndConfigureThePublicSpaceThemeOfThisGroup = Select and configure the public space theme of this group:
+clickToSelectAndConfigureThisTheme = Click to select and configure this theme
+license = License
+thisIsTheDefaultLicenseForAllTheContentsOfThisGroupYouCanAlsoSelectAnotherDifferentLicensePerContent = This is the default license for all the contents of this group (you can also select another different license per content):
+notPublicable = Not Publicable
+thisPageIsNotPublicable = This page is not publicable
+chatWithThisPerson = Chat with this person
+toParamForExampleToSpanish = to [%s]:
+saving = Saving
+ok = Ok
+registerANewGroup = Register a new group
+register = Register
+cancel = Cancel
+shortName = Short name
+theNameMustBeBetween3And15LowercaseCharactersItCanOnlyContainWesternCharactersAndNumbers = The name must be between 3 and 15 lowercase characters. It can only contain Western characters and numbers
+longName = Long name
+publicDescription = Public description
+groupTags = Group tags
+typeSomeKeywordThatDefineYourGroup = type some keyword that define your group
+groupType = Group type
+project = Project
+aProjectIsAKindOfGroupInWhichNewMembersJoiningIsModeratedByTheProjectAdministratorsAnAdministratorIs = A project is a kind of group in which new members joining is moderated by the project administrators. An administrator is the person who creates the project and other people she/he chooses to be administrator as well.
+organization = Organization
+anOrganizationWorksAsAProjectButOrganizationsMustBeALegalEntity = An organization works as a project, but organizations must be a legal entity.
+closed = Closed
+closedGroupsAreSocialGroupsOfPersonsLikeFamilyFriendsBuddiesEtcWhichAreModeratedToNewMembersAndWithP = Closed groups are social groups of persons like family, friends, buddies, etc, which are moderated to new members and with private contents (by default)
+community = Community
+communitiesAreSocialGroupsOfPersonsWithSharedInterestsWhichAreOpenToNewMembersForInstanceTheEnvironm = Communities are social groups of persons with shared interests, which are open to new members (for instance the environmental community or the LGBT community). They rarely are a legal entity.
+createANewDocumentHereThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt = Create a New Document here. This document will be a new 'Page' in the public web if you publish it
+newFolder = New folder
+createANewFolderHereAFolderWillBeASectionInThePublicWeb = Create a new folder here. A folder will be a 'section' in the public web
+doubleClickToOpen = Double click to open
+delete = Delete
+open = Open
+selectAsTheHomepage = Select as the homepage
+actions = Actions
+newBlog = New blog
+createANewBlog = Create a new blog
+reloadThis = Reload this
+newList = New list
+createANewList = Create a new list
+newPost = New post
+createANewBlogPost = Create a new blog post
+makeThisListNotPublic = Make this list not public
+createANewPost = Create a new post
+subscribe = Subscribe
+subscribeToThisList = Subscribe to this list
+nSubscribedNPosts = [%d] subscribed, [%d] posts
+newMeeting = New meeting
+createANewMeetingHere = Create a New Meeting here
+createANewTask = Create a new task
+newTask = New task
+newTaskFolder = New task folder
+createANewFolder = Create a new folder
+newWikipage = New wikipage
+createANewWikipageHereThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt = Create a New Wikipage here. This document will be a new 'Page' in the public web if you publish it
+youCannotDisableThisToolBecauseItSWhereTheCurrentGroupHomePageIsLocatedToDoThatYouHaveToSelectOtherC = You cannot disable this tool because it's where the current group home page is located. To do that you have to select other content as the default group home page but in another tool.
+selectAnImageInYourComputerAsTheLogoForThisGroupForBestResultsUseANxnPixelImageWeWillAutomaticallyRe = Select an image in your computer as the logo for this group. For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.
+licenseWizard = License wizard
+backusedInButton = « Back
+nextusedInButton = Next »
+finishusedInButton = Finish
+select = Select
+selectALicenseToShareYourGroupContentsWithOtherPeople = Select a license to share your group contents with other people:
+useACopyleftLicenseRecommended = Use a copyleft license (recommended)
+useAnotherKindOfLicenseAdvanced = Use another kind of license (advanced)
+copyleft = copyleft
+weRecommendParamLicensesSpeciallyForPracticalWorks = We recommend [%s] licenses, specially for practical works
+whyDoWeNeedALicense = Why do we need a license?
+youCanChangeThisLicenseLater = You can change this license later
+selectTheLicenseType = Select the license type:
+commonLicensesForCulturalWorks = Common licenses for cultural works
+selectACreativeCommonsLicenseRecommendedForCulturalWorks = Select a Creative Commons license (recommended for cultural works)
+otherKindOfLicenses = Other kind of licenses
+useTheGnuLicensesRecommendedForFreeSoftwareWorksAndOtherKindOfLicenses = Use the GNU licenses (recommended for free software works) and other kind of licenses
+withACreativeCommonsLicenseYouKeepYourCopyrightButAllowPeopleToCopyAndDistributeYourWorkProvidedThey = With a Creative Commons license, you keep your copyright but allow people to copy and distribute your work provided they give you credit � and only on the conditions you specify here. What do you want to do?
+allowAnyUsesOfYourWorkIncludingCommercial = Allow any uses of your work, including commercial?
+allowModificationsOfYourWork = Allow modifications of your work?
+yes = Yes
+theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkIncludingForCommercialPurposes = The licensor permits others to copy, distribute, display, and perform the work, including for commercial purposes
+no = No
+theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkForNonCommercialPurposesOnly = The licensor permits others to copy, distribute, display, and perform the work for non-commercial purposes only
+theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkAsWellAsMakeDerivativeWorksBasedOnIt = The licensor permits others to copy, distribute, display and perform the work, as well as make derivative works based on it
+yesAsLongAsOtherShareAlike = Yes, as long as other share alike
+theLicensorPermitsOthersToDistributeDerivativeWorksOnlyUnderTheSameLicenseOrOneCompatibleWithTheOneT = The licensor permits others to distribute derivative works only under the same license or one compatible with the one that governs the licensor's work
+theLicensorPermitsOthersToCopyDistributeDisplayAndPerformOnlyUnalteredCopiesOfTheWorkNotDerivativeWo = The licensor permits others to copy, distribute, display and perform only unaltered copies of the work � not derivative works based on it
+thisIsACopyleftLicense = This is a copyleft license.
+thisIsNotACopyleftLicense = This is not a copyleft license.
+thisIsAppropriateForFreeCulturalWorks = This is appropriate for free cultural works.
+thisIsNotAppropriateForFreeCulturalWorks = This is not appropriate for free cultural works.
+reasonsNotToUseANonCommercialLicense = Reasons not to use a non commercial license.
+selectOtherKindOfLicenses = Select other kind of licenses:
+selectLicense = Select license
+areYouSure = Are you sure?
+paramCreatednewContentCreatedForInstance = [%s] created
+pleaseConfirm = Please confirm
+thisFolderIsEmpty = This folder is empty
+youWillDeleteItWithAllItsContentsAreYouSure = You will delete it with all its contents. Are you sure?
+welcomeToTheParamPublicChatRoom = Welcome to the [%s] public chat room
+createANewChatRoom = Create a new chat room
+newRoom = New room
+enterToThisRoom = Enter to this room
+openArchive = Open archive
+openTheConversationsArchiveOfThisRoom = Open the conversations archive of this room
+hereYouWillSeeTheArchiveOfOldConversationsInDevelopment = Here you will see the archive of old conversations (in development)
+create = Create
+theNameMustContainOnlyCharactersNumbersAndDashes = The name must contain only characters, numbers and dashes
+post = Post
+newPoll = New poll
+thisUserDoesNotHaveAHomepage = This user does not have a homepage
+oopsSomethingHasGoneWrongWithOurServersRetryLaterPlease = Oops! Something has gone wrong with our servers. Retry later, please.
+yourLanguage = Your language
+redblackAThemeName = redblack
+purpleAThemeName = purple
+greenAThemeName = green
+highcontrastAThemeName = highcontrast
+blackwhiteAThemeName = blackwhite
+campAThemeName = camp
+defaultAThemeName = default
+redAThemeName = red
+blueAThemeName = blue
+greyAThemeName = grey
+saharaAThemeName = sahara
+pinkAThemeName = pink
+whiteblackAThemeName = whiteblack
+transparentAThemeName = transparent
+aboutKuneTitleOfDialog = About Kune
+

Added: trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties	2011-09-19 20:25:07 UTC (rev 1522)
@@ -0,0 +1,5 @@
+addAsABuddienull = Añadir como colega
+chatNull = Chat ;)
+search = Buscar
+thisUserDoesNotHaveAHomepage = Este/a usuario/a no tiene una página personal
+openArchive = Abrir archivo
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -44,8 +44,8 @@
 
   @Inject
   public UserConfirmPanel(final I18nTranslationService i18n) {
-    dialog = new BasicTopDialog.Builder(DIALOG_ID, false, true).autoscroll(false).width(100).height(100).firstButtonId(
-        OK_ID).sndButtonId(CANCEL_ID).tabIndexStart(1).build();
+    dialog = new BasicTopDialog.Builder(DIALOG_ID, false, true).autoscroll(false).firstButtonId(OK_ID).sndButtonId(
+        CANCEL_ID).tabIndexStart(1).build();
     askLabel = new HTML();
     askLabel.addStyleName("k-userconfirm-label");
     dialog.getInnerPanel().add(askLabel);

Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -22,6 +22,7 @@
 import cc.kune.core.client.errors.DefaultException;
 import cc.kune.core.shared.domain.UserSNetVisibility;
 import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
 import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.dto.UserDTO;
 import cc.kune.core.shared.dto.UserInfoDTO;
@@ -49,6 +50,6 @@
 
   void setBuddiesVisibility(String userHash, StateToken groupToken, UserSNetVisibility visibility);
 
-  StateAbstractDTO updateUser(String userHash, UserDTO user) throws DefaultException;
+  StateAbstractDTO updateUser(String userHash, UserDTO user, I18nLanguageSimpleDTO lang);
 
 }

Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -21,6 +21,7 @@
 
 import cc.kune.core.shared.domain.UserSNetVisibility;
 import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
 import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.dto.UserDTO;
 import cc.kune.core.shared.dto.UserInfoDTO;
@@ -48,5 +49,6 @@
   void setBuddiesVisibility(String userHash, StateToken groupToken, UserSNetVisibility visibility,
       AsyncCallback<Void> asyncCallback);
 
-  void updateUser(String userHash, UserDTO user, AsyncCallback<StateAbstractDTO> callback);
+  void updateUser(String userHash, UserDTO user, I18nLanguageSimpleDTO lang,
+      AsyncCallback<StateAbstractDTO> callback);
 }

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -47,9 +47,9 @@
 
   @Inject
   public AboutKuneDialog(final I18nTranslationService i18n) {
-    dialog = new BasicTopDialog.Builder(ABOUT_KUNE_ID, true, true).title(i18n.t("About Kune")).autoscroll(
-        false).firstButtonTitle(i18n.t("Ok")).firstButtonId(ABOUT_KUNE_BTN_ID).tabIndexStart(1).height(
-        "300px").width("410px").build();
+    dialog = new BasicTopDialog.Builder(ABOUT_KUNE_ID, true, true).title(
+        i18n.tWithNT("About Kune", "title of dialog")).autoscroll(false).firstButtonTitle(i18n.t("Ok")).firstButtonId(
+        ABOUT_KUNE_BTN_ID).tabIndexStart(1).height("300px").width("410px").build();
     dialog.getInnerPanel().add(BINDER.createAndBindUi(this));
     dialog.getFirstBtn().addClickHandler(new ClickHandler() {
       @Override

Modified: trunk/src/main/java/cc/kune/core/server/manager/UserManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/UserManager.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/server/manager/UserManager.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -24,6 +24,7 @@
 import cc.kune.core.client.errors.I18nNotFoundException;
 import cc.kune.core.server.manager.impl.SearchResult;
 import cc.kune.core.shared.domain.UserSNetVisibility;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
 import cc.kune.core.shared.dto.UserDTO;
 import cc.kune.domain.User;
 import cc.kune.domain.utils.UserBuddiesData;
@@ -76,8 +77,9 @@
    *          the userId to change
    * @param user
    *          the userDTO with values to change
+   * @param lang
    * @return the User after updated
    */
-  User update(Long userId, UserDTO user);
+  User update(Long userId, UserDTO user, I18nLanguageSimpleDTO lang);
 
 }

Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -54,6 +54,7 @@
 import cc.kune.core.server.xmpp.ChatException;
 import cc.kune.core.server.xmpp.XmppManager;
 import cc.kune.core.shared.domain.UserSNetVisibility;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
 import cc.kune.core.shared.dto.UserDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.domain.Group;
@@ -325,9 +326,9 @@
   }
 
   @Override
-  public User update(final Long userId, final UserDTO userDTO) {
+  public User update(final Long userId, final UserDTO userDTO, final I18nLanguageSimpleDTO lang) {
     final User user = find(userId);
-    final String shortName = userDTO.getShortName();
+    // final String shortName = userDTO.getShortName();
     final String longName = userDTO.getName();
     final String email = userDTO.getEmail();
     final Group userGroup = user.getUserGroup();
@@ -347,7 +348,8 @@
       checkIfEmailAreInUse(email);
       user.setEmail(email);
     }
-    user.setLanguage(findLanguage(userDTO.getLanguage().getCode()));
+    user.setLanguage(findLanguage(lang.getCode()));
+    // user.setLanguage(findLanguage(userDTO.getLanguage().getCode()));
     persist(user);
     groupManager.persist(userGroup);
     return user;

Modified: trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -42,6 +42,7 @@
 import cc.kune.core.shared.domain.AccessRol;
 import cc.kune.core.shared.domain.UserSNetVisibility;
 import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
 import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.dto.UserDTO;
 import cc.kune.core.shared.dto.UserInfoDTO;
@@ -194,12 +195,13 @@
   @Override
   @Authenticated
   @Transactional
-  public StateAbstractDTO updateUser(final String userHash, final UserDTO user) throws DefaultException {
+  public StateAbstractDTO updateUser(final String userHash, final UserDTO user,
+      final I18nLanguageSimpleDTO lang) throws DefaultException {
     final Long id = getUserSession().getUser().getId();
     if (!id.equals(user.getId())) {
       throw new AccessViolationException();
     }
-    final User userUpdated = userManager.update(id, user);
+    final User userUpdated = userManager.update(id, user, lang);
     return contentRPC.getContent(userHash, userUpdated.getUserGroup().getStateToken());
   }
 }

Modified: trunk/src/main/java/cc/kune/core/shared/dto/I18nLanguageSimpleDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/I18nLanguageSimpleDTO.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/shared/dto/I18nLanguageSimpleDTO.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -23,7 +23,12 @@
 
 public class I18nLanguageSimpleDTO implements IsSerializable {
 
+  public static I18nLanguageSimpleDTO create(final I18nLanguageDTO language) {
+    return new I18nLanguageSimpleDTO(language.getCode(), language.getEnglishName());
+  }
+
   private String code;
+
   private String englishName;
 
   public I18nLanguageSimpleDTO() {

Modified: trunk/src/main/java/cc/kune/core/shared/dto/I18nTranslationDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/I18nTranslationDTO.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/shared/dto/I18nTranslationDTO.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -42,11 +42,11 @@
   private String trKey;
 
   public I18nTranslationDTO() {
-    this(null, null, null, null, null);
+    this(null, null, null, null, null, null);
   }
 
   public I18nTranslationDTO(final Long id, final String trKey, final String text, final Long parentId,
-      final String parentTrKey) {
+      final String parentTrKey, final String noteForTranslators) {
     this.id = id;
     this.trKey = trKey;
     this.text = text;

Modified: trunk/src/main/java/cc/kune/domain/I18nTranslation.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/I18nTranslation.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/domain/I18nTranslation.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -113,6 +113,7 @@
     this.setNoteForTranslators(noteForTranslators);
     if (parent == null) {
       assert trKey != null;
+      this.parent = this;
     }
     if (parent != null) {
       assert trKey == null;
@@ -151,7 +152,10 @@
   }
 
   public String getNoteForTranslators() {
-    return noteForTranslators;
+    if (parent == this) {
+      return noteForTranslators;
+    }
+    return parent.getNoteForTranslators();
   }
 
   /**
@@ -165,7 +169,10 @@
   }
 
   public Long getParentId() {
-    return parent == null ? null : parent.getId();
+    if (parent == this) {
+      return id;
+    }
+    return parent.getId();
   }
 
   public Integer getPluralizationIndex() {
@@ -181,11 +188,10 @@
   }
 
   public String getTrKey() {
-    if (parent != null) {
-      return parent.getTrKey();
-    } else {
-      return this.trKey;
+    if (parent == this) {
+      return trKey;
     }
+    return parent.getTrKey();
   }
 
   public String getType() {

Modified: trunk/src/main/java/cc/kune/domain/finders/I18nTranslationFinder.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/finders/I18nTranslationFinder.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/domain/finders/I18nTranslationFinder.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -33,9 +33,9 @@
 
 public interface I18nTranslationFinder {
   String TRANSLATED_COUNT_QUERY = "SELECT COUNT(gt.id) FROM I18nTranslation gt WHERE gt.language = :language and text!=null";
-  String TRANSLATED_QUERY = "SELECT NEW cc.kune.core.shared.dto.I18nTranslationDTO(gt.id, gt.trKey, gt.text, gt.parent.id, gt.parent.trKey) FROM I18nTranslation gt LEFT JOIN  gt.parent gp WHERE gt.language = :language AND gt.text!=null";
+  String TRANSLATED_QUERY = "SELECT NEW cc.kune.core.shared.dto.I18nTranslationDTO(gt.id, gt.trKey, gt.text, gt.parent.id, gt.parent.trKey, gt.parent.noteForTranslators) FROM I18nTranslation gt LEFT JOIN  gt.parent gp WHERE gt.language = :language AND gt.text!=null";
   String UNTRANSLATED_COUNT_QUERY = "SELECT COUNT(gt.id) FROM I18nTranslation gt WHERE gt.language = :language and text=null";
-  String UNTRANSLATED_QUERY = "SELECT NEW cc.kune.core.shared.dto.I18nTranslationDTO(gt.id, gt.trKey, gt.text, gt.parent.id, gt.parent.trKey) FROM I18nTranslation gt LEFT JOIN gt.parent gp WHERE gt.language = :language AND gt.text=null";
+  String UNTRANSLATED_QUERY = "SELECT NEW cc.kune.core.shared.dto.I18nTranslationDTO(gt.id, gt.trKey, gt.text, gt.parent.id, gt.parent.trKey, gt.parent.noteForTranslators) FROM I18nTranslation gt LEFT JOIN gt.parent gp WHERE gt.language = :language AND gt.text=null";
 
   @Finder(query = "SELECT gt FROM I18nTranslation gt JOIN gt.language gl WHERE gl.code = :language", returnAs = ArrayList.class)
   public List<I18nTranslation> findByLanguage(@Named("language") final String language);

Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -22,6 +22,7 @@
 import cc.kune.common.client.errors.UIException;
 import cc.kune.common.client.utils.SimpleCallback;
 import cc.kune.core.client.state.Session;
+import cc.kune.core.client.ui.DefaultForm;
 import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
@@ -47,6 +48,20 @@
       set(ENGLISH_NAME, englishName);
     }
 
+    @Override
+    public boolean equals(final Object obj) {
+      if (this == obj) {
+        return true;
+      }
+      if (obj == null) {
+        return false;
+      }
+      if (getClass() != obj.getClass()) {
+        return false;
+      }
+      return getCode().equals(((LanguageData) obj).getCode());
+    }
+
     public String getCode() {
       return get(CODE);
     }
@@ -54,6 +69,14 @@
     public String getEnglishName() {
       return get(ENGLISH_NAME);
     }
+
+    @Override
+    public int hashCode() {
+      final int prime = 31;
+      int result = 1;
+      result = prime * result + (getCode() == null ? 0 : getCode().hashCode());
+      return result;
+    }
   }
 
   public static final String LANG_FIELD = "k-langsp-lf";
@@ -71,6 +94,9 @@
     setFrame(false);
     setHeaderVisible(false);
     setBodyBorder(false);
+    // setWidth(300);
+    setLabelWidth(DefaultForm.DEF_FIELD_LABEL_WITH + 25);
+    setPadding(0);
     createLangCombo(withEnglish);
     super.add(langCombo);
   }
@@ -112,12 +138,16 @@
     for (final I18nLanguageSimpleDTO lang : session.getLanguages()) {
       final boolean isEnglish = lang.getCode().equals("en");
       if (!isEnglish || (isEnglish && withEnglish)) {
-        list.add(new LanguageData(lang.getCode(), lang.getEnglishName()));
+        list.add(getLangData(lang));
       }
     }
     return list;
   }
 
+  private LanguageData getLangData(final I18nLanguageSimpleDTO lang) {
+    return new LanguageData(lang.getCode(), lang.getEnglishName());
+  }
+
   public I18nLanguageSimpleDTO getLanguage() {
     final String langCode = langCombo.getValue().getCode();
     for (final I18nLanguageSimpleDTO lang : session.getLanguages()) {
@@ -156,6 +186,6 @@
   }
 
   public void setLanguage(final I18nLanguageSimpleDTO language) {
-    langCombo.setRawValue(language.getEnglishName());
+    langCombo.setValue(getLangData(language));
   }
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -141,7 +141,7 @@
       item.setDirty(true);
       dataProvider.refreshDisplays();
       saver.save(new I18nTranslationDTO(item.getId(), item.getTrKey(), newTranslation,
-          item.getParentId(), item.getParentTrKey()));
+          item.getParentId(), item.getParentTrKey(), item.getNoteForTranslators()));
     }
   }
 

Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -22,30 +22,49 @@
 import cc.kune.common.client.ui.MaskWidget;
 import cc.kune.core.client.auth.UserFieldFactory;
 import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.i18n.LanguageSelectorPanel;
 
+import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
 import com.extjs.gxt.ui.client.widget.form.TextField;
 import com.google.inject.Inject;
 
 public class UserOptGeneralPanel extends EntityOptGeneralPanel implements UserOptGeneralView {
 
   private static final String LONG_NAME_FIELD = "k-uogp-lname";
+  private final LanguageSelectorPanel langSelector;
   private final TextField<String> longName;
 
   @Inject
   public UserOptGeneralPanel(final I18nTranslationService i18n, final CoreResources res,
-      final MaskWidget maskWidget) {
+      final MaskWidget maskWidget, final LanguageSelectorPanel langSelector) {
     super(i18n, res, maskWidget);
+    this.langSelector = langSelector;
     longName = UserFieldFactory.createUserLongName(LONG_NAME_FIELD);
     add(longName);
+    langSelector.setLangTitle(i18n.t("Your language"));
+    langSelector.setLabelAlign(LabelAlign.LEFT);
+    langSelector.setLangSeparator(":");
+    add(langSelector);
   }
 
   @Override
+  public I18nLanguageSimpleDTO getLanguage() {
+    return langSelector.getLanguage();
+  }
+
+  @Override
   public String getLongName() {
     return longName.getValue();
   }
 
   @Override
+  public void setLanguage(final I18nLanguageSimpleDTO language) {
+    langSelector.setLanguage(language);
+  }
+
+  @Override
   public void setLongName(final String longName) {
     this.longName.setValue(longName);
   }

Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -26,6 +26,7 @@
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.client.state.UserSignInEvent;
 import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
 import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.dto.UserDTO;
 import cc.kune.core.shared.dto.UserSimpleDTO;
@@ -71,6 +72,7 @@
   protected void setState() {
     final UserSimpleDTO currentUser = session.getCurrentUser();
     userView.setLongName(currentUser.getName());
+    userView.setLanguage(I18nLanguageSimpleDTO.create(currentUser.getLanguage()));
   }
 
   @Override
@@ -81,8 +83,7 @@
       final UserDTO user = new UserDTO();
       user.setId(currentUser.getId());
       user.setName(userView.getLongName());
-      user.setLanguage(currentUser.getLanguage());
-      userService.get().updateUser(session.getUserHash(), user,
+      userService.get().updateUser(session.getUserHash(), user, userView.getLanguage(),
           new AsyncCallbackSimple<StateAbstractDTO>() {
             @Override
             public void onSuccess(final StateAbstractDTO result) {

Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -19,10 +19,15 @@
  */
 package cc.kune.gspace.client.options.general;
 
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
+
 public interface UserOptGeneralView extends EntityOptGeneralView {
 
+  I18nLanguageSimpleDTO getLanguage();
+
   String getLongName();
 
+  void setLanguage(I18nLanguageSimpleDTO language);
+
   void setLongName(String longName);
-
 }

Modified: trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -50,7 +50,7 @@
       super();
       this.theme = theme;
       this.manager = manager;
-      putValue(NAME, i18n.t(theme.getName()));
+      putValue(NAME, i18n.tWithNT(theme.getName(), "a theme name"));
       putValue(SMALL_ICON, theme.getBackColors()[0]);
     }
 

Modified: trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java	2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java	2011-09-19 20:25:07 UTC (rev 1522)
@@ -52,6 +52,7 @@
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.I18nCountryDTO;
 import cc.kune.core.shared.dto.I18nLanguageDTO;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
 import cc.kune.core.shared.dto.SocialNetworkDataDTO;
 import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.dto.StateContentDTO;
@@ -75,6 +76,7 @@
   Mapper mapper;
   @Inject
   KuneBasicProperties properties;
+  private I18nLanguageSimpleDTO simpleLang;
   @Inject
   SocialNetworkRPC sn;
   private TimeZoneDTO timezone;
@@ -142,6 +144,7 @@
   public void init() {
     new IntegrationTestHelper(this);
     lang = new I18nLanguageDTO();
+    simpleLang = new I18nLanguageSimpleDTO(lang.getCode(), lang.getEnglishName());
     country = new I18nCountryDTO();
     timezone = new TimeZoneDTO();
     lang.setCode("en");
@@ -204,7 +207,7 @@
     userService.createUser(user, false);
     // do login as admin
     doLogin();
-    userService.updateUser(getHash(), user);
+    userService.updateUser(getHash(), user, simpleLang);
   }
 
   @Test
@@ -235,7 +238,7 @@
     final UserDTO userChanged = new UserDTO(shortName, longName, "123456", email, lang, country,
         timezone, null, true, SubscriptionMode.manual, "blue");
     userChanged.setId(session.getUser().getId());
-    userService.updateUser(getHash(), userChanged);
+    userService.updateUser(getHash(), userChanged, simpleLang);
   }
 
   @Test(expected = GroupLongNameInUseException.class)




More information about the kune-commits mailing list