[kune-commits] r1433 - donate/src/cc/kune/sandbox/donate/client

Mauricio Rodriguez Serrano mrodrigs at ourproject.org
Wed Jun 29 00:16:58 CEST 2011


Author: mrodrigs
Date: 2011-06-29 00:16:58 +0200 (Wed, 29 Jun 2011)
New Revision: 1433

Modified:
   donate/src/cc/kune/sandbox/donate/client/DonateMessages.java
   donate/src/cc/kune/sandbox/donate/client/DonateMessages_en.properties
   donate/src/cc/kune/sandbox/donate/client/DonateMessages_es.properties
   donate/src/cc/kune/sandbox/donate/client/DonatePanel.java
Log:
Implemented i18n spanish, english and constants

Modified: donate/src/cc/kune/sandbox/donate/client/DonateMessages.java
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/DonateMessages.java	2011-06-28 21:28:10 UTC (rev 1432)
+++ donate/src/cc/kune/sandbox/donate/client/DonateMessages.java	2011-06-28 22:16:58 UTC (rev 1433)
@@ -11,5 +11,13 @@
 	String lnk1Dollar();
 	String lnk2Dollar();
 	String lnk3Dollar();
+	
+	String euroRegularDonation();
+	String dollarRegularDonation();
+	
+	
+	String defaultValue();
+	String defaultTitle();
+	
 }
 

Modified: donate/src/cc/kune/sandbox/donate/client/DonateMessages_en.properties
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/DonateMessages_en.properties	2011-06-28 21:28:10 UTC (rev 1432)
+++ donate/src/cc/kune/sandbox/donate/client/DonateMessages_en.properties	2011-06-28 22:16:58 UTC (rev 1433)
@@ -4,4 +4,10 @@
 
 lnk1Dollar = 10 $/month
 lnk2Dollar = 15 $/month
-lnk3Dollar = 20 $/month
\ No newline at end of file
+lnk3Dollar = 20 $/month
+
+defaultValue = Other value
+defaultTitle = Type other value and press Enter
+dollarDonation = $
+euroRegularDonation = \u20AC/month
+dollarRegularDonation =  $/month

Modified: donate/src/cc/kune/sandbox/donate/client/DonateMessages_es.properties
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/DonateMessages_es.properties	2011-06-28 21:28:10 UTC (rev 1432)
+++ donate/src/cc/kune/sandbox/donate/client/DonateMessages_es.properties	2011-06-28 22:16:58 UTC (rev 1433)
@@ -4,4 +4,9 @@
 
 lnk1Dollar = 10 $/mes
 lnk2Dollar = 15 $/mes
-lnk3Dollar = 20 $/mes
\ No newline at end of file
+lnk3Dollar = 20 $/mes
+
+defaultValue = Otro valor
+defaultTitle = Digite otro valor y presione enter
+euroRegularDonation = \u20AC/mes
+dollarRegularDonation =  $/mes

Modified: donate/src/cc/kune/sandbox/donate/client/DonatePanel.java
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/DonatePanel.java	2011-06-28 21:28:10 UTC (rev 1432)
+++ donate/src/cc/kune/sandbox/donate/client/DonatePanel.java	2011-06-28 22:16:58 UTC (rev 1433)
@@ -18,17 +18,17 @@
 
 public class DonatePanel extends Composite {
 	//Cons
-	private final String DEFAULT_VALUE = "other value"; 
-	private final String DEFAULT_TITLE = "Type other value and press Enter";
+	DonateMessages donateMessages = (DonateMessages) GWT.create(DonateMessages.class);
+	DonateConstants donateConstants = (DonateConstants) GWT.create(DonateConstants.class);
+
 	private final String NAME_TB = "a3";
 	private final int REGULAR_DONATION_EURO = 1;
 	private final int REGULAR_DONATION_DOLLAR = 2;
 	private final int SINGLE_DONATION_EURO = 3;
 	private final int SINGLE_DONATION_DOLLAR = 4;
-	private final String EURO_REGULAR_DONATION = " \u20AC/month";
-	private final String DOLLAR_REGULAR_DONATION = " $/month";
-	private final String EURO_DONATION = " \u20AC";
-	private final String DOLLAR_DONATION = " $";
+	
+	
+	
 	private final String LNK_EURO_REGULAR_DONATION_1 = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=EUR&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=10&lc=es&item_name= Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png";
 	private final String LNK_EURO_REGULAR_DONATION_2 = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=EUR&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=15&lc=es&item_name= Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png";
 	private final String LNK_EURO_REGULAR_DONATION_3 = "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=EUR&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=20&lc=es&item_name= Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png";
@@ -186,6 +186,8 @@
 	}
 
 	public DonatePanel() {
+		
+		
 		initWidget(uiBinder.createAndBindUi(this));
 		//Config of Dollar Regular Donations
 		lnkEuros1.setHTML(getTextDonation(REGULAR_DONATION_EURO, 10));
@@ -202,12 +204,12 @@
 		
 		txtbxOtherValueEuros.setVisibleLength(10);
 		txtbxOtherValueEuros.setName(NAME_TB);
-		txtbxOtherValueEuros.setText(DEFAULT_VALUE);
-		txtbxOtherValueEuros.setTitle(DEFAULT_TITLE);
+		txtbxOtherValueEuros.setText(donateMessages.defaultValue());
+		txtbxOtherValueEuros.setTitle(donateMessages.defaultTitle());
 	
 		txtbxOtherValueEuros.addFocusHandler(new FocusHandler() {
 			public void onFocus(FocusEvent event) {
-				if(txtbxOtherValueEuros.getText().equals(DEFAULT_VALUE))
+				if(txtbxOtherValueEuros.getText().equals(donateMessages.defaultValue()))
 				{
 					txtbxOtherValueEuros.setText("");
 				}
@@ -228,7 +230,7 @@
 				//validate
 				if(sActualValue == "" || iActualValue == 0)
 				{
-					txtbxOtherValueEuros.setText(DEFAULT_VALUE);
+					txtbxOtherValueEuros.setText(donateMessages.defaultValue());
 				}
 			}
 		});
@@ -248,12 +250,12 @@
 		
 		txtbxOtherValueDollar.setVisibleLength(10);
 		txtbxOtherValueDollar.setName(NAME_TB);
-		txtbxOtherValueDollar.setText(DEFAULT_VALUE);
-		txtbxOtherValueDollar.setTitle(DEFAULT_TITLE);
+		txtbxOtherValueDollar.setText(donateMessages.defaultValue());
+		txtbxOtherValueDollar.setTitle(donateMessages.defaultTitle());
 	
 		txtbxOtherValueDollar.addFocusHandler(new FocusHandler() {
 			public void onFocus(FocusEvent event) {
-				if(txtbxOtherValueDollar.getText().equals(DEFAULT_VALUE))
+				if(txtbxOtherValueDollar.getText().equals(donateMessages.defaultValue()))
 				{
 					txtbxOtherValueDollar.setText("");
 				}
@@ -271,7 +273,7 @@
 				//validate
 				if(sActualValue == "" || iActualValue == 0)
 				{
-					txtbxOtherValueDollar.setText(DEFAULT_VALUE);
+					txtbxOtherValueDollar.setText(donateMessages.defaultValue());
 				}
 			}
 		});
@@ -318,16 +320,16 @@
 		switch (iTypeDonation)
 		{
 			case REGULAR_DONATION_EURO:
-				sText += EURO_REGULAR_DONATION;
+				sText += " " +donateMessages.euroRegularDonation();
 			break;
 			case SINGLE_DONATION_EURO:
-				sText += EURO_DONATION;
+				sText += " " +donateConstants.euroDonation();
 			break;
 			case REGULAR_DONATION_DOLLAR:
-				sText += DOLLAR_REGULAR_DONATION;
+				sText += " " +donateMessages.dollarRegularDonation();
 			break;
 			case SINGLE_DONATION_DOLLAR:
-				sText += DOLLAR_DONATION;
+				sText +=  " " +donateConstants.dollarDonation();
 			break;
 		}
 		return sText;




More information about the kune-commits mailing list