diff --git a/activities/Planets.activity/js/activity.js b/activities/Planets.activity/js/activity.js index d3bddc75e..3ccf0def6 100644 --- a/activities/Planets.activity/js/activity.js +++ b/activities/Planets.activity/js/activity.js @@ -17,7 +17,7 @@ define(["sugar-web/activity/activity", "sugar-web/env", "sugar-web/datastore", " controls.target.set(0,0,0); //Planet Information - var infoType = ["Name", "Type", "Year", "Mass", "Temperature", "Moons", "Radius", "SunDistance"]; + var infoType = ["Name", "Type", "Year","Day","Gravity", "Mass", "Temperature", "Moons", "Radius", "SunDistance"]; var planet = planets; //Containers @@ -94,8 +94,8 @@ define(["sugar-web/activity/activity", "sugar-web/env", "sugar-web/datastore", " document.getElementById("planet-" + planet[i].name).appendChild(planetName); //Init planet info and planet position view - initPlanet(planet[i].name, planet[i].type, planet[i].year, planet[i].mass, planet[i].temperature, planet[i].moons, planet[i].radius, planet[i].distancefromsun); - initPosition(planet[i].name, planet[i].type, planet[i].year, planet[i].mass, planet[i].temperature, planet[i].moons, planet[i].radius, planet[i].distancefromsun); + initPlanet(planet[i].name, planet[i].type, planet[i].year, planet[i].mass, planet[i].temperature, planet[i].moons, planet[i].radius, planet[i].distancefromsun,planet[i].day,planet[i].gravity); + initPosition(planet[i].name, planet[i].type, planet[i].year, planet[i].mass, planet[i].temperature, planet[i].moons, planet[i].radius, planet[i].distancefromsun,planet[i].day,planet[i].gravity); // Switch to fullscreen mode on click document.getElementById("fullscreen-button").addEventListener('click', function() { @@ -182,7 +182,7 @@ define(["sugar-web/activity/activity", "sugar-web/env", "sugar-web/datastore", " //Show planet function - function initPlanet(name, type, year, mass, temperature, moons, radius, sunDistance){ + function initPlanet(name, type, year, mass, temperature, moons, radius, sunDistance,day,gravity){ //Url of planet files var toload = {}; @@ -327,7 +327,7 @@ define(["sugar-web/activity/activity", "sugar-web/env", "sugar-web/datastore", " camera.position.z = 5; - for (var i = 0; i < 8; i++){ + for (var i = 0; i < 10; i++){ var information = document.createElement('div'); information.id = infoType[i]; information.className = 'info'; @@ -337,6 +337,8 @@ define(["sugar-web/activity/activity", "sugar-web/env", "sugar-web/datastore", " document.getElementById("Name").innerHTML = '

' + l10n.get("PlanetName") + '

' + l10n.get(name) + '

'; document.getElementById("Type").innerHTML = '

' + l10n.get("PlanetType") + '

' + l10n.get(type.replace(/\s+/g, '')) + '

'; document.getElementById("Year").innerHTML = '

' + l10n.get("YearLength") + '

' + l10n.get("EarthDays", {year:year}) + '

'; + document.getElementById("Day").innerHTML = '

' + l10n.get("DayLength") + '

' + l10n.get("EarthHours", {day:day}) + '

'; + document.getElementById("Gravity").innerHTML = '

' + l10n.get("Gravity") + '

' + gravity + '

'; document.getElementById("Mass").innerHTML = '

' + l10n.get("Mass") + '

' + mass + '

'; document.getElementById("Temperature").innerHTML = '

' + l10n.get("SurfaceTemperature") + '

' + temperature + '

'; document.getElementById("Moons").innerHTML = '

' + l10n.get("NumberOfMoons") + '

' + moons + '

'; @@ -506,7 +508,7 @@ define(["sugar-web/activity/activity", "sugar-web/env", "sugar-web/datastore", " } - function initPosition(name, type, year, mass, temperature, moons, radius, sunDistance){ + function initPosition(name, type, year, mass, temperature, moons, radius, sunDistance,day,gravity){ //Url of planet map files var toload = {}; @@ -672,6 +674,8 @@ define(["sugar-web/activity/activity", "sugar-web/env", "sugar-web/datastore", " planetMesh.userData.moons = moons; planetMesh.userData.radius = radius; planetMesh.userData.sunDistance = sunDistance; + planetMesh.userData.day=day; + planetMesh.userData.gravity=gravity; //Show planet position and distance from Sun document.getElementById("position-button").addEventListener("click", function(e){ @@ -809,7 +813,7 @@ define(["sugar-web/activity/activity", "sugar-web/env", "sugar-web/datastore", " //There was a bug where the planets rotate faster and faster on each click //By setting requestAnim to false, initPlanet will stop initializaing, as it causes the bug if (requestAnim){ - initPlanet(name, type, year, mass, temperature, moons, radius, sunDistance); + initPlanet(name, type, year, mass, temperature, moons, radius, sunDistance,day,gravity); } requestAnim = false; diff --git a/activities/Planets.activity/js/info.json b/activities/Planets.activity/js/info.json index 4f47734d0..c29289243 100644 --- a/activities/Planets.activity/js/info.json +++ b/activities/Planets.activity/js/info.json @@ -7,7 +7,9 @@ var planets = [ "year": "88", "temperature": "-173 to 427°C", "radius": "2,439.7 km", - "distancefromsun": "58,000,000 km" + "distancefromsun": "58,000,000 km", + "day":"1408", + "gravity":"3.7 m/s²", }, { "name": "Venus", @@ -17,7 +19,9 @@ var planets = [ "year": "225", "temperature": "462°C", "radius": "6,051.8 km", - "distancefromsun": "108,000,000 km" + "distancefromsun": "108,000,000 km", + "day": "5832", + "gravity":"8.8 m/s²", }, { "name": "Earth", @@ -27,7 +31,9 @@ var planets = [ "year": "365", "temperature": "-88 to 58°C", "radius": "6,371.00 km", - "distancefromsun": "150,000,000 km" + "distancefromsun": "150,000,000 km", + "day":"24", + "gravity":"9.8 m/s²", }, { "name": "Mars", @@ -37,7 +43,9 @@ var planets = [ "year": "687", "temperature": "-153 to 20°C", "radius": "3,389.5 km", - "distancefromsun": "228,000,000 km" + "distancefromsun": "228,000,000 km", + "day":"25", + "gravity":"3.7 m/s²", }, { "name": "Jupiter", @@ -47,7 +55,9 @@ var planets = [ "year": "4,333", "temperature": "No Data", "radius": "69,911 km", - "distancefromsun": "778,000,000 km" + "distancefromsun": "778,000,000 km", + "day":"10", + "gravity":"24.8 m/s²", }, { "name": "Saturn", @@ -57,7 +67,9 @@ var planets = [ "year": "10,759", "temperature": "No Data", "radius": "58,232 km", - "distancefromsun": "1,400,000,000 km" + "distancefromsun": "1,400,000,000 km", + "day":"11", + "gravity":"10.4 m/s²", }, { "name": "Uranus", @@ -67,7 +79,9 @@ var planets = [ "year": "30,687", "temperature": "No Data", "radius": "25,362 km", - "distancefromsun": "2,900,000,000 km" + "distancefromsun": "2,900,000,000 km", + "day":"17", + "gravity":"8.9 m/s²", }, { "name": "Neptune", @@ -77,6 +91,8 @@ var planets = [ "year": "60,190", "temperature": "No Data", "radius": "24,622 km", - "distancefromsun": "4,500,000,000 km" + "distancefromsun": "4,500,000,000 km", + "day":"16", + "gravity":"11.1 m/s²", }, ] diff --git a/activities/Planets.activity/locale.ini b/activities/Planets.activity/locale.ini index 5fd0b250a..2ac44a596 100644 --- a/activities/Planets.activity/locale.ini +++ b/activities/Planets.activity/locale.ini @@ -13,7 +13,10 @@ Terrestrial=Terrestrial IceGiant=Ice Giant GasGiant=Gas Giant YearLength=Year Length: +DayLength=Day Length: EarthDays={{year}} Earth days +EarthHours={{day}} Earth Hours +Gravity=Surface Gravity: Mass=Mass: SurfaceTemperature=Surface Temperature: NumberOfMoons=Number of Moons: @@ -63,6 +66,8 @@ IceGiant=Ice Giant GasGiant=Gas Giant YearLength=Year Length: EarthDays={{year}} Earth days +EarthHours={{day}} Earth Hours +Gravtiy=Surface Gravity: Mass=Mass: SurfaceTemperature=Surface Temperature: NumberOfMoons=Number of Moons: @@ -110,8 +115,10 @@ PlanetType=Type de planète: Terrestrial=Terrestre IceGiant=Géante de glace GasGiant=Géante gazeuse -YearLength=Durée de l'année: -EarthDays={{year}} Jours Terrestre +YearLength=Durée de lannée: +EarthDays={{year}} Jours Terrestre: +EarthHours={{day}} heures terrestres: +Gravtiy=Gravité de surface: Mass=Masse: SurfaceTemperature=Température de surface: NumberOfMoons=Nombre de lunes: diff --git a/activities/Planets.activity/po/en.po b/activities/Planets.activity/po/en.po index d15f224da..4b39fc352 100644 --- a/activities/Planets.activity/po/en.po +++ b/activities/Planets.activity/po/en.po @@ -74,6 +74,17 @@ msgctxt "EarthDays" msgid "{{year}} Earth days" msgstr "{{year}} Earth days" +#. Do not translate {{days}} +#: EarthHours +msgctxt "EarthHours" +msgid "{{day}} Earth Hours" +msgstr "{{day}} Earth Hours" + +#: Gravtiy +msgctxt "Gravtiy" +msgid "Surface Gravtiy:" +msgstr "Surface Gravity:" + #: Mass msgctxt "Mass" msgid "Mass:" diff --git a/activities/Planets.activity/po/fr.po b/activities/Planets.activity/po/fr.po index 75b50647f..cba25d0b3 100644 --- a/activities/Planets.activity/po/fr.po +++ b/activities/Planets.activity/po/fr.po @@ -74,6 +74,17 @@ msgctxt "EarthDays" msgid "{{year}} Earth days" msgstr "{{year}} Jours Terrestre" +#. Do not translate {{days}} +#: EarthHours +msgctxt "EarthHours" +msgid "{{day}} Earth Hours" +msgstr "{{day}} Heures terrestres" + +#: Gravtiy +msgctxt "Gravtiy" +msgid "Surface Gravtiy:" +msgstr "Gravité de surface:" + #: Mass msgctxt "Mass" msgid "Mass:" diff --git a/activities/Planets.activity/po/template.pot b/activities/Planets.activity/po/template.pot index 0c47b1e22..959df5cb8 100644 --- a/activities/Planets.activity/po/template.pot +++ b/activities/Planets.activity/po/template.pot @@ -74,6 +74,17 @@ msgctxt "EarthDays" msgid "{{year}} Earth days" msgstr "{{year}} Earth days" +#. Do not translate {{days}} +#: EarthHours +msgctxt "EarthHours" +msgid "{{day}} Earth Hours" +msgstr "{{day}} Earth Hours" + +#: Gravtiy +msgctxt "Gravtiy" +msgid "Surface Gravtiy:" +msgstr "Surface Gravity:" + #: Mass msgctxt "Mass" msgid "Mass:"