Skip to content

Commit

Permalink
Let's make more translatable scripts (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Jan 20, 2019
1 parent f12e22f commit d4b6f27
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 65 deletions.
8 changes: 4 additions & 4 deletions po/stellarium-scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FILE(GLOB poscfiles RELATIVE "${CMAKE_SOURCE_DIR}/po/stellarium-scripts/" "*.po")
LIST(SORT poscfiles)
STRING(REGEX REPLACE ".po" "" outposcfiles "${poscfiles}")
FILE(GLOB poscrfiles RELATIVE "${CMAKE_SOURCE_DIR}/po/stellarium-scripts/" "*.po")
LIST(SORT poscrfiles)
STRING(REGEX REPLACE ".po" "" outposcrfiles "${poscrfiles}")

GETTEXT_CREATE_TRANSLATIONS(stellarium-scripts DEFAULT_TARGET ${outposcfiles})
GETTEXT_CREATE_TRANSLATIONS(stellarium-scripts DEFAULT_TARGET ${outposcrfiles})

# Discard this target if xgettext is not installed
IF(${XGETTEXT_FOUND})
Expand Down
4 changes: 4 additions & 0 deletions po/stellarium-scripts/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ scripts/best_ngc.ssc
scripts/binocular_highlights.ssc
scripts/binosky.ssc
scripts/double_stars.ssc
scripts/morsels_1.ssc
scripts/morsels_2.ssc
scripts/morsels_3.ssc
scripts/morsels_4.ssc
scripts/supernova.ssc
61 changes: 60 additions & 1 deletion po/stellarium-scripts/stellarium-scripts.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2019-01-20 01:10+0700\n"
"POT-Creation-Date: 2019-01-20 08:50+0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -680,6 +680,65 @@ msgstr ""
msgid "Separation:"
msgstr ""

#: scripts/morsels_1.ssc:15 scripts/morsels_1.ssc:16 scripts/morsels_1.ssc:18
#: scripts/morsels_1.ssc:22 scripts/morsels_1.ssc:23 scripts/morsels_1.ssc:29
#: scripts/morsels_1.ssc:30 scripts/morsels_1.ssc:34 scripts/morsels_1.ssc:36
#: scripts/morsels_1.ssc:38 scripts/morsels_1.ssc:43
msgid "Shadows from Io, Ganymede and Callisto"
msgstr ""

#: scripts/morsels_1.ssc:17 scripts/morsels_1.ssc:19 scripts/morsels_1.ssc:20
#: scripts/morsels_1.ssc:21 scripts/morsels_1.ssc:25 scripts/morsels_1.ssc:26
#: scripts/morsels_1.ssc:27 scripts/morsels_1.ssc:28 scripts/morsels_1.ssc:31
#: scripts/morsels_1.ssc:33 scripts/morsels_1.ssc:35 scripts/morsels_1.ssc:37
#: scripts/morsels_1.ssc:39 scripts/morsels_1.ssc:41 scripts/morsels_1.ssc:42
#: scripts/morsels_1.ssc:44 scripts/morsels_1.ssc:45 scripts/morsels_1.ssc:46
msgid "Shadows from Io, Europe and Callisto"
msgstr ""

#: scripts/morsels_1.ssc:24 scripts/morsels_1.ssc:32 scripts/morsels_1.ssc:40
msgid "Shadows from Europe, Ganymede and Callisto"
msgstr ""

#: scripts/morsels_1.ssc:60
msgid "Triple shadow phenomena of the satellites of Jupiter"
msgstr ""

#: scripts/morsels_1.ssc:62 scripts/morsels_2.ssc:78 scripts/morsels_3.ssc:52
#: scripts/morsels_4.ssc:70
msgid "phenomena in all"
msgstr ""

#: scripts/morsels_1.ssc:77 scripts/morsels_2.ssc:98 scripts/morsels_3.ssc:62
#: scripts/morsels_4.ssc:81
msgid "Event #"
msgstr ""

#: scripts/morsels_1.ssc:78 scripts/morsels_2.ssc:99 scripts/morsels_3.ssc:63
#: scripts/morsels_4.ssc:82
msgid "Date:"
msgstr ""

#: scripts/morsels_1.ssc:79
msgid "Time:"
msgstr ""

#: scripts/morsels_2.ssc:76
msgid "Jupiter without Galilean satellites"
msgstr ""

#: scripts/morsels_2.ssc:100
msgid "Limits of the disappearance:"
msgstr ""

#: scripts/morsels_3.ssc:50
msgid "Occultations of bright stars by planets"
msgstr ""

#: scripts/morsels_4.ssc:68
msgid "Mutual occultations of planets"
msgstr ""

#: scripts/supernova.ssc:22
msgid "Europe, Uraniborg."
msgstr ""
Expand Down
84 changes: 43 additions & 41 deletions scripts/morsels_1.ssc
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,48 @@
// Name: Jupiter and triple shadow phenomena
// Author: Alexander Wolf
// License: Public Domain
// Version: 1.0
// Version: 1.1
// Shortcut: Ctrl+D,M,1
// Description: Demonstration of the mid-time of rare events - triple shadow phenomena of the satellites of Jupiter from 1900 to 2100. All events are given in Dynamical Time.
//

// Made on Stellarium 0.18.2
// Made on Stellarium 0.18.2; Translatable with 0.19.0

