Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e5b193ef63e9
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 36cc0754d119
Choose a head ref

Commits on Aug 13, 2021

  1. celestial strings

    eggrobin committed Aug 13, 2021
    Copy the full SHA
    970ec22 View commit details
  2. rename

    eggrobin committed Aug 13, 2021
    Copy the full SHA
    e5be686 View commit details
  3. Copy the full SHA
    b9ad335 View commit details
  4. make it work

    eggrobin committed Aug 13, 2021
    Copy the full SHA
    919a0b9 View commit details
  5. map apsides and orbits

    eggrobin committed Aug 13, 2021
    Copy the full SHA
    cb37049 View commit details
  6. arguments

    eggrobin committed Aug 13, 2021
    Copy the full SHA
    ab7b399 View commit details
  7. some more frames

    eggrobin committed Aug 13, 2021
    Copy the full SHA
    4e8424d View commit details
  8. add the celestial strings

    eggrobin committed Aug 13, 2021
    Copy the full SHA
    4a33fbd View commit details
  9. comment wording

    eggrobin committed Aug 13, 2021
    Copy the full SHA
    d20e3d4 View commit details
  10. typo

    eggrobin committed Aug 13, 2021
    Copy the full SHA
    022c1b1 View commit details
  11. typo in key

    eggrobin committed Aug 13, 2021
    Copy the full SHA
    2ea9782 View commit details

Commits on Aug 14, 2021

  1. missing #

    eggrobin committed Aug 14, 2021
    Copy the full SHA
    c4a8d68 View commit details
  2. words

    eggrobin committed Aug 14, 2021
    Copy the full SHA
    5380d47 View commit details
  3. citation

    eggrobin committed Aug 14, 2021
    Copy the full SHA
    d312361 View commit details
  4. format

    eggrobin committed Aug 14, 2021
    Copy the full SHA
    7887417 View commit details
  5. after Al2Me6’s review

    eggrobin committed Aug 14, 2021
    Copy the full SHA
    b898c9a View commit details
  6. regenerate

    eggrobin committed Aug 14, 2021
    Copy the full SHA
    1544c06 View commit details
  7. mention the ecliptic

    eggrobin committed Aug 14, 2021
    Copy the full SHA
    83a342a View commit details
  8. in Chinese too

    eggrobin committed Aug 14, 2021
    Copy the full SHA
    5fe65a0 View commit details

Commits on Aug 15, 2021

  1. After pleroy’s review

    eggrobin committed Aug 15, 2021
    Copy the full SHA
    f053a89 View commit details
  2. Merge pull request #3093 from eggrobin/overrides

    Use celestial-specific terminology
    eggrobin authored Aug 15, 2021
    Copy the full SHA
    36cc075 View commit details
13 changes: 13 additions & 0 deletions documentation/bibliography.bib
Original file line number Diff line number Diff line change
@@ -1726,6 +1726,19 @@ @inproceedings{JonesAnderson2012
venue = {Charleston, South Carolina},
}

@inproceedings{KowalkowskiJohannesenLam2008,
author = {Kowalkowski, Theresa and Johannesen, Jennie and Lam, Try},
publisher = {American Institute of Aeronautics and Astronautics},
date = {2008-08-21T14:00:00},
doi = {10.2514/6.2008-7369},
eventdate = {2008-08-18/2008-08-21},
eventtitle = {AIAA/AAS Astrodynamics Specialist Conference and Exhibit},
note = {AIAA 2008-7369},
series = {Guidance, Navigation, and Control and Co-located Conferences},
title = {Launch Period Development for the Juno Mission to Jupiter},
venue = {Honolulu, Hawaii},
}

@inproceedings{KrishnamoorthyMenon2013,
author = {Krishnamoorthy, A. and Menon, D.},
publisher = {IEEE},
Binary file modified documentation/bibliography.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions ksp_plugin_adapter/ksp_plugin_adapter.csproj
Original file line number Diff line number Diff line change
@@ -184,6 +184,9 @@
<None Include="localization\en-us.cfg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="localization\celestial_strings.cfg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="localization\zh-cn.cfg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
83 changes: 83 additions & 0 deletions ksp_plugin_adapter/localization/celestial_strings.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Localization {
en-us {
// We use specific terminology only if it is more common than the equivalent
// generic terminology.
// Thus, while geocentric inertial and GCI are well-attested, we do not use
// them because Earth-Centred Inertial and ECI are more common.
#Principia_MapNode_Periapsis(Sun).en-us = Perihelion
#Principia_MapNode_Periapsis(Earth).en-us = Perigee
#Principia_MapNode_Periapsis(Jupiter).en-us = Perijove
#Principia_MapNode_Apoapsis(Sun).en-us = Aphelion
#Principia_MapNode_Apoapsis(Earth).en-us = Apogee
#Principia_MapNode_Apoapsis(Jupiter).en-us = Apojove
#Principia_OrbitAnalyser_Elements_Periapsis(Sun).en-us = perihelion
#Principia_OrbitAnalyser_Elements_Apoapsis(Sun).en-us = aphelion
#Principia_OrbitAnalyser_Elements_Periapsis(Earth).en-us = perigee
#Principia_OrbitAnalyser_Elements_Apoapsis(Earth).en-us = apogee
// While it is attested, the phrase “argument of perijove” is much rarer
// than “argument of periapsis”, even when the apsis in question is referred
// to as a perijove, see, e.g., the sentence
// “However, the argument of periapsis increases approximately 0.9° per
// orbit, sending the latitude of perijove further from the equator.”
// in [KJL08]. We follow this usage.
#Principia_OrbitAnalyser_OrbitDescription_Primary(Sun).en-us = heliocentric
#Principia_OrbitAnalyser_OrbitDescription_Primary(Moon).en-us = lunar
#Principia_OrbitAnalyser_OrbitDescription_SynchronousPrimary(Earth).en-us = geosynchronous
#Principia_OrbitAnalyser_OrbitDescription_StationaryPrimary(Earth).en-us = geostationary
#Principia_ReferenceFrameSelector_Name_BodyCentredNonRotating(Sun).en-us = Heliocentric Inertial
#Principia_ReferenceFrameSelector_Abbreviation_BodyCentredNonRotating(Sun).en-us = HCI
#Principia_ReferenceFrameSelector_Name_BodyCentredParentDirection(Earth,Sun).en-us = Geocentric Solar Ecliptic
#Principia_ReferenceFrameSelector_Abbreviation_BodyCentredParentDirection(Earth,Sun).en-us = GSE
#Principia_ReferenceFrameSelector_Description_BodyCentredParentDirection(Earth,Sun).en-us = The centre of <<1>> is fixed.\nThe ecliptic (the plane of its orbit around <<2>>) is horizontal.\nThe reference frame rotates with the orbit, fixing the direction of <<2>>.
// Note that JSE is attested for Jupiter, but the more generic JSO is more
// modern (the former is common in the context of Galileo, the latter in the
// context of Juno).
}
zh-cn {
// The names of the apsides for the naked-eye bodies are all attested in
// CNKI; wherever Chinese spacecraft have been sent, the specific word is
// far more common than the generic 近拱点 in that context.
#Principia_MapNode_Periapsis(Sun).zh-cn = 近日点
#Principia_MapNode_Periapsis(Mercury).zh-cn = 近水点
#Principia_MapNode_Periapsis(Venus).zh-cn = 近金点
#Principia_MapNode_Periapsis(Earth).zh-cn = 近地点
#Principia_MapNode_Periapsis(Moon).zh-cn = 近月点
#Principia_MapNode_Periapsis(Mars).zh-cn = 近火点
#Principia_MapNode_Periapsis(Jupiter).zh-cn = 近木点
#Principia_MapNode_Periapsis(Saturn).zh-cn = 近土点
#Principia_MapNode_Apoapsis(Sun).zh-cn = 远日点
#Principia_MapNode_Apoapsis(Mercury).zh-cn = 远水点
#Principia_MapNode_Apoapsis(Venus).zh-cn = 远金点
#Principia_MapNode_Apoapsis(Earth).zh-cn = 远地点
#Principia_MapNode_Apoapsis(Moon).zh-cn = 远月点
#Principia_MapNode_Apoapsis(Mars).zh-cn = 远火点
#Principia_MapNode_Apoapsis(Jupiter).zh-cn = 远木点
#Principia_MapNode_Apoapsis(Saturn).zh-cn = 远土点
#Principia_OrbitAnalyser_Elements_Periapsis(Sun).zh-cn = 近日点
#Principia_OrbitAnalyser_Elements_Periapsis(Mercury).zh-cn = 近水点
#Principia_OrbitAnalyser_Elements_Periapsis(Venus).zh-cn = 近金点
#Principia_OrbitAnalyser_Elements_Periapsis(Earth).zh-cn = 近地点
#Principia_OrbitAnalyser_Elements_Periapsis(Moon).zh-cn = 近月点
#Principia_OrbitAnalyser_Elements_Periapsis(Mars).zh-cn = 近火点
#Principia_OrbitAnalyser_Elements_Periapsis(Jupiter).zh-cn = 近木点
#Principia_OrbitAnalyser_Elements_Periapsis(Saturn).zh-cn = 近土点
#Principia_OrbitAnalyser_Elements_Apoapsis(Sun).zh-cn = 远日点
#Principia_OrbitAnalyser_Elements_Apoapsis(Mercury).zh-cn = 远水点
#Principia_OrbitAnalyser_Elements_Apoapsis(Venus).zh-cn = 远金点
#Principia_OrbitAnalyser_Elements_Apoapsis(Earth).zh-cn = 远地点
#Principia_OrbitAnalyser_Elements_Apoapsis(Moon).zh-cn = 远月点
#Principia_OrbitAnalyser_Elements_Apoapsis(Mars).zh-cn = 远火点
#Principia_OrbitAnalyser_Elements_Apoapsis(Jupiter).zh-cn = 远木点
#Principia_OrbitAnalyser_Elements_Apoapsis(Saturn).zh-cn = 远土点
// For the 喵心惯性 and 喵心喵固, the terms listed below are exactly those
// that are attested in CNKI.
#Principia_ReferenceFrameSelector_Name_BodyCentredNonRotating(Sun).zh-cn = 日心惯性
#Principia_ReferenceFrameSelector_Name_BodyCentredNonRotating(Earth).zh-cn = 地心惯性
#Principia_ReferenceFrameSelector_Name_BodyCentredNonRotating(Moon).zh-cn = 月心惯性
#Principia_ReferenceFrameSelector_Name_BodyCentredNonRotating(Mars).zh-cn = 火心惯性
#Principia_ReferenceFrameSelector_Name_BodySurface(Earth).zh-cn = 地心地固
#Principia_ReferenceFrameSelector_Name_BodySurface(Moon).zh-cn = 月心月固
#Principia_ReferenceFrameSelector_Name_BodyCentredParentDirection(Earth,Sun).zh-cn = 地心太阳黄道
#Principia_ReferenceFrameSelector_Description_BodyCentredParentDirection(Earth,Sun).zh-cn = The centre of <<1>> is fixed.\n黄道 (the plane of its orbit around <<2>>) is horizontal.\nThe reference frame rotates with the orbit, fixing the direction of <<2>>.
}
}
27 changes: 20 additions & 7 deletions ksp_plugin_adapter/localization/en-us.cfg
Original file line number Diff line number Diff line change
@@ -90,7 +90,11 @@ Localization {
#Principia_OrbitAnalyser_OrbitDescription_Synchronous = synchronous\u0020
#Principia_OrbitAnalyser_OrbitDescription_Stationary = stationary\u0020
#Principia_OrbitAnalyser_OrbitDescription_Semisynchronous = semisynch.\u0020
#Principia_OrbitAnalyser_OrbitDescription = <<1>><<2>> orbit // <<1>> properties <<2>> primary.name
// <<1>> is the name of the primary without an article.
#Principia_OrbitAnalyser_OrbitDescription_Primary = <<1>>
// <<1>> is the sequence of properties, ending with a space.
// <<2>> is the Primary string above.
#Principia_OrbitAnalyser_OrbitDescription = <<1>><<2>> orbit
#Principia_OrbitAnalyser_Elements_LowestAltitude = Lowest altitude
#Principia_OrbitAnalyser_Warning_Collision = collision
#Principia_OrbitAnalyser_Warning_CollisionRisk = collision risk
@@ -104,9 +108,14 @@ Localization {
#Principia_OrbitAnalyser_Elements_Inclination = Inclination
#Principia_OrbitAnalyser_Elements_LongitudeOfAscendingNode = Longitude of ascending node
#Principia_OrbitAnalyser_Elements_NodalPrecession = Nodal precession
#Principia_OrbitAnalyser_Elements_ArgumentOfPeriapsis = Argument of periapsis
#Principia_OrbitAnalyser_Elements_MeanPeriapsisAltitude = Mean periapsis altitude
#Principia_OrbitAnalyser_Elements_MeanApoapsisAltitude = Mean apoapsis altitude
// These are celestial strings parameterized on the body.
#Principia_OrbitAnalyser_Elements_Periapsis = periapsis
#Principia_OrbitAnalyser_Elements_Apoapsis = apoapsis
// In the following three strings, <<1>> is the Periapsis or Apoapsis string
// above.
#Principia_OrbitAnalyser_Elements_ArgumentOfPeriapsis = Argument of <<1>>
#Principia_OrbitAnalyser_Elements_MeanPeriapsisAltitude = Mean <<1>> altitude
#Principia_OrbitAnalyser_Elements_MeanApoapsisAltitude = Mean <<1>> altitude
#Principia_OrbitAnalyser_GroundTrack = Ground track
#Principia_OrbitAnalyser_Recurrence_CapderouTriple = Recurrence: <<1>>
#Principia_OrbitAnalyser_Recurrence_AutoDetect = Auto-detect
@@ -203,9 +212,13 @@ Localization {
// MapNodePool
#Principia_MapNode_Planned = Planned
#Principia_MapNode_Predicted = Predicted
#Principia_MapNode_Periapsis = Periapsis
#Principia_MapNode_Apoapsis = Apoapsis
#Principia_MapNode_ApsisHeader = <<1>> <<2>> <<3>> :\n<<4>> m // <<1>>: source; <<2>>: celestial_name; <<3>>: apsis_name; <<4>>: celestial.GetAltitude(position).FormatN(0).
// For the apsides, <<1>> is the name of the celestial without an article.
#Principia_MapNode_Periapsis = <<1>> Periapsis
#Principia_MapNode_Apoapsis = <<1>> Apoapsis
// <<1>> is the source (predicted or planned).
// <<2>> is the apsis (from the strings above).
// <<3>> is the altitude in metres.
#Principia_MapNode_ApsisHeader = <<1>> <<2>> :\n<<3>> m
#Principia_MapNode_ApsisCaptionLine2 = <<1>> m/s // <<1>>: speed.FormatN(0).
#Principia_MapNode_AscendingNode = Ascending Node
#Principia_MapNode_DescendingNode = Descending Node
34 changes: 23 additions & 11 deletions ksp_plugin_adapter/localization/zh-cn.cfg
Original file line number Diff line number Diff line change
@@ -89,7 +89,11 @@ Localization {
#Principia_OrbitAnalyser_OrbitDescription_Stationary = 静止
// See, e.g., ITU-R-HDB-55 https://www.itu.int/pub/R-HDB-55.
#Principia_OrbitAnalyser_OrbitDescription_Semisynchronous = 半同步
#Principia_OrbitAnalyser_OrbitDescription = <<2>><<1>>轨道 // <<1>>properties <<2>> primary.name
// <<1>> is the name of the primary.
#Principia_OrbitAnalyser_OrbitDescription_Primary = <<1>>
// <<1>> is the sequence of properties.
// <<2>> is the Primary string above.
#Principia_OrbitAnalyser_OrbitDescription = <<2>><<1>>轨道
#Principia_OrbitAnalyser_Elements_LowestAltitude = 最低轨道高度
#Principia_OrbitAnalyser_Warning_Collision = 发生撞击
#Principia_OrbitAnalyser_Warning_CollisionRisk = 可能发生撞击
@@ -107,10 +111,15 @@ Localization {
#Principia_OrbitAnalyser_Elements_Inclination = 轨道倾角
#Principia_OrbitAnalyser_Elements_LongitudeOfAscendingNode = 升交点赤经
#Principia_OrbitAnalyser_Elements_NodalPrecession = 升交点进动
#Principia_OrbitAnalyser_Elements_ArgumentOfPeriapsis = 近拱点幅角
// These are celestial strings parameterized on the body.
#Principia_OrbitAnalyser_Elements_Periapsis = 近拱点
#Principia_OrbitAnalyser_Elements_Apoapsis = 远拱点
// In the following three strings, <<1>> is the Periapsis or Apoapsis string
// above.
#Principia_OrbitAnalyser_Elements_ArgumentOfPeriapsis = <<1>>幅角
// The phrase 平均近拱点高度, albeit rare, is attested in [HHZ12].
#Principia_OrbitAnalyser_Elements_MeanPeriapsisAltitude = 平均近拱点高度
#Principia_OrbitAnalyser_Elements_MeanApoapsisAltitude = 平均远拱点高度
#Principia_OrbitAnalyser_Elements_MeanPeriapsisAltitude = 平均<<1>>高度
#Principia_OrbitAnalyser_Elements_MeanApoapsisAltitude = 平均<<1>>高度
// See, e.g., [XZL09] or [WL14].
#Principia_OrbitAnalyser_GroundTrack = 地面轨迹
// See, e.g., [LLL12], or [QZJ08]. This translates more literally to “orbit
@@ -226,19 +235,22 @@ Localization {
#Principia_Logging_Fatal = 严重

// MapNodePool
// TODO(phl): Missing localization here.
#Principia_MapNode_Planned = 已计划
#Principia_MapNode_Predicted = 已预测
#Principia_MapNode_Periapsis = 近拱点
#Principia_MapNode_Apoapsis = 远拱点
#Principia_MapNode_ApsisHeader = <<1>> <<2>> <<3>> :\n<<4>> m // <<1>>: source; <<2>>: celestial_name; <<3>>: apsis_name; <<4>>: celestial.GetAltitude(position).FormatN(0).
// For the apsides, <<1>> is the name of the celestial.
#Principia_MapNode_Periapsis = <<1>>近拱点
#Principia_MapNode_Apoapsis = <<1>>远拱点
// <<1>> is the source (predicted or planned).
// <<2>> is the apsis (from the strings above).
// <<3>> is the altitude in metres.
#Principia_MapNode_ApsisHeader = <<1>><<2>>:\n<<3>> m
#Principia_MapNode_ApsisCaptionLine2 = <<1>> m/s // <<1>>: speed.FormatN(0).
#Principia_MapNode_AscendingNode = 升交点
#Principia_MapNode_DescendingNode = 降交点
#Principia_MapNode_NodeHeader = <<1>> <<2>> :\n<<3>> // <<1>>: source; <<2>>: node_name; <<3>>: plane.
#Principia_MapNode_NodeHeader = <<1>><<2>>\n<<3>> // <<1>>: source; <<2>>: node_name; <<3>>: plane.
#Principia_MapNode_NodeCaptionLine2 = <<1>> m/s // <<1>>: properties.velocity.z.FormatN(0)
#Principia_MapNode_ApproachHeader = <<1>> 目标最近 : <<2>> m // <<1>>: source, <<2>>: separation.FormatN(0).
#Principia_MapNode_ApproachHeader = <<1>>目标最近<<2>> m // <<1>>: source, <<2>>: separation.FormatN(0).
#Principia_MapNode_ApproachCaptionLine2 = <<1>> m/s // <<1>>: speed.FormatN(0).
#Principia_MapNode_ImpactHeader = <<1>> <<2>> 撞击 // <<1>>: source, <<2>>: celestial.name.
#Principia_MapNode_ImpactHeader = <<1>><<2>>撞击 // <<1>>: source, <<2>>: celestial.name.
}
}
30 changes: 30 additions & 0 deletions ksp_plugin_adapter/localization_extensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using KSP.Localization;
using System;
using System.Linq;
using System.Text.RegularExpressions;

namespace principia {
@@ -41,6 +43,10 @@ public static string NameWithArticle(this CelestialBody body) {
: body.displayName;
}

public static string Initial(this CelestialBody body) {
return body.NameWithoutArticle()[0].ToString();
}

public static string FormatOrNull(string template, params object[] args) {
// Optional translations include the language name so that they do not fall
// back to English.
@@ -50,6 +56,30 @@ public static string FormatOrNull(string template, params object[] args) {
}
return Localizer.Format(qualified_template, args);
}

private static string CelestialOverride(string template,
string[] names,
CelestialBody[] bodies) {
return FormatOrNull(
$"{template}({string.Join(",", from body in bodies select body.name)})",
names);
}

public static string CelestialString(string template,
Func<CelestialBody, string> name,
params CelestialBody[] args) {
string[] names = (from body in args select name(body)).ToArray();
return CelestialOverride(template, names, args) ??
Localizer.Format(template, names);
}

public static string CelestialStringOrNull(string template,
Func<CelestialBody, string> name,
params CelestialBody[] args) {
string[] names = (from body in args select name(body)).ToArray();
return CelestialOverride(template, names, args) ??
FormatOrNull(template, names);
}
}

}
12 changes: 6 additions & 6 deletions ksp_plugin_adapter/map_node_pool.cs
Original file line number Diff line number Diff line change
@@ -208,17 +208,17 @@ private KSP.UI.Screens.Mapview.MapNode MakePoolNode() {
switch (properties.object_type) {
case MapObject.ObjectType.Periapsis:
case MapObject.ObjectType.Apoapsis: {
string apsis_name =
CelestialBody celestial = properties.reference_frame.Centre();
string apsis_name = L10N.CelestialString(
properties.object_type == MapObject.ObjectType.Periapsis
? Localizer.Format("#Principia_MapNode_Periapsis")
: Localizer.Format("#Principia_MapNode_Apoapsis");
CelestialBody celestial =
properties.reference_frame.Centre();
? "#Principia_MapNode_Periapsis"
: "#Principia_MapNode_Apoapsis",
L10N.NameWithoutArticle,
celestial);
Vector3d position = properties.world_position;
double speed = properties.velocity.magnitude;
caption.Header = Localizer.Format("#Principia_MapNode_ApsisHeader",
source,
celestial.name,
apsis_name,
celestial.GetAltitude(position).
FormatN(0));
Loading