Skip to content

Commit f12e22f

Browse files
committed
Let's make more scripts by translatable...
1 parent c47e0ec commit f12e22f

File tree

5 files changed

+90
-20
lines changed

5 files changed

+90
-20
lines changed

po/stellarium-scripts/POTFILES.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ scripts/best_ngc.ssc
44
scripts/binocular_highlights.ssc
55
scripts/binosky.ssc
66
scripts/double_stars.ssc
7+
scripts/supernova.ssc

po/stellarium-scripts/stellarium-scripts.pot

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: [email protected]\n"
11-
"POT-Creation-Date: 2019-01-20 00:31+0700\n"
11+
"POT-Creation-Date: 2019-01-20 01:10+0700\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -61,6 +61,10 @@ msgstr ""
6161
msgid "M34: A True Binocular Cluster"
6262
msgstr ""
6363

64+
#: scripts/binocular_highlights.ssc:17
65+
msgid "Watching the Demon Star"
66+
msgstr ""
67+
6468
#: scripts/binocular_highlights.ssc:18
6569
msgid "The Pleiades"
6670
msgstr ""
@@ -455,10 +459,6 @@ msgstr ""
455459
msgid "Look through the Meade 10x50 TravelView Binocular"
456460
msgstr ""
457461

458-
#: scripts/binocular_highlights.ssc:17
459-
msgid "Watching the Demon Star"
460-
msgstr ""
461-
462462
#: scripts/binosky.ssc:19
463463
msgid "Binosky: Deep Sky Objects for Binoculars"
464464
msgstr ""
@@ -679,3 +679,59 @@ msgstr ""
679679
#: scripts/double_stars.ssc:78
680680
msgid "Separation:"
681681
msgstr ""
682+
683+
#: scripts/supernova.ssc:22
684+
msgid "Europe, Uraniborg."
685+
msgstr ""
686+
687+
#: scripts/supernova.ssc:30
688+
msgid "Evening of 20 October 1572"
689+
msgstr ""
690+
691+
#: scripts/supernova.ssc:39
692+
msgid "Constellation Cassiopeia"
693+
msgstr ""
694+
695+
#: scripts/supernova.ssc:60
696+
msgid "5 days later..."
697+
msgstr ""
698+
699+
#: scripts/supernova.ssc:66
700+
msgid "Next 3 days..."
701+
msgstr ""
702+
703+
#: scripts/supernova.ssc:72
704+
msgid "New star! But people have not seen it yet..."
705+
msgstr ""
706+
707+
#: scripts/supernova.ssc:77
708+
msgid "Evening of 31 October 1572"
709+
msgstr ""
710+
711+
#: scripts/supernova.ssc:85
712+
msgid "Evening of "
713+
msgstr ""
714+
715+
#: scripts/supernova.ssc:85
716+
msgid " November 1572"
717+
msgstr ""
718+
719+
#: scripts/supernova.ssc:92
720+
msgid "Hooray! First observations in Korea and Europe."
721+
msgstr ""
722+
723+
#: scripts/supernova.ssc:100
724+
msgid "First observations in China."
725+
msgstr ""
726+
727+
#: scripts/supernova.ssc:108
728+
msgid "The clouds are gone and Tycho Brahe the first time watching a new star!"
729+
msgstr ""
730+
731+
#: scripts/supernova.ssc:117
732+
msgid "Next 60 days..."
733+
msgstr ""
734+
735+
#: scripts/supernova.ssc:128
736+
msgid "Next other 40 days..."
737+
msgstr ""

scripts/binocular_highlights.ssc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var highlights = [["", "", tr("Chapter 1"), tr("December to February")],
1414
["02h20m15.73s", "+57d05m55.0s", tr("The Glorious Double Cluster"), ""],
1515
["03h31m53.99s", "+48d44m06.0s", tr("The Alpha Persei Association"), ""],
1616
["02h42m00.00s", "+42d47m00.0s", tr("M34: A True Binocular Cluster"), ""],
17-
["03h08m10.14s", "+40d57m20.3s", tr("Watching the Demon Star", ""],
17+
["03h08m10.14s", "+40d57m20.3s", tr("Watching the Demon Star"), ""],
1818
["03h46m13.77s", "+24d11m47.7s", tr("The Pleiades"), ""],
1919
["04h26m53.24s", "+15d47m41.6s", tr("Corralling the Hyades"), ""],
2020
["04h46m00.01s", "+19d04m00.0s", tr("NGC 1647: The Crab Cluster"), ""],

scripts/i18n.inc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//
2+
// Name: Provide translation option for scripts
3+
// License: Public Domain
4+
// Author: Alexander Wolf
5+
// Description: Simple translation functions for scripts.
6+
7+
// call this function with some string ID
8+
function tr(str)
9+
{
10+
return core.translate(str);
11+
}

scripts/supernova.ssc

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
//
22
// Author: Alexander Wolf
3-
// Version: 1.1
3+
// Version: 1.2
44
// License: Public Domain
55
// Name: Tycho's Supernova
66
// Description: Flash of the supernova observed by Tycho Brahe in 1572. The Supernovae plugin has to be enabled.
77
//
88

9+
include("i18n.inc");
10+
911
var color = "#9999FF";
1012
var JD = core.getJDay();
1113

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

20-
var label = LabelMgr.labelScreen("Europe, Uraniborg.", 20, 20, false, 20, color);
22+
var label = LabelMgr.labelScreen(tr("Europe, Uraniborg."), 20, 20, false, 20, color);
2123
LabelMgr.setLabelShow(label, true);
2224
core.setObserverLocation("Uraniborg, Denmark", 2);
2325
core.wait(4);
2426

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

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

3638
LabelMgr.deleteAllLabels();
37-
label = LabelMgr.labelScreen("Constellation Cassiopeia", 20, 20, false, 20, color);
39+
label = LabelMgr.labelScreen(tr("Constellation Cassiopeia"), 20, 20, false, 20, color);
3840
LabelMgr.setLabelShow(label, true);
3941

4042
ConstellationMgr.setFlagIsolateSelected(true);
@@ -55,55 +57,55 @@ ConstellationMgr.setFlagLines(false);
5557
core.wait(.1);
5658

5759
LabelMgr.deleteAllLabels();
58-
label = LabelMgr.labelScreen("5 days later...", 20, 20, false, 20, color);
60+
label = LabelMgr.labelScreen(tr("5 days later..."), 20, 20, false, 20, color);
5961
LabelMgr.setLabelShow(label, true);
6062
core.setDate("+5 days");
6163
core.wait(2);
6264

6365
LabelMgr.deleteAllLabels();
64-
label = LabelMgr.labelScreen("Next 3 days...", 20, 20, false, 20, color);
66+
label = LabelMgr.labelScreen(tr("Next 3 days..."), 20, 20, false, 20, color);
6567
LabelMgr.setLabelShow(label, true);
6668
core.setDate("+3 days");
6769
core.wait(2);
6870

6971
LabelMgr.deleteAllLabels();
70-
label = LabelMgr.labelScreen("New star! But people have not seen it yet...", 20, 20, false, 20, color);
72+
label = LabelMgr.labelScreen(tr("New star! But people have not seen it yet..."), 20, 20, false, 20, color);
7173
LabelMgr.setLabelShow(label, true);
7274
core.wait(2);
7375

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

8082
for (i=1; i<12; i++)
8183
{
8284
LabelMgr.deleteAllLabels();
83-
label = LabelMgr.labelScreen("Evening of " + i + " November 1572", 20, 20, false, 20, color);
85+
label = LabelMgr.labelScreen(tr("Evening of ") + i + tr(" November 1572"), 20, 20, false, 20, color);
8486
LabelMgr.setLabelShow(label, true);
8587
core.setDate("+1 day");
8688

8789
if (i==6)
8890
{
8991
core.wait(.5);
90-
label = LabelMgr.labelScreen("Hooray! First observations in Korea and Europe.", 20, 50, false, 20, color);
92+
label = LabelMgr.labelScreen(tr("Hooray! First observations in Korea and Europe."), 20, 50, false, 20, color);
9193
LabelMgr.setLabelShow(label, true);
9294
core.wait(.5);
9395
}
9496

9597
if (i==8)
9698
{
9799
core.wait(.5);
98-
label = LabelMgr.labelScreen("First observations in China.", 20, 50, false, 20, color);
100+
label = LabelMgr.labelScreen(tr("First observations in China."), 20, 50, false, 20, color);
99101
LabelMgr.setLabelShow(label, true);
100102
core.wait(.5);
101103
}
102104

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

114116
LabelMgr.deleteAllLabels();
115-
label = LabelMgr.labelScreen("Next 60 days...", 20, 20, false, 20, color);
117+
label = LabelMgr.labelScreen(tr("Next 60 days..."), 20, 20, false, 20, color);
116118
LabelMgr.setLabelShow(label, true);
117119
core.wait(.1);
118120

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

125127
LabelMgr.deleteAllLabels();
126-
label = LabelMgr.labelScreen("Next other 40 days...", 20, 20, false, 20, color);
128+
label = LabelMgr.labelScreen(tr("Next other 40 days..."), 20, 20, false, 20, color);
127129
LabelMgr.setLabelShow(label, true);
128130
core.wait(.1);
129131

0 commit comments

Comments
 (0)