Skip to content

Commit

Permalink
Let's make more scripts by translatable...
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Jan 19, 2019
1 parent c47e0ec commit f12e22f
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 20 deletions.
1 change: 1 addition & 0 deletions po/stellarium-scripts/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ scripts/best_ngc.ssc
scripts/binocular_highlights.ssc
scripts/binosky.ssc
scripts/double_stars.ssc
scripts/supernova.ssc
66 changes: 61 additions & 5 deletions 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 00:31+0700\n"
"POT-Creation-Date: 2019-01-20 01:10+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 @@ -61,6 +61,10 @@ msgstr ""
msgid "M34: A True Binocular Cluster"
msgstr ""

#: scripts/binocular_highlights.ssc:17
msgid "Watching the Demon Star"
msgstr ""

#: scripts/binocular_highlights.ssc:18
msgid "The Pleiades"
msgstr ""
Expand Down Expand Up @@ -455,10 +459,6 @@ msgstr ""
msgid "Look through the Meade 10x50 TravelView Binocular"
msgstr ""

#: scripts/binocular_highlights.ssc:17
msgid "Watching the Demon Star"
msgstr ""

#: scripts/binosky.ssc:19
msgid "Binosky: Deep Sky Objects for Binoculars"
msgstr ""
Expand Down Expand Up @@ -679,3 +679,59 @@ msgstr ""
#: scripts/double_stars.ssc:78
msgid "Separation:"
msgstr ""

#: scripts/supernova.ssc:22
msgid "Europe, Uraniborg."
msgstr ""

#: scripts/supernova.ssc:30
msgid "Evening of 20 October 1572"
msgstr ""

#: scripts/supernova.ssc:39
msgid "Constellation Cassiopeia"
msgstr ""

#: scripts/supernova.ssc:60
msgid "5 days later..."
msgstr ""

#: scripts/supernova.ssc:66
msgid "Next 3 days..."
msgstr ""

#: scripts/supernova.ssc:72
msgid "New star! But people have not seen it yet..."
msgstr ""

#: scripts/supernova.ssc:77
msgid "Evening of 31 October 1572"
msgstr ""

#: scripts/supernova.ssc:85
msgid "Evening of "
msgstr ""

#: scripts/supernova.ssc:85
msgid " November 1572"
msgstr ""

#: scripts/supernova.ssc:92
msgid "Hooray! First observations in Korea and Europe."
msgstr ""

#: scripts/supernova.ssc:100
msgid "First observations in China."
msgstr ""

#: scripts/supernova.ssc:108
msgid "The clouds are gone and Tycho Brahe the first time watching a new star!"
msgstr ""

#: scripts/supernova.ssc:117
msgid "Next 60 days..."
msgstr ""

#: scripts/supernova.ssc:128
msgid "Next other 40 days..."
msgstr ""
2 changes: 1 addition & 1 deletion scripts/binocular_highlights.ssc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var highlights = [["", "", tr("Chapter 1"), tr("December to February")],
["02h20m15.73s", "+57d05m55.0s", tr("The Glorious Double Cluster"), ""],
["03h31m53.99s", "+48d44m06.0s", tr("The Alpha Persei Association"), ""],
["02h42m00.00s", "+42d47m00.0s", tr("M34: A True Binocular Cluster"), ""],
["03h08m10.14s", "+40d57m20.3s", tr("Watching the Demon Star", ""],
["03h08m10.14s", "+40d57m20.3s", tr("Watching the Demon Star"), ""],
["03h46m13.77s", "+24d11m47.7s", tr("The Pleiades"), ""],
["04h26m53.24s", "+15d47m41.6s", tr("Corralling the Hyades"), ""],
["04h46m00.01s", "+19d04m00.0s", tr("NGC 1647: The Crab Cluster"), ""],
Expand Down
11 changes: 11 additions & 0 deletions scripts/i18n.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// Name: Provide translation option for scripts
// License: Public Domain
// Author: Alexander Wolf
// Description: Simple translation functions for scripts.

// call this function with some string ID
function tr(str)
{
return core.translate(str);
}
30 changes: 16 additions & 14 deletions scripts/supernova.ssc
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
//
// Author: Alexander Wolf
// Version: 1.1
// Version: 1.2
// License: Public Domain
// Name: Tycho's Supernova
// Description: Flash of the supernova observed by Tycho Brahe in 1572. The Supernovae plugin has to be enabled.
//

include("i18n.inc");

var color = "#9999FF";
var JD = core.getJDay();

Expand All @@ -17,15 +19,15 @@ core.clear("natural");
LabelMgr.deleteAllLabels();
SolarSystem.setFlagLabels(false);

var label = LabelMgr.labelScreen("Europe, Uraniborg.", 20, 20, false, 20, color);
var label = LabelMgr.labelScreen(tr("Europe, Uraniborg."), 20, 20, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.setObserverLocation("Uraniborg, Denmark", 2);
core.wait(4);

LabelMgr.setLabelShow(label, false);
core.wait(1);

label = LabelMgr.labelScreen("Evening of 20 October 1572", 20, 20, false, 20, color);
label = LabelMgr.labelScreen(tr("Evening of 20 October 1572"), 20, 20, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.setDate("1572-10-20T17:00:00", "utc");
core.wait(3);
Expand All @@ -34,7 +36,7 @@ StelMovementMgr.zoomTo(200, 4);
core.wait(5);

LabelMgr.deleteAllLabels();
label = LabelMgr.labelScreen("Constellation Cassiopeia", 20, 20, false, 20, color);
label = LabelMgr.labelScreen(tr("Constellation Cassiopeia"), 20, 20, false, 20, color);
LabelMgr.setLabelShow(label, true);

ConstellationMgr.setFlagIsolateSelected(true);
Expand All @@ -55,55 +57,55 @@ ConstellationMgr.setFlagLines(false);
core.wait(.1);

LabelMgr.deleteAllLabels();
label = LabelMgr.labelScreen("5 days later...", 20, 20, false, 20, color);
label = LabelMgr.labelScreen(tr("5 days later..."), 20, 20, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.setDate("+5 days");
core.wait(2);

LabelMgr.deleteAllLabels();
label = LabelMgr.labelScreen("Next 3 days...", 20, 20, false, 20, color);
label = LabelMgr.labelScreen(tr("Next 3 days..."), 20, 20, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.setDate("+3 days");
core.wait(2);

LabelMgr.deleteAllLabels();
label = LabelMgr.labelScreen("New star! But people have not seen it yet...", 20, 20, false, 20, color);
label = LabelMgr.labelScreen(tr("New star! But people have not seen it yet..."), 20, 20, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.wait(2);

LabelMgr.deleteAllLabels();
label = LabelMgr.labelScreen("Evening of 31 October 1572", 20, 20, false, 20, color);
label = LabelMgr.labelScreen(tr("Evening of 31 October 1572"), 20, 20, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.setDate("1572-10-31T17:00:00", "utc");
core.wait(2);

for (i=1; i<12; i++)
{
LabelMgr.deleteAllLabels();
label = LabelMgr.labelScreen("Evening of " + i + " November 1572", 20, 20, false, 20, color);
label = LabelMgr.labelScreen(tr("Evening of ") + i + tr(" November 1572"), 20, 20, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.setDate("+1 day");

if (i==6)
{
core.wait(.5);
label = LabelMgr.labelScreen("Hooray! First observations in Korea and Europe.", 20, 50, false, 20, color);
label = LabelMgr.labelScreen(tr("Hooray! First observations in Korea and Europe."), 20, 50, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.wait(.5);
}

if (i==8)
{
core.wait(.5);
label = LabelMgr.labelScreen("First observations in China.", 20, 50, false, 20, color);
label = LabelMgr.labelScreen(tr("First observations in China."), 20, 50, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.wait(.5);
}

if (i==11)
{
core.wait(.5);
label = LabelMgr.labelScreen("The clouds are gone and Tycho Brahe the first time watching a new star!", 20, 50, false, 20, color);
label = LabelMgr.labelScreen(tr("The clouds are gone and Tycho Brahe the first time watching a new star!"), 20, 50, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.wait(1);
}
Expand All @@ -112,7 +114,7 @@ for (i=1; i<12; i++)
}

LabelMgr.deleteAllLabels();
label = LabelMgr.labelScreen("Next 60 days...", 20, 20, false, 20, color);
label = LabelMgr.labelScreen(tr("Next 60 days..."), 20, 20, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.wait(.1);

Expand All @@ -123,7 +125,7 @@ for(i=0; i<60; i++)
}

LabelMgr.deleteAllLabels();
label = LabelMgr.labelScreen("Next other 40 days...", 20, 20, false, 20, color);
label = LabelMgr.labelScreen(tr("Next other 40 days..."), 20, 20, false, 20, color);
LabelMgr.setLabelShow(label, true);
core.wait(.1);

Expand Down

0 comments on commit f12e22f

Please sign in to comment.