[tuxdroid-svn] r5791 - in software_suite_v3/software/plugin/plugin-clock/trunk: resources sources/
Status: Beta
Brought to you by:
ks156
From: ks156 <c2m...@c2...> - 2009-10-29 07:01:54
|
Author: ks156 Date: 2009-10-29 07:35:12 +0100 (Thu, 29 Oct 2009) New Revision: 5791 Modified: software_suite_v3/software/plugin/plugin-clock/trunk/resources/de.po software_suite_v3/software/plugin/plugin-clock/trunk/resources/en.po software_suite_v3/software/plugin/plugin-clock/trunk/resources/fr.po software_suite_v3/software/plugin/plugin-clock/trunk/resources/nl.po software_suite_v3/software/plugin/plugin-clock/trunk/resources/plugin.pot software_suite_v3/software/plugin/plugin-clock/trunk/sources/net/karmaLab/tuxDroid/plugins/ClockPlugin.java Log: * Merged r5644 through r5790 from random_sentences Modified: software_suite_v3/software/plugin/plugin-clock/trunk/resources/de.po =================================================================== --- software_suite_v3/software/plugin/plugin-clock/trunk/resources/de.po 2009-10-29 06:33:41 UTC (rev 5790) +++ software_suite_v3/software/plugin/plugin-clock/trunk/resources/de.po 2009-10-29 06:35:12 UTC (rev 5791) @@ -7,15 +7,59 @@ msgid "This plugin gives you the time." msgstr "Dieses Plugin sagt Ihnen die Zeit an." -msgid "Current time is {0} hours and {1} minutes." +msgid "It is {0} hours and {1} minutes." msgstr "Es ist {0} Uhr und {1} Minuten." -msgid "Current time is {0} hours." -msgstr "Jetzt ist es {0} Uhr." +msgid "It is {0} hours {1}." +msgstr "Es ist {0} Uhr {1}." +msgid "At the next beep it will be exactly {0} hours {1} ... BEEP !" +msgstr "Beim nächsten Beep ist es genau {0} Uhr {1} ... BEEP !" + +msgid "At the next beep it will be {0} hours and {1} minutes ... BEEP !" +msgstr "Beim nächsten Beep ist es genau {0} Uhr und {1} Minuten ... BEEP !" + +msgid "It's {1} hours and {0} minutes ... oops, I mean {0} hours and {1} minutes" +msgstr "Es ist {1} Uhr und {0} Minuten ... halt, Ich meine {0} Uhr und {1} Minuten" + +msgid "It's {1} hours {0} ... oops, I mean {0} hours {1}." +msgstr "Es ist {1} Uhr {0} ... halt, Ich meine {0} Uhr {1}." + +msgid "It is {0} o'clock" +msgstr "Es ist {0} Uhr" + +msgid "It's exactly {0} hours" +msgstr "Es ist genau {0} Uhr." + +msgid "At the next beep it will be exactly {0} o'clock ... BEEP !" +msgstr "Beim nächsten Beep ist es genau {0} Uhr ... BEEP !" + +msgid "At the next beep it will be {0} o'clock ... BEEP !" +msgstr "Beim nächsten Beep ist es {0} Uhr ... BEEP !" + +msgid "It's midnight" +msgstr "Es ist Mitternacht" + +msgid "It's noon" +msgstr "Es ist Mittag" + +msgid "It's quarter past {0}" +msgstr "Es ist Viertel nach {0}" + +msgid "It's a quarter after {0}" +msgstr "Es ist Viertel nach {0}" + +msgid "It's quarter to {0}" +msgstr "Es ist Viertel vor {0}" + +msgid "It's a quarter until {0}" +msgstr "Es ist Viertel vor {0}" + +msgid "It's half past {0}" +msgstr "Es ist halb {0}" + msgid "Start every x from full hour" msgstr "Hinweise" msgid "Start me every x (From full hour)" msgstr "Sage die Zeit häufig an" - Modified: software_suite_v3/software/plugin/plugin-clock/trunk/resources/en.po =================================================================== --- software_suite_v3/software/plugin/plugin-clock/trunk/resources/en.po 2009-10-29 06:33:41 UTC (rev 5790) +++ software_suite_v3/software/plugin/plugin-clock/trunk/resources/en.po 2009-10-29 06:35:12 UTC (rev 5791) @@ -7,12 +7,75 @@ msgid "This plugin gives you the time." msgstr "This plugin gives you the time." -msgid "Current time is {0} hours and {1} minutes." -msgstr "Current time is {0} hours and {1} minutes." +msgid "It is {0} hours and {1} minutes." +msgstr "It is {0} hours and {1} minutes." -msgid "Current time is {0} hours." -msgstr "Current time is {0} hours." +msgid "It is {0} hours {1}." +msgstr "It is {0} hours {1}." +msgid "At the next beep it will be exactly {0} hours {1} ... BEEP !" +msgstr "At the next beep it will be exactly {0} hours {1} ... BEEP !" + +msgid "At the next beep it will be {0} hours and {1} minutes ... BEEP !" +msgstr "At the next beep it will be {0} hours and {1} minutes ... BEEP !" + +msgid "It's {1} hours and {0} minutes ... oops, I mean {0} hours and {1} minutes" +msgstr "It's {1} hours and {0} minutes ... oops, I mean {0} hours and {1} minutes" + +msgid "It's {1} hours {0} ... oops, I mean {0} hours {1}." +msgstr "It's {1} hours {0} ... oops, I mean {0} hours {1}." + +msgid "It is {0} o'clock" +msgstr "It is {0} o'clock" + +msgid "It's exactly {0} hours" +msgstr "It's exactly {0} hours" + +msgid "At the next beep it will be exactly {0} o'clock ... BEEP !" +msgstr "At the next beep it will be exactly {0} o'clock ... BEEP !" + +msgid "At the next beep it will be {0} o'clock ... BEEP !" +msgstr "At the next beep it will be {0} o'clock ... BEEP !" + +msgid "It's midnight" +msgstr "It's midnight" + +msgid "It's noon" +msgstr "It's noon" + +msgid "It's quarter past {0}" +msgstr "It's quarter past {0}" + +msgid "It's a quarter after {0}" +msgstr "It's a quarter after {0}" + +msgid "It's quarter past midnight" +msgstr "It's quarter past midnight" + +msgid "It's quarter past noon" +msgstr "It's quarter past noon" + +msgid "It's quarter to {0}" +msgstr "It's quarter to {0}" + +msgid "It's a quarter until {0}" +msgstr "It's a quarter until {0}" + +msgid "It's quarter to midnight" +msgstr "It's quarter to midnight" + +msgid "It's quarter to noon" +msgstr "It's quarter to noon" + +msgid "It's half past {0}" +msgstr "It's half past {0}" + +msgid "It's half past midnight" +msgstr "It's half past midnight" + +msgid "It's half past noon" +msgstr "It's half past noon" + msgid "Start every x from full hour" msgstr "Alerts" Modified: software_suite_v3/software/plugin/plugin-clock/trunk/resources/fr.po =================================================================== --- software_suite_v3/software/plugin/plugin-clock/trunk/resources/fr.po 2009-10-29 06:33:41 UTC (rev 5790) +++ software_suite_v3/software/plugin/plugin-clock/trunk/resources/fr.po 2009-10-29 06:35:12 UTC (rev 5791) @@ -7,12 +7,75 @@ msgid "This plugin gives you the time." msgstr "Ce plugin vous donne l'heure." -msgid "Current time is {0} hours and {1} minutes." +msgid "It is {0} hours and {1} minutes." msgstr "Il est {0} heures et {1} minutes." -msgid "Current time is {0} hours." -msgstr "Il est {0} heures." +msgid "It is {0} hours {1}." +msgstr "Il est {0} heures {1}." +msgid "At the next beep it will be exactly {0} hours {1} ... BEEP !" +msgstr "Au prochain top, il sera exactement {0} heures {1} ... TOP !" + +msgid "At the next beep it will be {0} hours and {1} minutes ... BEEP !" +msgstr "Au prochain top, il sera {0} heures et {1} minutes ... TOP !" + +msgid "It's {1} hours and {0} minutes ... oops, I mean {0} hours and {1} minutes" +msgstr "Il est {1} heures et {0} minutes. euh ... {0} heures et {1} minutes" + +msgid "It's {1} hours {0} ... oops, I mean {0} hours {1}." +msgstr "Il est {1} heures {0}. euh ... {0} heures {1}." + +msgid "It is {0} o'clock" +msgstr "Il est {0} heures" + +msgid "It's exactly {0} hours" +msgstr "Il est exactement {0} heures." + +msgid "At the next beep it will be exactly {0} o'clock ... BEEP !" +msgstr "Au prochain top, il sera exactement {0} heures ... TOP !" + +msgid "At the next beep it will be {0} o'clock ... BEEP !" +msgstr "Au prochain top, il sera {0} heures ... TOP !" + +msgid "It's midnight" +msgstr "Il est minuit" + +msgid "It's noon" +msgstr "Il est midi" + +msgid "It's quarter past {0}" +msgstr "Il est {0} heures et quart" + +msgid "It's a quarter after {0}" +msgstr "Il est {0} heures quart" + +msgid "It's quarter past midnight" +msgstr "Il est minuit et quart" + +msgid "It's quarter past noon" +msgstr "Il est midi et quart" + +msgid "It's quarter to {0}" +msgstr "Il est {0} heures moins quart" + +msgid "It's a quarter until {0}" +msgstr "Il est {0} heures moins le quart" + +msgid "It's quarter to midnight" +msgstr "Il est minuit moins quart" + +msgid "It's quarter to noon" +msgstr "Il est midi moins quart" + +msgid "It's half past {0}" +msgstr "Il est {0} heures et demi" + +msgid "It's half past midnight" +msgstr "Il est minuit et demi" + +msgid "It's half past noon" +msgstr "Il est midi et demi" + msgid "Start every x from full hour" msgstr "Alertes" Modified: software_suite_v3/software/plugin/plugin-clock/trunk/resources/nl.po =================================================================== --- software_suite_v3/software/plugin/plugin-clock/trunk/resources/nl.po 2009-10-29 06:33:41 UTC (rev 5790) +++ software_suite_v3/software/plugin/plugin-clock/trunk/resources/nl.po 2009-10-29 06:35:12 UTC (rev 5791) @@ -7,12 +7,57 @@ msgid "This plugin gives you the time." msgstr "Deze plugin geeft de tijd weer." -msgid "Current time is {0} hours and {1} minutes." +msgid "It is {0} hours and {1} minutes." msgstr "Het is nu {0} uur en {1} minuten." -msgid "Current time is {0} hours." -msgstr "Het is nu {0} uur." +msgid "It is {0} hours {1}." +msgstr "Het is {0} uur {1}." +msgid "At the next beep it will be exactly {0} hours {1} ... BEEP !" +msgstr "Bij de volgende biep, is het precies {0} uur {1} ... BIEP !" + +msgid "At the next beep it will be {0} hours and {1} minutes ... BEEP !" +msgstr "Bij de volgende biep, is het {0} uur en {1} minuten ... BIEP !" + +msgid "It's {1} hours and {0} minutes ... oops, I mean {0} hours and {1} minutes" +msgstr "Het is {1} uur en {0} minuten ... Oeps, ik bedoel {0} uur en {1} minuten" + +msgid "It's {1} hours {0} ... oops, I mean {0} hours {1}." +msgstr "Het is {1} uur {0} ... Oeps, ik bedoel {0} uur {1}." + +msgid "It is {0} o'clock" +msgstr "Het is kop {0} uur" + +msgid "It's exactly {0} hours" +msgstr "Het is nu precies {0} uur." + +msgid "At the next beep it will be exactly {0} o'clock ... BEEP !" +msgstr "Bij de volgende biep, is het kop {0} uur ... BIEP !" + +msgid "At the next beep it will be {0} o'clock ... BEEP !" +msgstr "Bij de volgende biep, is het {0} uur ... BIEP !" + +msgid "It's midnight" +msgstr "Het is middernacht" + +msgid "It's noon" +msgstr "Het is middag" + +msgid "It's quarter past {0}" +msgstr "Het is kwart na {0}" + +msgid "It's a quarter after {0}" +msgstr "Het is kwart over {0}" + +msgid "It's quarter to {0}" +msgstr "Het is kwart voor {0}" + +msgid "It's a quarter until {0}" +msgstr "Het is kwart voor {0}" + +msgid "It's half past {0}" +msgstr "Het is half {0}" + msgid "Start every x from full hour" msgstr "Alarmen" Modified: software_suite_v3/software/plugin/plugin-clock/trunk/resources/plugin.pot =================================================================== --- software_suite_v3/software/plugin/plugin-clock/trunk/resources/plugin.pot 2009-10-29 06:33:41 UTC (rev 5790) +++ software_suite_v3/software/plugin/plugin-clock/trunk/resources/plugin.pot 2009-10-29 06:35:12 UTC (rev 5791) @@ -1,20 +1,83 @@ -msgid "Clock" -msgstr "" - -msgid "Clock." -msgstr "" - -msgid "This plugin gives you the time." -msgstr "" - -msgid "Current time is {0} hours and {1} minutes." -msgstr "" - -msgid "Current time is {0} hours." -msgstr "" - -msgid "Start every x from full hour" -msgstr "" - -msgid "Start me every x (From full hour)" +msgid "Clock" msgstr "" + +msgid "Clock." +msgstr "" + +msgid "This plugin gives you the time." +msgstr "" + +msgid "It is {0} hours and {1} minutes." +msgstr "" + +msgid "It is {0} hours {1}." +msgstr "" + +msgid "At the next beep it will be exactly {0} hours {1} ... BEEP !" +msgstr "" + +msgid "At the next beep it will be {0} hours and {1} minutes ... BEEP !" +msgstr "" + +msgid "It's {1} hours and {0} minutes ... oops, I mean {0} hours and {1} minutes" +msgstr "" + +msgid "It's {1} hours {0} ... oops, I mean {0} hours {1}." +msgstr "" + +msgid "It is {0} o'clock" +msgstr "" + +msgid "It's exactly {0} hours" +msgstr "" + +msgid "At the next beep it will be exactly {0} o'clock ... BEEP !" +msgstr "" + +msgid "At the next beep it will be {0} o'clock ... BEEP !" +msgstr "" + +msgid "It's midnight" +msgstr "" + +msgid "It's noon" +msgstr "" + +msgid "It's quarter past {0}" +msgstr "" + +msgid "It's a quarter after {0}" +msgstr "" + +msgid "It's quarter past midnight" +msgstr "" + +msgid "It's quarter past noon" +msgstr "" + +msgid "It's quarter to {0}" +msgstr "" + +msgid "It's a quarter until {0}" +msgstr "" + +msgid "It's quarter to midnight" +msgstr "" + +msgid "It's quarter to noon" +msgstr "" + +msgid "It's half past {0}" +msgstr "" + +msgid "It's half past midnight" +msgstr "" + +msgid "It's half past noon" +msgstr "" + +msgid "Start every x from full hour" +msgstr "" + +msgid "Start me every x (From full hour)" +msgstr "" Modified: software_suite_v3/software/plugin/plugin-clock/trunk/sources/net/karmaLab/tuxDroid/plugins/ClockPlugin.java =================================================================== --- software_suite_v3/software/plugin/plugin-clock/trunk/sources/net/karmaLab/tuxDroid/plugins/ClockPlugin.java 2009-10-29 06:33:41 UTC (rev 5790) +++ software_suite_v3/software/plugin/plugin-clock/trunk/sources/net/karmaLab/tuxDroid/plugins/ClockPlugin.java 2009-10-29 06:35:12 UTC (rev 5791) @@ -25,51 +25,152 @@ import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; +import java.util.Random; import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePlugin; import com.kysoh.tuxdroid.plugin.framework.plugin.SimplePluginConfiguration; public class ClockPlugin extends SimplePlugin<SimplePluginConfiguration> { - /** - * Main gadget access point. - * - * @param args - * commands - * @throws Exception - * errors - */ - public static void main(String[] args) throws Exception { - new ClockPlugin().boot(args, new SimplePluginConfiguration()); - } + /** + * Main gadget access point. + * + * @param args + * commands + * @throws Exception + * errors + */ - private final Calendar calendar = new GregorianCalendar(); + String[] normalSentences = { + "It is {0} hours and {1} minutes.", + "It is {0} hours {1}.", + "At the next beep it will be exactly {0} hours {1} ... BEEP !", + "At the next beep it will be {0} hours and {1} minutes ... BEEP !", + "It's {1} hours and {0} minutes ... oops, I mean {0} hours and {1} minutes", + "It's {1} hours {0} ... oops, I mean {0} hours {1}." + }; + String[] sharpSentences = { + "It is {0} o'clock", + "It's exactly {0} hours", + "At the next beep it will be exactly {0} o'clock ... BEEP !", + "At the next beep it will be {0} o'clock ... BEEP !" + }; - @Override - public void start() { - if (getCommand().equals("run")) { - run(); - } - else { - run(); - } - } + public static void main(String[] args) throws Exception { + new ClockPlugin().boot(args, new SimplePluginConfiguration()); + } - private void run() { - calendar.setTime(new Date()); - int h = calendar.get(Calendar.HOUR_OF_DAY); - int m = calendar.get(Calendar.MINUTE); - if (m != 0) { - throwMessage("Current time is {0} hours and {1} minutes.", h, m); - } else { - throwMessage("Current time is {0} hours.", h); - } - } + private final Calendar calendar = new GregorianCalendar(); @Override + public void start() { + if (getCommand().equals("run")) { + run(); + } + else { + run(); + } + } + + private void run() { + calendar.setTime(new Date()); + int h = calendar.get(Calendar.HOUR_OF_DAY); + int m = calendar.get(Calendar.MINUTE); + + Random rand = new Random(); + Boolean random = rand.nextBoolean(); + String language = configuration().getLanguage(); + + if (m == 0) { + if (h == 0) { + throwMessage("It's midnight"); + } + else if (h == 12) { + throwMessage("It's noon"); + } + else { + throwMessage(this.pickSentence(sharpSentences), h); + } + } + else if (m == 15) { + if (h == 0 && !(language.equals("nl") || language.equals("de"))) + { + throwMessage("It's quarter past midnight"); + } + else if (h == 12 && !(language.equals("nl") || language.equals("de"))) + { + throwMessage("It's quarter past noon"); + } + else if (h == 0 && (language.equals("nl") || language.equals("de"))) + { + throwMessage("It's a quarter after {0}", "12"); + } + else + { + if (random) { + throwMessage("It's quarter past {0}", h); + } + else { + throwMessage("It's a quarter after {0}", h); + } + } + } + else if (m == 30) { + if (language.equals("nl") || language.equals("de")) { + throwMessage("It's half past {0}", h+1); + } + else { + if (h == 0) + { + throwMessage("It's half past midnight"); + } + else if (h == 12) + { + throwMessage("It's half past noon"); + } + else + { + throwMessage("It's half past {0}", h); + } + } + } + else if (m == 45) { + if (h == 23 && !(language.equals("nl") || language.equals("de"))) + { + throwMessage("It's quarter to midnight"); + } + else if (h == 11 && !(language.equals("nl") || language.equals("de"))) + { + throwMessage("It's quarter to noon"); + } + else if (h == 23 && (language.equals("nl") || language.equals("de"))) + { + throwMessage("It's quarter to {0}", "12"); + } + else + { + if (random) { + throwMessage("It's quarter to {0}", (h + 1)); + } + else { + throwMessage("It's a quarter until {0}", (h + 1)); + } + } + } + else { + throwMessage(this.pickSentence(normalSentences), h, m); + } + } + + private String pickSentence(String[] list) { + Random rand = new Random(); + return list[rand.nextInt(list.length)]; + } + + @Override public void onPluginStop() { } - + @Override public void onPluginEvent(String eventName, String[] eventValues) { } |