// List of phenomena (date, time, satellites)
var phenomenalist = [["1901-12-30", "06:12", "Io, Ganymede"],
["1908-05-16", "11:02", "Io, Ganymede"],
["1909-07-25", "20:29", "Io, Europe"],
["1915-07-29", "10:23", "Io, Ganymede"],
["1919-03-14", "08:40", "Io, Europe"],
["1938-06-01", "14:06", "Io, Europe"],
["1949-02-23", "19:38", "Io, Europe"],
["1949-12-05", "17:37", "Io, Ganymede"],
["1956-04-21", "22:00", "Io, Ganymede"],
["1966-06-28", "07:16", "Europe, Ganymede"],
["1967-02-17", "19:39", "Io, Europe"],
["1974-05-01", "18:10", "Io, Europe"],
["1985-01-23", "23:03", "Io, Europe"],
["1997-01-30", "06:16", "Io, Europe"],
["1997-11-11", "04:42", "Io, Ganymede"],
["2004-03-28", "08:10", "Io, Ganymede"],
["2013-10-12", "05:05", "Io, Europe"],
["2014-06-03", "18:57", "Europe, Ganymede"],
["2015-01-24", "06:41", "Io, Europe"],
["2032-03-20", "12:00", "Io, Ganymede"],
["2032-12-30", "10:29", "Io, Europe"],
["2038-08-05", "17:46", "Io, Ganymede"],
["2045-01-05", "17:29", "Io, Europe"],
["2045-10-17", "15:57", "Io, Ganymede"],
["2061-09-17", "16:32", "Io, Europe"],
["2062-05-10", "05:53", "Europe, Ganymede"],
["2062-12-30", "17:42", "Io, Europe"],
["2073-09-23", "23:45", "Io, Europe"],
["2080-02-24", "23:14", "Io, Ganymede"],
["2080-12-05", "21:49", "Io, Europe"],
["2091-08-31", "02:29", "Io, Europe"],
["2092-12-12", "05:09", "Io, Europe"]
include("i18n.inc");

// List of phenomena (date, time, comment for satellites)
var phenomenalist = [["1901-12-30", "06:12", tr("Shadows from Io, Ganymede and Callisto")],
["1908-05-16", "11:02", tr("Shadows from Io, Ganymede and Callisto")],
["1909-07-25", "20:29", tr("Shadows from Io, Europe and Callisto")],
["1915-07-29", "10:23", tr("Shadows from Io, Ganymede and Callisto")],
["1919-03-14", "08:40", tr("Shadows from Io, Europe and Callisto")],
["1938-06-01", "14:06", tr("Shadows from Io, Europe and Callisto")],
["1949-02-23", "19:38", tr("Shadows from Io, Europe and Callisto")],
["1949-12-05", "17:37", tr("Shadows from Io, Ganymede and Callisto")],
["1956-04-21", "22:00", tr("Shadows from Io, Ganymede and Callisto")],
["1966-06-28", "07:16", tr("Shadows from Europe, Ganymede and Callisto")],
["1967-02-17", "19:39", tr("Shadows from Io, Europe and Callisto")],
["1974-05-01", "18:10", tr("Shadows from Io, Europe and Callisto")],
["1985-01-23", "23:03", tr("Shadows from Io, Europe and Callisto")],
["1997-01-30", "06:16", tr("Shadows from Io, Europe and Callisto")],
["1997-11-11", "04:42", tr("Shadows from Io, Ganymede and Callisto")],
["2004-03-28", "08:10", tr("Shadows from Io, Ganymede and Callisto")],
["2013-10-12", "05:05", tr("Shadows from Io, Europe and Callisto")],
["2014-06-03", "18:57", tr("Shadows from Europe, Ganymede and Callisto")],
["2015-01-24", "06:41", tr("Shadows from Io, Europe and Callisto")],
["2032-03-20", "12:00", tr("Shadows from Io, Ganymede and Callisto")],
["2032-12-30", "10:29", tr("Shadows from Io, Europe and Callisto")],
["2038-08-05", "17:46", tr("Shadows from Io, Ganymede and Callisto")],
["2045-01-05", "17:29", tr("Shadows from Io, Europe and Callisto")],
["2045-10-17", "15:57", tr("Shadows from Io, Ganymede and Callisto")],
["2061-09-17", "16:32", tr("Shadows from Io, Europe and Callisto")],
["2062-05-10", "05:53", tr("Shadows from Europe, Ganymede and Callisto")],
["2062-12-30", "17:42", tr("Shadows from Io, Europe and Callisto")],
["2073-09-23", "23:45", tr("Shadows from Io, Europe and Callisto")],
["2080-02-24", "23:14", tr("Shadows from Io, Ganymede and Callisto")],
["2080-12-05", "21:49", tr("Shadows from Io, Europe and Callisto")],
["2091-08-31", "02:29", tr("Shadows from Io, Europe and Callisto")],
["2092-12-12", "05:09", tr("Shadows from Io, Europe and Callisto")]
];

var timestep = 10;
Expand All @@ -55,9 +57,9 @@ GridLinesMgr.setFlagGridlines(false);
NebulaMgr.setFlagHints(false);
StelMovementMgr.setEquatorialMount(true);
core.setGuiVisible(false);
var id = LabelMgr.labelScreen("Triple shadow phenomena of the satellites of Jupiter", 20, 20, false, 36, color);
var id = LabelMgr.labelScreen(tr("Triple shadow phenomena of the satellites of Jupiter"), 20, 20, false, 36, color);
LabelMgr.setLabelShow(id, true);
var ph = LabelMgr.labelScreen(phenomenalist.length + " phenomena in all", 20, 65, false, 28, color);
var ph = LabelMgr.labelScreen(phenomenalist.length + " " + tr("phenomena in all"), 20, 65, false, 28, color);
LabelMgr.setLabelShow(ph, true);
core.wait(2);
core.selectObjectByName("Jupiter", false);
Expand All @@ -72,10 +74,10 @@ for (i=0; i<phenomenalist.length; i++)
var d = phenomenalist[i][0];
var t = phenomenalist[i][1];
var event = d + "T" + t + ":00";
var en = LabelMgr.labelScreen("Event #"+ (i+1), 20, 130, false, 20, color);
var ed = LabelMgr.labelScreen("Date: " + d, 20, 155, false, 20, color);
var et = LabelMgr.labelScreen("Time: " + t, 20, 180, false, 20, color);
var es = LabelMgr.labelScreen("Shadows from " + phenomenalist[i][2] + " and Callisto", 20, 205, false, 20, color);
var en = LabelMgr.labelScreen(tr("Event #")+ (i+1), 20, 130, false, 20, color);
var ed = LabelMgr.labelScreen(tr("Date:") + " " + d, 20, 155, false, 20, color);
var et = LabelMgr.labelScreen(tr("Time:") + " " + t, 20, 180, false, 20, color);
var es = LabelMgr.labelScreen(phenomenalist[i][2], 20, 205, false, 20, color);

core.setDate(event, "utc", true);
LabelMgr.setLabelShow(en, true);
Expand Down
16 changes: 9 additions & 7 deletions scripts/morsels_2.ssc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
// Name: Jupiter without Galilean satellites
// Author: Alexander Wolf
// License: Public Domain
// Version: 1.0
// Version: 1.1
// Shortcut: Ctrl+D,M,2
// Description: The planet Jupiter sometimes appears to be without moons, when the four Galilean satellites are simultaneously invisible because they are passing across the planet's disk (transit), are behind the planet (occultation), or are in its shadow (eclipse). This script demonstrates these rare phenomena from 1900 to 2100 in Dynamical Time.
//

// Made on Stellarium 0.18.2
// Made on Stellarium 0.18.2; Translatable with 0.19.0

include("i18n.inc");

// List of phenomena (date, begin time, end time, begin demo, end demo, time rate)
var phenomenalist = [["1907-10-03", "19:49", "19:59", "19:29", "20:19", 100],
Expand Down Expand Up @@ -71,9 +73,9 @@ NebulaMgr.setFlagHints(false);
SolarSystem.setFlagLabels(false);
StelMovementMgr.setEquatorialMount(true);
core.setGuiVisible(false);
var id = LabelMgr.labelScreen("Jupiter without Galilean satellites", 20, 20, false, 36, color);
var id = LabelMgr.labelScreen(tr("Jupiter without Galilean satellites"), 20, 20, false, 36, color);
LabelMgr.setLabelShow(id, true);
var ph = LabelMgr.labelScreen(phenomenalist.length + " phenomena in all", 20, 65, false, 28, color);
var ph = LabelMgr.labelScreen(phenomenalist.length + " " + tr("phenomena in all"), 20, 65, false, 28, color);
LabelMgr.setLabelShow(ph, true);
core.wait(2);
core.selectObjectByName("Jupiter", false);
Expand All @@ -93,9 +95,9 @@ for (i=0; i<phenomenalist.length; i++)
var r = phenomenalist[i][5];
var demoBegin = d + "T" + b + ":00";
var demoEnd = d + "T" + e + ":00";
var en = LabelMgr.labelScreen("Event #"+ (i+1), 20, 130, false, 20, color);
var ed = LabelMgr.labelScreen("Date: " + d, 20, 155, false, 20, color);
var el = LabelMgr.labelScreen("Limits of the disappearance: " + phenomenalist[i][1] + " - " + phenomenalist[i][2], 20, 180, false, 20, color);
var en = LabelMgr.labelScreen(tr("Event #") + (i+1), 20, 130, false, 20, color);
var ed = LabelMgr.labelScreen(tr("Date:") + " " + d, 20, 155, false, 20, color);
var el = LabelMgr.labelScreen(tr("Limits of the disappearance:") + " " + phenomenalist[i][1] + " - " + phenomenalist[i][2], 20, 180, false, 20, color);

core.setDate(demoBegin, "utc", true);
LabelMgr.setLabelShow(en, true);
Expand Down
14 changes: 8 additions & 6 deletions scripts/morsels_3.ssc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
// Name: Occultations of bright stars by planets
// Author: Alexander Wolf
// License: Public Domain
// Version: 1.0
// Version: 1.1
// Shortcut: Ctrl+D,M,3
// Description: This script demonstrates interesting phenomena - occultations bright stars by planets, 2000 to 2040.
//

// Made on Stellarium 0.18.2
// Made on Stellarium 0.18.2; Translatable with 0.19.0

include("i18n.inc");

// List of phenomena (date, begin time, end time, star, latitude, longitude)
var phenomenalist = [["2006-01-12", "06:00", "07:10", "55 Sgr", 5, 25],
Expand Down Expand Up @@ -45,9 +47,9 @@ GridLinesMgr.setFlagGridlines(false);
NebulaMgr.setFlagHints(false);
StelMovementMgr.setEquatorialMount(true);
core.setGuiVisible(false);
var id = LabelMgr.labelScreen("Occultations of bright stars by planets", 20, 20, false, 36, color);
var id = LabelMgr.labelScreen(tr("Occultations of bright stars by planets"), 20, 20, false, 36, color);
LabelMgr.setLabelShow(id, true);
var ph = LabelMgr.labelScreen(phenomenalist.length + " phenomena in all", 20, 65, false, 28, color);
var ph = LabelMgr.labelScreen(phenomenalist.length + " " + tr("phenomena in all"), 20, 65, false, 28, color);
LabelMgr.setLabelShow(ph, true);
core.wait(2);
StelSkyDrawer.setRelativeStarScale(0.5);
Expand All @@ -57,8 +59,8 @@ core.setDeltaTAlgorithm("EspenakMeeus");
for (i=0; i<phenomenalist.length; i++)
{
var d = phenomenalist[i][0];
var en = LabelMgr.labelScreen("Event #"+ (i+1), 20, 130, false, 20, color);
var ed = LabelMgr.labelScreen("Date: " + d, 20, 155, false, 20, color);
var en = LabelMgr.labelScreen(tr("Event #") + (i+1), 20, 130, false, 20, color);
var ed = LabelMgr.labelScreen(tr("Date:") + " " + d, 20, 155, false, 20, color);
LabelMgr.setLabelShow(en, true);
LabelMgr.setLabelShow(ed, true);

Expand Down
14 changes: 8 additions & 6 deletions scripts/morsels_4.ssc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
// Name: Mutual occultations of planets
// Author: Alexander Wolf
// License: Public Domain
// Version: 1.0
// Version: 1.1
// Shortcut: Ctrl+D,M,4
// Description: This script demonstrates interesting and very rare phenomena - mutual occultations of planets, 0 to 2500.
//

// Made on Stellarium 0.18.2
// Made on Stellarium 0.18.2; Translatable with 0.19.0

include("i18n.inc");

// List of phenomena (date, begin time, end time, occulted planet)
var phenomenalist = [["0021-05-22", "08:41", "07:31", "Jupiter"],
Expand Down Expand Up @@ -63,9 +65,9 @@ ConstellationMgr.setFlagLabels(false);
GridLinesMgr.setFlagGridlines(false);
NebulaMgr.setFlagHints(false);
core.setGuiVisible(false);
var id = LabelMgr.labelScreen("Mutual occultations of planets", 20, 20, false, 36, color);
var id = LabelMgr.labelScreen(tr("Mutual occultations of planets"), 20, 20, false, 36, color);
LabelMgr.setLabelShow(id, true);
var ph = LabelMgr.labelScreen(phenomenalist.length + " phenomena in all", 20, 65, false, 28, color);
var ph = LabelMgr.labelScreen(phenomenalist.length + " " tr("phenomena in all"), 20, 65, false, 28, color);
LabelMgr.setLabelShow(ph, true);
core.wait(2);
StelMovementMgr.setEquatorialMount(true);
Expand All @@ -76,8 +78,8 @@ core.setDeltaTAlgorithm("EspenakMeeus");
for (i=0; i<phenomenalist.length; i++)
{
var d = phenomenalist[i][0];
var en = LabelMgr.labelScreen("Event #"+ (i+1), 20, 130, false, 20, color);
var ed = LabelMgr.labelScreen("Date: " + d, 20, 155, false, 20, color);
var en = LabelMgr.labelScreen(tr("Event #") + (i+1), 20, 130, false, 20, color);
var ed = LabelMgr.labelScreen(tr("Date:") + " " + d, 20, 155, false, 20, color);
LabelMgr.setLabelShow(en, true);
LabelMgr.setLabelShow(ed, true);

Expand Down

0 comments on commit d4b6f27

Please sign in to comment.