Author: Paul_R
Date: 2008-08-27 16:29:06 +0200 (Wed, 27 Aug 2008)
New Revision: 1615
Added:
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/en.po
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/fr.po
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/nl.po
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/sources/net/karmaLab/tuxDroid/gadgets/WeatherGadget.java
Log:
* Internationalized the gadget.
The gadget translation doesn't work, and some string in the gadget.xml
file are not translated by the framework
Added:
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/en.po
===================================================================
---
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/en.po
(rev 0)
+++
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/en.po
2008-08-27 14:29:06 UTC (rev 1615)
@@ -0,0 +1,26 @@
+msgid "http://www.google.com/ig/api?hl=en&weather=%s"
+msgstr "http://www.google.com/ig/api?hl=en&weather=%s"
+
+msgid "unknown"
+msgstr "unknown"
+
+msgid "Current weather at %s are \"%s\" with a temperature of %s degrees %s.
Humidity level is %s percents."
+msgstr "Current weather at %s are \"%s\" with a temperature of %s degrees %s.
Humidity level is %s percents."
+
+msgid "Tomorrow's forecast : \"%s\" temperatures from %s to %s degrees."
+msgstr "Tomorrow's forecast : \"%s\" temperatures from %s to %s degrees."
+
+msgid "Weather Gadget"
+msgstr "Weather Gadget"
+
+msgid "Google Weather Gadget"
+msgstr "Google Weather Gadget"
+
+msgid "Weather location"
+msgstr "Weather location"
+
+msgid "Temperature unit (celsius,fahrenheit)"
+msgstr "Temperature unit (celsius,fahrenheit)"
+
+msgid "Give tomorrow weather too"
+msgstr "Give tomorrow weather too"
\ No newline at end of file
Added:
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/fr.po
===================================================================
---
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/fr.po
(rev 0)
+++
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/fr.po
2008-08-27 14:29:06 UTC (rev 1615)
@@ -0,0 +1,26 @@
+msgid "http://www.google.com/ig/api?hl=en&weather=%s"
+msgstr "http://www.google.com/ig/api?hl=fr&weather=%s"
+
+msgid "unknown"
+msgstr "inconnue"
+
+msgid "Current weather at %s are \"%s\" with a temperature of %s degrees %s.
Humidity level is %s percents."
+msgstr "La météo actuelle à %s est \"%s\" avec une température de %s degrés
%s. Le taux d'humidité est de %s pour cent."
+
+msgid "Tomorrow's forecast : \"%s\" temperatures from %s to %s degrees."
+msgstr "Les prévisions pour demain : \"%s\" avec des température de %s à %s
degrés."
+
+msgid "Weather Gadget"
+msgstr "Gadget Météo"
+
+msgid "Google Weather Gadget"
+msgstr "Google Gadget Météo"
+
+msgid "Weather location"
+msgstr "Localisation ÃÃÃÃÃÃ"
+
+msgid "Temperature unit (celsius,fahrenheit)"
+msgstr "Unité de température (celsius,fahrenheit)"
+
+msgid "Give tomorrow weather too"
+msgstr "Donner les prévisions météo"
\ No newline at end of file
Added:
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/nl.po
===================================================================
---
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/nl.po
(rev 0)
+++
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/resources/nl.po
2008-08-27 14:29:06 UTC (rev 1615)
@@ -0,0 +1,26 @@
+msgid "http://www.google.com/ig/api?hl=en&weather=%s"
+msgstr "http://www.google.com/ig/api?hl=fr&weather=%s"
+
+msgid "unknown"
+msgstr "inconnue"
+
+msgid "Current weather at %s are \"%s\" with a temperature of %s degrees %s.
Humidity level is %s percents."
+msgstr "La météo actuelle à %s est \"%s\" avec une température de %s degrés
%s. Le taux d'humidité est de %s pour cent."
+
+msgid "Tomorrow's forecast : \"%s\" temperatures from %s to %s degrees."
+msgstr "Les prévisions pour demain : \"%s\" avec des température de %s à %s
degrés."
+
+msgid "Weather Gadget"
+msgstr "Gadget Météo"
+
+msgid "Google Weather Gadget"
+msgstr "Google Gadget Météo"
+
+msgid "Weather location"
+msgstr "Localisation ÃÃÃÃÃÃ"
+
+msgid "Temperature unit (celsius,fahrenheit)"
+msgstr "Unité de température (celsius,fahrenheit)"
+
+msgid "Give tomorrow weather too"
+msgstr "Donner les prévisions météo"
\ No newline at end of file
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/sources/net/karmaLab/tuxDroid/gadgets/WeatherGadget.java
===================================================================
---
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/sources/net/karmaLab/tuxDroid/gadgets/WeatherGadget.java
2008-08-27 12:30:21 UTC (rev 1614)
+++
software_suite_v2/software/gadgets/tuxdroid-gadget-weather/trunk/tuxdroid-gadget-weather/sources/net/karmaLab/tuxDroid/gadgets/WeatherGadget.java
2008-08-27 14:29:06 UTC (rev 1615)
@@ -85,13 +85,13 @@
File file;
String inputLine;
Writer streamOutput = null;
-
XMLParser parser = new XMLParser();
Element xmlReply;
-
try {
+
/* create a new URL object */
- URL xml = new
URL(String.format("http://www.google.com/ig/api?hl=%s&weather=%s",
I18N.cc_Locale, configuration().getLocation()));
+ /* BUG : I18N.cc_Locale don't works yet. */
+ URL xml = new
URL(String.format("http://www.google.com/ig/api?hl=en&weather=%s",
configuration().getLocation()));
/* Open the connection */
URLConnection yc = xml.openConnection();
/* And read the stream input */
@@ -132,7 +132,7 @@
Element current = xmlReply.getElementAt(1);
String weather = getData(current, "condition");
if (weather.length() == 0) {
- weather = "inconnues";
+ weather = "unknown";
}
String temperature = getData(current, configuration().getUnit()
== Unit.celsius ? "temp_c" : "temp_f");
String humidity = getData(current, "humidity");
@@ -143,7 +143,7 @@
// getData(current, "icon")));
// String wind = getData(current, "wind_condition");
// wind = humidity.split("\\s+:\\s+")[1];
- String message = String.format("Les conditions actuelles sur %s
sont \"%s\" avec une température de %s degrès %s. Le taux d'humidité est de %s
pour cent.", configuration().getLocation(), weather, temperature,
+ String message = String.format("Current weather at %s are
\"%s\" with a temperature of %s degrees %s. Humidity level is %s percents.",
configuration().getLocation(), weather, temperature,
configuration().getUnit() == Unit.celsius ?
"celsius" : "fahrenheit", humidity);
throwMessage(message);
@@ -172,7 +172,7 @@
temperatureHigh = getData(current, "high");
}
- message = String.format("Le temps demain sera \"%s\"
avec des températures allant de %s à %s degrés.", weather, temperature,
temperatureHigh);
+ message = String.format("Tomorrow's forecast : \"%s\"
temperatures from %s to %s degrees.", weather, temperature, temperatureHigh);
throwMessage(message);
}
outputFile.deleteOnExit();
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn