- The output size gets the input's one.
* `csvRead` and `csvTextScan` are now implemented without extra copies.
* `editvar()` GUI support copy-paste of strings removing quotes.
+* calendar() can now display formated calendars.
+
Help pages:
* [#16265](http://bugzilla.scilab.org/show_bug.cgi?id=16265): The translated pages of the `warning` documentation were not up-to-date.
* [#16271](http://bugzilla.scilab.org/show_bug.cgi?id=16271): `loadmatfile()` was never able to automatically detect the input data format.
* [#16272](http://bugzilla.scilab.org/show_bug.cgi?id=16272): `spzeros(0,n)` and `spzeros(n,0)` were different from `sparse(0,0)`.
+* [#16273](http://bugzilla.scilab.org/show_bug.cgi?id=16273): `calendar()` had no formated display mode.
* [#16275](http://bugzilla.scilab.org/show_bug.cgi?id=16275): `fsolve(x0, fun, tol)` no longer took `tol` into account.
* [#16293](http://bugzilla.scilab.org/show_bug.cgi?id=16293): Some demos run in step-by-step console mode(4) did not focus user's attention to the console to proceed.
* [#16299](http://bugzilla.scilab.org/show_bug.cgi?id=16299): After `graypolarplot()`, `colorbar()` displayed an empty ungraduated color bar.
xml:lang="en" xml:id="calendar">
<refnamediv>
<refname>calendar</refname>
- <refpurpose>Calendar of a given month of a given year</refpurpose>
+ <refpurpose>Calendar of a given month and year (Gregorian dates)</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Syntax</title>
<synopsis>
+ calendar display;
+ calendar(y, m, "display");
c = calendar()
c = calendar(y,m)
</synopsis>
</refsynopsisdiv>
<refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>y</term>
+ <listitem>
+ <para>integer in [1800 3000]: The Gregorian year.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>m</term>
+ <listitem>
+ <para>integer in [1, 12]: The month.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>c</term>
+ <listitem>
+ <para>list, with
+ <table>
+ <tr><th>c(1):</th><td>single string: The calendar title</td></tr>
+ <tr><th>c(2):</th><td>single string: Days names.</td></tr>
+ <tr><th>c(3):</th><td>6x7 matrix of days indices in the month
+ (0 for days out of the month)</td>
+ </tr>
+ </table>
+ </para>
+ <para>
+ The title and days names are translated according to the current language.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
<title>Description</title>
- <para>c = calendar() returns a list containing a calendar for the current month.
- The calendar runs from Monday to Sunday.
+ <para>
+ <emphasis role="bold">calendar display</emphasis>; displays in the console the
+ calendar of the current month.
+ </para>
+ <para>
+ <emphasis role="bold">calendar(y,m,"display")</emphasis>; displays in the console the
+ calendar of the month <varname>m</varname> for the year <varname>y</varname>.
</para>
- <para>c = calendar(y,m), where y and m are integers, returns a calendar for the specified
- month of the specified year.
+ <para>
+ <emphasis role="bold">c = calendar()</emphasis> returns a list containing the
+ calendar for the current month. Weeks start on Monday and end on Sunday.
+ </para>
+ <para>
+ <emphasis role="bold">c = calendar(y, m)</emphasis> returns a list containing the
+ calendar for the given month and year.
</para>
</refsection>
<refsection>
<title>Examples</title>
<programlisting role="example"><![CDATA[
-calendar()
+calendar
]]></programlisting>
<screen><![CDATA[
--> calendar
ans =
ans(1)
- Mar 2019
+ Dec 2019
ans(2)
- M Tu W Th F Sat Sun
+ Mon Tue Wed Thu Fri Sat Sun
ans(3)
- 0. 0. 0. 0. 1. 2. 3.
- 4. 5. 6. 7. 8. 9. 10.
- 11. 12. 13. 14. 15. 16. 17.
- 18. 19. 20. 21. 22. 23. 24.
- 25. 26. 27. 28. 29. 30. 31.
- 0. 0. 0. 0. 0. 0. 0.
+ 0. 0. 0. 0. 0. 0. 1.
+ 2. 3. 4. 5. 6. 7. 8.
+ 9. 10. 11. 12. 13. 14. 15.
+ 16. 17. 18. 19. 20. 21. 22.
+ 23. 24. 25. 26. 27. 28. 29.
+ 30. 31. 0. 0. 0. 0. 0.
]]></screen>
<para/>
<programlisting role="example"><![CDATA[
-c = calendar(1973, 8);
-mprintf("\n %s\n%s\n",c(1),c(2));mprintf(strcat(emptystr(1,7)+" %2d ")+"\n",c(3));
+calendar display;
]]></programlisting>
<screen><![CDATA[
---> c = calendar(1973, 8);
---> mprintf("\n %s\n%s\n",c(1),c(2));mprintf(strcat(emptystr(1,7)+" %2d ")+"\n",c(3));
+--> calendar display;
- Aug 1973
- M Tu W Th F Sat Sun
- 0 0 1 2 3 4 5
- 6 7 8 9 10 11 12
- 13 14 15 16 17 18 19
- 20 21 22 23 24 25 26
- 27 28 29 30 31 0 0
- 0 0 0 0 0 0 0
+ Dec 2019
+ Mon Tue Wed Thu Fri Sat Sun
+ 1
+ 2 3 4 5 6 7 8
+ 9 10 11 12 13 14 15
+ 16 17 18 19 20 21 22
+ 23 24 25 26 27 28 29
+ 30 31
+]]></screen>
+ <para/>
+ <programlisting role="example"><![CDATA[
+calendar(1973, 8, "display");
+ ]]></programlisting>
+ <screen><![CDATA[
+--> calendar(1973, 8, "display");
+
+ Aug 1973
+ Mon Tue Wed Thu Fri Sat Sun
+ 1 2 3 4 5
+ 6 7 8 9 10 11 12
+ 13 14 15 16 17 18 19
+ 20 21 22 23 24 25 26
+ 27 28 29 30 31
]]></screen>
</refsection>
<refsection role="see also">
<title>See also</title>
<simplelist type="inline">
<member>
+ <link linkend="weekday">weekday</link>
+ </member>
+ <member>
<link linkend="datevec">datevec</link>
</member>
<member>
</member>
</simplelist>
</refsection>
+ <refsection role="history">
+ <title>History</title>
+ <revhistory>
+ <revision>
+ <revnumber>6.1</revnumber>
+ <revdescription>
+ "display" option added.
+ </revdescription>
+ </revision>
+ </revhistory>
+ </refsection>
</refentry>
<refsynopsisdiv>
<title>Séquence d'appel</title>
<synopsis>
+ calendar display;
+ calendar(y, m, "display");
c = calendar()
c = calendar(y,m)
</synopsis>
</refsynopsisdiv>
<refsection>
+ <title>Arguments</title>
+ <variablelist>
+ <varlistentry>
+ <term>y</term>
+ <listitem>
+ <para>
+ Nombre entier dans l'intervalle [1800, 3000] : l'année choisie,
+ dans le calendrier grégorien.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>m</term>
+ <listitem>
+ <para>Nombre entier dans [1,12] : le mois.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>c</term>
+ <listitem>
+ <para>liste, avec
+ <table>
+ <tr><th>c(1):</th><td>Intitulé du calendrier (texte unique)</td></tr>
+ <tr><th>c(2):</th><td>Intitulés brefs des jours de la semaine (texte unique)</td></tr>
+ <tr><th>c(3):</th><td>Matrice 6x7 des n° des jours dans le mois
+ (0 pour les jours hors du mois)</td></tr>
+ </table>
+ </para>
+ <para>
+ Les intitulés sont traduits dans la langue de la session courante.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
<title>Description</title>
- <para>c = calendar() retourne une liste contenant le calendrier pour le mois en cours.
- Les semaines commencent le lundi et se terminent le dimanche.
+ <para>
+ <emphasis role="bold">calendar display</emphasis>; affiche dans la console le
+ calendrier du mois en cours.
+ Les semaines commencent le lundi et se terminent le dimanche.
+ </para>
+ <para>
+ <emphasis role="bold">calendar(y,m,"display")</emphasis>; affiche dans la console
+ le calendrier du mois <varname>m</varname> pour l'année <varname>y</varname>.
+ </para>
+ <para>
+ c = calendar() fournit une liste contenant le calendrier pour le mois en cours.
</para>
- <para>c = calendar(y, m), où y et m sont des entiers, retourne le calendrier pour le mois
- <literal>m</literal> de l'année <literal>y</literal> spécifiés.
+ <para>
+ c = calendar(y, m) fournit le calendrier pour le mois et l'année spécifiés.
</para>
</refsection>
<refsection>
--> calendar
ans =
ans(1)
- Mars 2019
+ Déc. 2019
ans(2)
- L Ma M Je V Sam Dim
+ Lun Mar Mer Jeu Ven Sam Dim
ans(3)
- 0. 0. 0. 0. 1. 2. 3.
- 4. 5. 6. 7. 8. 9. 10.
- 11. 12. 13. 14. 15. 16. 17.
- 18. 19. 20. 21. 22. 23. 24.
- 25. 26. 27. 28. 29. 30. 31.
- 0. 0. 0. 0. 0. 0. 0.
+ 0. 0. 0. 0. 0. 0. 1.
+ 2. 3. 4. 5. 6. 7. 8.
+ 9. 10. 11. 12. 13. 14. 15.
+ 16. 17. 18. 19. 20. 21. 22.
+ 23. 24. 25. 26. 27. 28. 29.
+ 30. 31. 0. 0. 0. 0. 0.
]]></screen>
<para/>
<programlisting role="example"><![CDATA[
-c = calendar(1973, 8);
-mprintf("\n %s\n%s\n",c(1),c(2));mprintf(strcat(emptystr(1,7)+" %2d")+"\n",c(3));
+calendar display;
]]></programlisting>
<screen><![CDATA[
---> mprintf("\n %s\n%s\n",c(1),c(2));mprintf(strcat(emptystr(1,7)+" %2d")+"\n",c(3));
+--> calendar display;
- Août 1973
- L Ma M Je V Sam Dim
- 0 0 1 2 3 4 5
- 6 7 8 9 10 11 12
- 13 14 15 16 17 18 19
- 20 21 22 23 24 25 26
- 27 28 29 30 31 0 0
- 0 0 0 0 0 0 0
+ Déc. 2019
+ Lun Mar Mer Jeu Ven Sam Dim
+ 1
+ 2 3 4 5 6 7 8
+ 9 10 11 12 13 14 15
+ 16 17 18 19 20 21 22
+ 23 24 25 26 27 28 29
+ 30 31
+]]></screen>
+ <para/>
+ <programlisting role="example"><![CDATA[
+calendar(1973, 8, "display");
+ ]]></programlisting>
+ <screen><![CDATA[
+--> calendar(1973, 8, "display");
+
+ Août 1973
+ Lun Mar Mer Jeu Ven Sam Dim
+ 1 2 3 4 5
+ 6 7 8 9 10 11 12
+ 13 14 15 16 17 18 19
+ 20 21 22 23 24 25 26
+ 27 28 29 30 31
]]></screen>
</refsection>
<refsection role="see also">
<title>Voir aussi</title>
<simplelist type="inline">
<member>
+ <link linkend="weekday">weekday</link>
+ </member>
+ <member>
<link linkend="datevec">datevec</link>
</member>
<member>
</member>
</simplelist>
</refsection>
+ <refsection role="history">
+ <title>Historique</title>
+ <revhistory>
+ <revision>
+ <revnumber>6.1</revnumber>
+ <revdescription>
+ Option "display" ajoutée.
+ </revdescription>
+ </revision>
+ </revhistory>
+ </refsection>
</refentry>
<refsynopsisdiv>
<title>呼び出し手順</title>
<synopsis>
+ calendar display;
+ calendar(y, m, "display");
c = calendar()
c = calendar(y,m)
</synopsis>
</refsynopsisdiv>
<refsection>
+ <title>設定</title>
+ <variablelist>
+ <varlistentry>
+ <term>y</term>
+ <listitem>
+ <para>integer in [1800 3000]: The Gregorian year.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>m</term>
+ <listitem>
+ <para>integer in [1, 12]: The month.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>c</term>
+ <listitem>
+ <para>list, with
+ <table>
+ <tr><th>c(1):</th><td>single string: The calendar title</td></tr>
+ <tr><th>c(2):</th><td>single string: Days names</td></tr>
+ <tr><th>c(3):</th><td>6x7 matrix of days indices in the month
+ (0 for days out of the month)</td>
+ </tr>
+ </table>
+ </para>
+ <para>
+ The title and days names are translated according to the current language.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsection>
+ <refsection>
<title>説明</title>
<para>c = calendar() は現在の月に関するカレンダーを含むリストを返します.
週は月曜日に始まり、日曜日に終わる.
<para>c = calendar(y,m), ただし, y および m は整数で, 指定した年の
指定した月のカレンダーを返します.
</para>
+ <para>
+ <emphasis role="bold">calendar display</emphasis>; displays in the console the
+ calendar of the current month.
+ </para>
+ <para>
+ <emphasis role="bold">calendar(y,m,"display")</emphasis>; displays in the console the
+ calendar of the month <varname>m</varname> for the year <varname>y</varname>.
+ </para>
</refsection>
<refsection>
<title>例</title>
<programlisting role="example"><![CDATA[
-calendar()
+calendar
]]></programlisting>
<screen><![CDATA[
--> calendar
ans =
ans(1)
- 3月 2019
+ 12月 2019
ans(2)
- 月 火 水 木 金 土 日
+ 月 火 水 木 金 土 日
ans(3)
- 0. 0. 0. 0. 1. 2. 3.
- 4. 5. 6. 7. 8. 9. 10.
- 11. 12. 13. 14. 15. 16. 17.
- 18. 19. 20. 21. 22. 23. 24.
- 25. 26. 27. 28. 29. 30. 31.
- 0. 0. 0. 0. 0. 0. 0.
+ 0. 0. 0. 0. 0. 0. 1.
+ 2. 3. 4. 5. 6. 7. 8.
+ 9. 10. 11. 12. 13. 14. 15.
+ 16. 17. 18. 19. 20. 21. 22.
+ 23. 24. 25. 26. 27. 28. 29.
+ 30. 31. 0. 0. 0. 0. 0.
]]></screen>
<para/>
<programlisting role="example"><![CDATA[
-c = calendar(1973, 8);
-mprintf("\n %s\n%s\n",c(1),c(2));mprintf(strcat(emptystr(1,7)+" %2d ")+"\n",c(3));
+calendar display;
]]></programlisting>
<screen><![CDATA[
---> c = calendar(1973, 8);
---> mprintf("\n %s\n%s\n",c(1),c(2));mprintf(strcat(emptystr(1,7)+" %2d ")+"\n",c(3));
-
- 8月 1973
- 月 火 水 木 金 土 日
- 0 0 1 2 3 4 5
- 6 7 8 9 10 11 12
- 13 14 15 16 17 18 19
- 20 21 22 23 24 25 26
- 27 28 29 30 31 0 0
- 0 0 0 0 0 0 0
+--> calendar display
+
+ 12月 2019
+ 月 火 水 木 金 土 日
+ 1
+ 2 3 4 5 6 7 8
+ 9 10 11 12 13 14 15
+ 16 17 18 19 20 21 22
+ 23 24 25 26 27 28 29
+ 30 31
+]]></screen>
+ <para/>
+ <programlisting role="example"><![CDATA[
+calendar(1973, 8, "display");
+ ]]></programlisting>
+ <screen><![CDATA[
+--> calendar(1973, 8, "display");
+
+ 8月 1973
+ 月 火 水 木 金 土 日
+ 1 2 3 4 5
+ 6 7 8 9 10 11 12
+ 13 14 15 16 17 18 19
+ 20 21 22 23 24 25 26
+ 27 28 29 30 31
]]></screen>
</refsection>
<refsection role="see also">
<title>参照</title>
<simplelist type="inline">
<member>
+ <link linkend="weekday">weekday</link>
+ </member>
+ <member>
<link linkend="datevec">datevec</link>
</member>
<member>
</member>
</simplelist>
</refsection>
+ <refsection role="history">
+ <title>履歴</title>
+ <revhistory>
+ <revision>
+ <revnumber>6.1</revnumber>
+ <revdescription>
+ "display" option added.
+ </revdescription>
+ </revision>
+ </revhistory>
+ </refsection>
</refentry>
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 22:05+0000\n"
+"PO-Revision-Date: 2020-01-10:05+0000\n"
"Last-Translator: Scilab.team <Unknown>\n"
"Language-Team: Catalan <ca@li.org>\n"
"Language: ca\n"
msgid "Dec"
msgstr "Des"
-msgid " M Tu W Th F Sat Sun"
-msgstr " Dl Dt Dc Dj Dv Ds Dg"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "Dl Dt Dc Dj Dv Ds Dg"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 22:01+0000\n"
+"PO-Revision-Date: 2020-01-10 22:01+0000\n"
"Last-Translator: Scilab.team <Unknown>\n"
"Language-Team: Czech <cs@li.org>\n"
"Language: cs\n"
msgid "Dec"
msgstr "Pro"
-msgid " M Tu W Th F Sat Sun"
-msgstr " Po Út St Čt Pá So Ne"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "Pon Úte Stř Čtv Pát Sob Ned"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 21:18+0000\n"
+"PO-Revision-Date: 2020-01-10 21:18+0000\n"
"Last-Translator: Scilab.team <Unknown>\n"
"Language-Team: German <de@li.org>\n"
"Language: de\n"
msgid "Dec"
msgstr "Dezember"
-msgid " M Tu W Th F Sat Sun"
-msgstr " Mon Die Mitt Don Fre Sa So"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "Mon Die Mitt Don Fre Sam Son"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 09:53+0000\n"
+"PO-Revision-Date: 2020-01-10 09:53+0000\n"
"Last-Translator: Scilab.team <Unknown>\n"
"Language-Team: Spanish <es@li.org>\n"
"Language: es\n"
msgid "Dec"
msgstr "Dic"
-msgid " M Tu W Th F Sat Sun"
-msgstr " L M X J V S D"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "Lun Mar Mié Jue Vié Sáb Dom"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 11:40+0000\n"
+"PO-Revision-Date: 2020-01-10 11:40+0000\n"
"Last-Translator: Paul Bignier <Unknown>\n"
"Language-Team: French <fr@li.org>\n"
"Language: fr\n"
msgid "Dec"
msgstr "Déc."
-msgid " M Tu W Th F Sat Sun"
-msgstr " Lun Mar Mer Jeu Ven Sam Dim"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "Lun Mar Mer Jeu Ven Sam Dim"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 22:02+0000\n"
+"PO-Revision-Date: 2020-01-10 22:02+0000\n"
"Last-Translator: Carml <mighty.carml@gmail.com>\n"
"Language-Team: Italian <it@li.org>\n"
"Language: it\n"
msgid "Dec"
msgstr "Dic"
-msgid " M Tu W Th F Sat Sun"
-msgstr " L Ma M G V Sab Dom"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "Lun Mar Mer Gio Ven Sab Dom"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 15:40+0000\n"
+"PO-Revision-Date: 2020-01-10 15:40+0000\n"
"Last-Translator: Rui Hirokawa <Unknown>\n"
"Language-Team: Japanese <z-saito@guitar.ocn.ne.jp>\n"
"Language: ja\n"
#
# File: macros/calendar.sci, line: 52
-msgid " M Tu W Th F Sat Sun"
-msgstr " 月 火 水 木 金 土 日"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "月 火 水 木 金 土 日"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 22:00+0000\n"
+"PO-Revision-Date: 2020-01-10 22:00+0000\n"
"Last-Translator: Scilab.team <Unknown>\n"
"Language-Team: Polish <pl@li.org>\n"
"Language: pl\n"
msgid "Dec"
msgstr "Gru"
-msgid " M Tu W Th F Sat Sun"
-msgstr " Pn Wt Śr Cz Pt So Ni"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "Pon Wt Śr Czw Pt Sob Nie"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 22:00+0000\n"
+"PO-Revision-Date: 2020-01-10 22:00+0000\n"
"Last-Translator: RodolfoRG <rodolforg@gmail.com>\n"
"Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
"Language: pt_BR\n"
msgid "Dec"
msgstr "Dez"
-msgid " M Tu W Th F Sat Sun"
-msgstr " Seg Ter Qua Qui Sex Sáb Dom"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "Seg Ter Qua Qui Sex Sáb Dom"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 07:55+0000\n"
+"PO-Revision-Date: 2020-01-10 07:55+0000\n"
"Last-Translator: Stanislav V. Kroter <krotersv@gmail.com>\n"
"Language-Team: Russian <ru@li.org>\n"
"Language: ru\n"
msgid "Dec"
msgstr "Дек"
-msgid " M Tu W Th F Sat Sun"
-msgstr " Пн Вт Ср Чт Пт Сб Вс"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "Пн Вт Ср Чт Пт Сб Вс"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
#
# File: modules/time/macros/calendar.sci, line: 55
-msgid " M Tu W Th F Sat Sun"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
msgstr ""
#
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 06:33+0000\n"
+"PO-Revision-Date: 2020-01-10 06:33+0000\n"
"Last-Translator: Yuri Chornoivan <yurchor@gmail.com>\n"
"Language-Team: Ukrainian <translation@linux.org.ua>\n"
"Language: uk\n"
msgid "Dec"
msgstr "гру"
-msgid " M Tu W Th F Sat Sun"
-msgstr " Пнд Втр Сер Чтв Птн Сбт Ндл"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "Пнд Втр Сер Чтв Птн Сбт Ндл"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 13:16+0000\n"
+"PO-Revision-Date: 2020-01-10 13:16+0000\n"
"Last-Translator: Webish <Unknown>\n"
"Language-Team: Simplified Chinese <zh_CN@li.org>\n"
"Language: zh_CN\n"
msgid "Dec"
msgstr "12月"
-msgid " M Tu W Th F Sat Sun"
-msgstr " 周一 周二 周三 周四 周五 周六 周日"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "周一 周二 周三 周四 周五 周六 周日"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
"Project-Id-Version: scilab\n"
"Report-Msgid-Bugs-To: <localization@lists.scilab.org>\n"
"POT-Creation-Date: 2013-04-16 17:44+0100\n"
-"PO-Revision-Date: 2019-02-12 09:40+0000\n"
+"PO-Revision-Date: 2020-01-10 09:40+0000\n"
"Last-Translator: Scilab.team <Unknown>\n"
"Language-Team: Traditional Chinese <zh_TW@li.org>\n"
"Language: zh_TW\n"
msgid "Dec"
msgstr "十二月"
-msgid " M Tu W Th F Sat Sun"
-msgstr " 一 二 三 四 五 六 日"
+msgid "Mon Tue Wed Thu Fri Sat Sun"
+msgstr "一 二 三 四 五 六 日"
#, c-format
msgid "%s: Wrong type for input argument #%d: Real matrix expected.\n"
//------------------------------------------------------------------------
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) INRIA - Allan CORNET
-//
// Copyright (C) 2012 - 2016 - Scilab Enterprises
+// Copyright (C) 2019 - Samuel GOUGEON
//
// This file is hereby licensed under the terms of the GNU GPL v2.0,
// pursuant to article 5.3.4 of the CeCILL v.2.1.
// For more information, see the COPYING file which you should have received
// along with this program.
//------------------------------------------------------------------------
+
function listcal = calendar(varargin)
- lhs=argn(1);
- rhs=argn(2);
+ lhs = argn(1);
+ rhs = argn(2);
- c=[0,0,0];
+ c = [0,0,0];
+
+ // Looking for the "display" keyword
+ display = %F
+ if rhs > 0 then
+ v = varargin($)
+ if type(v)==10 & v(1)==part("display",1:length(v))
+ display = %T
+ varargin($) = null()
+ rhs = rhs-1
+ break
+ end
+ end
select rhs
case 0
- ct=getdate();
- c=[ct(1),ct(2),1]
+ ct = getdate();
+ c = [ct(1),ct(2),1]
break
case 2
- Y=varargin(1);
- M=varargin(2);
- if (size(Y) == [1,1]) & (size(M) == [1,1]) then
- else
- error(msprintf(gettext("%s: Wrong type for input arguments: Must be scalars.\n"),"calendar"));
+ Y = varargin(1);
+ M = varargin(2);
+ msg = gettext("%s: Argument #%d: Scalar (1 element) expected.\n");
+ if length(Y)>1
+ error(msprintf(msg,"calendar", 1));
+ end
+ if length(M)>1
+ error(msprintf(msg,"calendar", 2));
end
- if (M < 1) | (M > 12) then error(msprintf(gettext("%s: Wrong value for input argument: Must be between %d and %d.\n"),"calendar",1,12));,end
- c=[Y,M,1];
+ if (M < 1) | (M > 12) then
+ msg = gettext("%s: Argument #%d: Must be in the interval [%d, %d].\n")
+ error(msprintf(msg, "calendar", 1, 12));
+ end
+ c = [Y, M, 1];
break
else
- error(msprintf(gettext("%s: Wrong number of input arguments.\n"),"calendar"));
+ msg = gettext("%s: Wrong number of input arguments: %d or %d expected.\n")
+ if display
+ error(msprintf(msg, "calendar", 1, 3));
+ else
+ error(msprintf(msg, "calendar", 0, 2));
+ end
end
- mths = [gettext("Jan"); ..
+ months = [gettext("Jan"); ..
gettext("Feb"); ..
gettext("Mar"); ..
gettext("Apr"); ..
gettext("Nov"); ..
gettext("Dec")];
- mth = mths(c(:,2),:);
- cal=Calendar(c(1),c(2));
- listcal=list(sprintf("%s %d",mth,c(1)),gettext(" M Tu W Th F Sat Sun"),cal);
+ month = months(c(:,2), :);
+ cal = Calendar(c(1), c(2));
+ dayNames = gettext("Mon Tue Wed Thu Fri Sat Sun")
+ //!\\ Glyphs for ja, zh, .. are not monospaced, even in the Monospaced font
+ // .po translations have been tuned and tested for alignments with Monospaced 12.
+ Title = sprintf("%s %d", month, c(1))
+ if display then
+ k = vectorfind(cal, zeros(1,7), "r")
+ cal(k,:) = []
+ t = matrix(msprintf("%d\n",cal(:)), -1, 7)
+ t(t=="0") = ""
+ t = strcat(justify(t, "r"), " ", "c");
+ Title = blanks((length(t(2))-length(Title))/2) + Title
+ t = strsubst(["" ; Title ; dayNames ; t], " ", ascii(160)) // non-breakable spaces
+ mprintf(" %s\n", t)
+ listcal = [];
+ else
+ listcal = list(Title, dayNames, cal);
+ end
endfunction
-//------------------------------------------------------------------------
setlanguage("en_US"); // This only chance this test pass is to launch it when scilab is in english
M = calendar(2005,3);
M1ref = ['Mar 2005'];
-M2ref = [' M Tu W Th F Sat Sun'];
+M2ref = ['Mon Tue Wed Thu Fri Sat Sun'];
M3ref = [0,1,2,3,4,5,6;7,8,9,10,11,12,13;14,15,16,17,18,19,20;21,22,23,24,25,26,27;28,29,30,31,0,0,0;0,0,0,0,0,0,0];
Mref = list(M1ref,M2ref,M3ref );
if or((Mref<>M) <> [%F,%F,%F]) then bugmes();quit;end
M = calendar(2005,3);
M1ref = ['Mar 2005'];
-M2ref = [' M Tu W Th F Sat Sun'];
+M2ref = ['Mon Tue Wed Thu Fri Sat Sun'];
M3ref = [0,1,2,3,4,5,6;7,8,9,10,11,12,13;14,15,16,17,18,19,20;21,22,23,24,25,26,27;28,29,30,31,0,0,0;0,0,0,0,0,0,0];
Mref = list(M1ref,M2ref,M3ref );
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2007-2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
+// Copyright (C) 2019 - Samuel GOUGEON
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- CLI SHELL MODE -->
+// <-- ENGLISH IMPOSED -->
// unit tests for calendar function
// =============================================================================
-current_language = getlanguage();
-setlanguage("en_US"); // This only chance this test pass is to launch it when scilab is in english
cal = calendar(2005,12);
title_ref = "Dec 2005";
-week_ref = " M Tu W Th F Sat Sun";
+week_ref = "Mon Tue Wed Thu Fri Sat Sun";
cal_ref = [0,0,0,1,2,3,4;5,6,7,8,9,10,11;12,13,14,15,16,17,18;19,20,21,22,23,24,25;26,27,28,29,30,31,0;0,0,0,0,0,0,0];
-if cal(1) <> title_ref then bugmes();quit;end
-if cal(2) <> week_ref then bugmes();quit;end
-if or(cal(3) <> cal_ref) then bugmes();quit;end
-setlanguage(current_language);
+assert_checkequal(cal(1), title_ref);
+assert_checkequal(cal(2), week_ref);
+assert_checkequal(cal(3), cal_ref);
+calendar(2019, 12, "display");
+
+ Dec 2019
+ Mon Tue Wed Thu Fri Sat Sun
+ 1
+ 2 3 4 5 6 7 8
+ 9 10 11 12 13 14 15
+ 16 17 18 19 20 21 22
+ 23 24 25 26 27 28 29
+ 30 31
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2007-2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
+// Copyright (C) 2019 - Samuel GOUGEON
//
// This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- CLI SHELL MODE -->
+// <-- ENGLISH IMPOSED -->
// unit tests for calendar function
// =============================================================================
-current_language = getlanguage();
-setlanguage("en_US"); // This only chance this test pass is to launch it when scilab is in english
cal = calendar(2005,12);
title_ref = "Dec 2005";
-week_ref = " M Tu W Th F Sat Sun";
+week_ref = "Mon Tue Wed Thu Fri Sat Sun";
cal_ref = [0,0,0,1,2,3,4;5,6,7,8,9,10,11;12,13,14,15,16,17,18;19,20,21,22,23,24,25;26,27,28,29,30,31,0;0,0,0,0,0,0,0];
-if cal(1) <> title_ref then pause,end
-if cal(2) <> week_ref then pause,end
-if or(cal(3) <> cal_ref) then pause,end
+assert_checkequal(cal(1), title_ref);
+assert_checkequal(cal(2), week_ref);
+assert_checkequal(cal(3), cal_ref);
-setlanguage(current_language);
+calendar(2019, 12, "display");