Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed May 26, 2017
2 parents dd1f9c3 + 2ceaa9c commit fd63164
Show file tree
Hide file tree
Showing 30 changed files with 523 additions and 140 deletions.
12 changes: 6 additions & 6 deletions Astrogator.version
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
},
"VERSION": {
"MAJOR": 0,
"MINOR": 6,
"PATCH": 2,
"MINOR": 7,
"PATCH": 0,
"BUILD": 0
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
"MINOR": 2,
"PATCH": 2
"MINOR": 3,
"PATCH": 0
},
"KSP_VERSION_MAX": {
"MAJOR": 1,
"MINOR": 2,
"PATCH": 99
"MINOR": 3,
"PATCH": 8
}
}
119 changes: 118 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,123 @@
# Contributing to Astrogator

Astrogator welcomes contributions from anyone in the form of problem reports, enhancement suggestions, and code changes. To make them as useful as possible, it's necessary to spell out some expectations.
Astrogator welcomes contributions from anyone in the form of translations, problem reports, enhancement suggestions, and code changes. To make them as useful as possible, it's necessary to spell out some expectations.

## Translating to your language

![Languages supported by KSP 1.3: English, Spanish, Chinese, Russian, Japanese](https://i.imgur.com/DbCCJWK.png)

The 1.3 release of KSP introduces localization, which allows in-game text to be translated to other languages. This allows more people to enjoy the game in their preferred language and enlarges the community. However, it does not happen automatically for mods; by default, a mod will appear in English regardless of the language of the base game. In order to have both the base game and mods available in the same non-English languages, some additional work must be done by the modder.

Unfortunately, I only speak English, and I maintain this mod for free. This means I cannot create my own translations, and I cannot pay a professional translation service to produce high quality translations. The best I can do on my own is to use Google Translate, which is of dubious value for the terse, idiomatic strings needed in a KSP mod's UI. Instead, I must rely on the expertise of you, the multilingual KSP mod user, to tell me what good translations look like for your language. If you would like to help in this effort, please keep reading to learn how the mod's language files are structured and how to submit translations for use by others.

Note: Even though you will appear to be editing the project's files, don't worry about making mistakes. Github will keep your changes separate from the main files until I have verified that they are OK to use. It is even possible for me to ask questions or request changes before your work is committed to the main files.

### Creating or editing a translation

It is recommended to make your changes on your own computer at first so you can test them before uploading, especially if you are creating a new translation from scratch.

1. Install the [current release of Astrogator](https://github.com/HebaruSan/Astrogator/releases/latest) if you have not already
2. Open your `Kerbal Space Program/GameData/Astrogator/lang` folder on your local disk
3. Look for a file called *lang*.cfg, where *lang* is KSP's name for your locale; as of KSP 1.3, this includes:
- en-us (English)
- es-es (Spanish)
- ja (Japanese)
- ru (Russian)
- zh-cn (Chinese)

The remaining steps are different depending on whether the file already exists:

#### If the file exists

Follow these steps to make improvements to an existing translation:

3. Edit the file for your language in your favorite text editor
4. Make the changes you wish to see in-game (see the [File format section](#file-format) below for details)
5. Save your changes
6. Remember to [test your changes](#testing)!

#### If the file does not exist

Follow these steps to start your own translation from scratch:

3. Make a copy of `en-us.cfg` in the `lang` folder
4. Rename the file according to the list of languages above
5. Edit the file for your language in your favorite text editor
6. Change the third line from `en-us` to the string for your language
7. Translate each string from English to your language (see the [File format section](#file-format) below for details)
8. Save your changes
9. Remember to [test your changes](#testing)!

#### File format

The middle part of the `cfg` file contains the strings to translate. The format is `name = translation`, where the name is a special string defined by the mod. For example:

astrogator_launchSubtitle = Transfers from <<A:1>>\n(Launch ~<<2>>)

Do **not** change the part to the left of the equals sign ("=")! These names must be the same in every language file.

The part to the right of the equals sign is the string to be used in-game. Most of the text will be shown as-is, but it can contain a few special strings as shown in the [Lingoona grammar module demo](http://lingoona.com/cgi-bin/grammar#l=en):

| String | Purpose |
| --- | --- |
| \n | Line break; try to preserve these based on the original strings to make sure the strings will fit |
| <<1>> | The first substitutable token in the string, will be replaced by a number, name of a planet, etc., depending on the string |
| <<2>> | Second token, and so on |
| <<A:1>> | The first token, but substituted with a proper article |

For example, this is a possible translation of the above line into Spanish, courtesy of Google Translate:

astrogator_launchSubtitle = Transferencias de <<A:1>>\n(Lanzamiento ~<<2>>)

#### Testing

It's important to make sure that your changes work correctly. If you use Steam:

1. [Select the language to use in Steam](https://www.youtube.com/watch?v=iBwYCvQxfeI)
2. Wait for the language pack download to complete
3. Run KSP
4. Use Astrogator and make sure your changes appear as you intended

If you do not use Steam, I don't know the steps to choose a language. Contact SQUAD if you can't figure it out.

### Contributing your translation for others to use

After you have prepared a `cfg` file for your language and confirmed that it works as you intend, if you are willing to contribute it for redistribution under the GLPv3 license, follow these steps to upload it for inclusion in the main mod distribution:

1. Log in to [Github](https://github.com); you may need to register an account if you do not already have one
2. Navigate to the [lang folder](https://github.com/HebaruSan/Astrogator/tree/master/assets/lang)
3. Look for the file you edited

The remaining steps are different depending on whether the file already exists:

#### If the file exists

4. Click the file's name to view it
5. Click the [pencil icon](https://help.github.com/assets/images/help/repository/edit-file-edit-button.png) to edit
6. Replace the text with the pasted contents of the file you edited locally
7. **Important**: At the bottom of the page, under Propose file change, type an English description of the changes you have made and the reason you think they should be made. This will help me to confirm that your changes are appropriate. Remember, I do not speak the language in the `cfg` file, so I need you to tell me why your way is better!
6. Click `Propose file change` at the bottom when done

#### If the file does not exist

4. Click [Create new file](https://help.github.com/assets/images/help/repository/create_new_file.png) to create it
5. Enter the correct file name in the box at the top
6. Paste the contents of the file you edited locally into the big box in the middle
8. Click `Propose new file` at the bottom when done

#### Review

Once you finish your changes, Github will send me a notification that a pull request has been submitted. I will take a look at it within a day or two and attempt to verify that the changes make sense by:

- Confirming that the file name and the third line of the file match one of the supported locale names
- Viewing each change string in-game
- Checking Google Translate
- Asking individual human experts
- Requesting help on the KSP forum

If I have any questions about specific changes you've made, I will add them to the pull request, which should trigger a notification to you. Please try to respond to these in as timely a manner as you can manage. Your pull request may be closed without merging if you do not reply for a long time.

Once all the questions and comments are resolved to my satisfaction, your changes will be merged into the main files and included in the next release. I will also add your Github name to the Acknowledgements section of the README file.

## [Issues](https://github.com/HebaruSan/Astrogator/issues)

Expand Down
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
.PHONY: all clean

SOURCEDIR=src
SOURCE=$(wildcard $(SOURCEDIR)/*.cs)
SOURCE=$(wildcard $(SOURCEDIR)/*.cs) $(wildcard $(SOURCEDIR)/*.csproj)
ASSETDIR=assets
ICONS=$(wildcard $(ASSETDIR)/*.png)
CONFIGS=$(wildcard $(ASSETDIR)/*.cfg)
LANGUAGES=$(ASSETDIR)/lang
README=README.md
GAMELINK=$(SOURCEDIR)/KSP_x64_Data
DEFAULTGAMEDIR="$(HOME)/.local/share/Steam/SteamApps/common/Kerbal Space Program"
DEFAULTGAMEDIR=$(HOME)/.local/share/Steam/SteamApps/common/Kerbal Space Program

DEBUGDLL=$(SOURCEDIR)/bin/Debug/Astrogator.dll
RELEASEDLL=$(SOURCEDIR)/bin/Release/Astrogator.dll
Expand Down Expand Up @@ -36,16 +37,16 @@ $(DEBUGDLL): $(SOURCE) $(GAMELINK)
$(RELEASEDLL): $(SOURCE) $(GAMELINK)
cd $(SOURCEDIR) && xbuild /p:Configuration=Release

$(RELEASEZIP): $(DEBUGDLL) $(ICONS) $(README) $(DLLDOCS) $(DLLSYMBOLS) $(LICENSE) $(VERSION) $(CONFIGS)
$(RELEASEZIP): $(RELEASEDLL) $(ICONS) $(README) $(DLLDOCS) $(DLLSYMBOLS) $(LICENSE) $(VERSION) $(CONFIGS) $(LANGUAGES)
mkdir -p $(DISTDIR)
cp $^ $(DISTDIR)
zip -r $@ $(DISTDIR)
cp -a $^ $(DISTDIR)
zip -r $@ $(DISTDIR) -x \*.settings

$(GAMELINK):
if [ -x "$(DEFAULTGAMEDIR)" ]; \
then; \
then \
ln -s "$(DEFAULTGAMEDIR)"/KSP_x64_Data $(GAMELINK); \
else; \
else \
echo "$(GAMELINK) not found."; \
echo 'This must be a symlink to Kerbal Space Program/KSP_x64_Data.'; \
exit 2; \
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,15 @@ See [INSTALL.md](INSTALL.md).
## References

### Plug-in authoring
- https://kerbalspaceprogram.com/api/index.html
- http://forum.kerbalspaceprogram.com/index.php?/topic/153765-getting-started-the-basics-of-writing-a-plug-in/
- http://forum.kerbalspaceprogram.com/index.php?/topic/151354-unity-ui-creation-tutorial/
- http://forum.kerbalspaceprogram.com/index.php?/topic/149324-popupdialog-and-the-dialoggui-classes/
- http://forum.kerbalspaceprogram.com/index.php?/topic/78231-application-launcher-and-mods/
- http://forum.kerbalspaceprogram.com/index.php?/topic/154006-solved-texture-issues/&do=findComment&comment=2904233
- https://kerbalspaceprogram.com/api/index.html

### Localization
- http://forum.kerbalspaceprogram.com/index.php?/topic/158018-addon-localization-home/

### Physics and math
- https://en.wikipedia.org/wiki/Hohmann_transfer_orbit
Expand All @@ -99,6 +102,8 @@ See [INSTALL.md](INSTALL.md).
- https://d2r5da613aq50s.cloudfront.net/wp-content/uploads/411616.image0.jpg
- https://en.wikipedia.org/wiki/Orbital_inclination_change#Calculation
- https://en.wikipedia.org/wiki/Hyperbolic_trajectory#Hyperbolic_excess_velocity
- http://www.dtic.mil/dtic/tr/fulltext/u2/a200383.pdf
- http://forum.kerbalspaceprogram.com/index.php?/topic/122779-changing-orbital-angle-without-changing-apoapsis/

### Performance
- http://www.somasim.com/blog/2015/04/csharp-memory-and-performance-tips-for-unity/
Expand Down
6 changes: 5 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
- Only rule out a range once the entire thing is overdue
- [ ] Merge the correction burn into the ejection burn
- [ ] Re-do launch approximation to increase accuracy
- [ ] i18n / l10n (once SQUAD releases their version of it)

## Localization clean-up

- [ ] ["the Mun"](http://bugs.kerbalspaceprogram.com/issues/14314)
- [ ] Times not showing up in Chinese and Japanese

## Fixes

Expand Down
50 changes: 50 additions & 0 deletions assets/lang/en-us.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Localization
{
en-us
{
astrogator_mainTitle = Astrogator
astrogator_versionFormat = v<<1>>.<<2>>.<<3>>
astrogator_mainTooltip = Summary of transfer windows of reachable bodies
astrogator_normalSubtitle = Transfers from <<1>>
astrogator_inboundHyperbolicWarning = <<1>> is on an escape trajectory.\nCapture to see more transfers.
astrogator_outboundHyperbolicError = <<1>> is on an escape trajectory.\nCapture to see transfers.
astrogator_landedError = <<1>> is landed. Launch to orbit to see transfers.
astrogator_highInclinationError = Inclination is <<1>>°, accuracy too low past <<2>>°
astrogator_noTransfersError = No transfers available
astrogator_launchSubtitle = Transfers from <<1>>\n(Launch ~<<2>>)
astrogator_transferColumnHeader = Transfer
astrogator_timeColumnHeader = Time Till Burn
astrogator_deltaVColumnHeader = Δv
astrogator_planetLabel = <<1>>
astrogator_maneuverButtonTooltip = Create maneuver
astrogator_warpButtonTooltip = Warp to window
astrogator_yearsValue = <<1>>y
astrogator_daysValue = <<1>>d
astrogator_hoursValue = <<1>>h
astrogator_minutesValue = <<1>>m
astrogator_secondsValue = <<1>>s
astrogator_settingsButtonTooltip = Settings
astrogator_columnHeaderTooltip = Sort
astrogator_translationControlsNotification = Use translation controls to adjust nodes
astrogator_adjustManeuversMessage = Adjust maneuvers to establish encounter
astrogator_manualLink = Click for online manual
astrogator_manualLinkTooltip = The meaning of each setting is explained in the README.md file
astrogator_settingsSectionHeader = Settings:
astrogator_planeChangeBurnsSetting = Generate plane change burns
astrogator_addChangeBurnsSetting = Add plane change burns to Δv column
astrogator_autoDeleteNodesSetting = Auto-delete user-created maneuver nodes
astrogator_asteroidsSetting = Calculate transfers to tracked asteroids
astrogator_maneuverCreationHeader = Maneuver creation:
astrogator_autoTargetDestSetting = Automatically target destination
astrogator_autoFocusDestSetting = Automatically focus destination
astrogator_autoEditEjecSetting = Automatically edit ejection node
astrogator_autoEditPlaneChgSetting = Automatically edit plane change node
astrogator_autoSetSASSetting = Automatically set SAS to maneuver mode
astrogator_adjustNodesSetting = Adjust nodes with translation controls when RCS is off
astrogator_unitsHeader = Units:
astrogator_metricSetting = Système International d'Unités (Metric)
astrogator_imperialSetting = United States Customary (Imperial)
astrogator_speedMetric = <<1>> m/s
astrogator_speedUSCustomary = <<1>> mph
}
}
50 changes: 50 additions & 0 deletions assets/lang/es-es.cfg.google-translate
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Localization
{
es-es
{
astrogator_mainTitle = Astrogador
astrogator_versionFormat = v<<1>>.<<2>>.<<3>>
astrogator_mainTooltip = Resumen de ventanas de transferencia de cuerpos accesibles
astrogator_normalSubtitle = Transferencias desde <<A:1>>
astrogator_inboundHyperbolicWarning = <<1>> está en una trayectoria de escape.\nCaptura para ver más transferencias.
astrogator_outboundHyperbolicError = <<1>> está en una trayectoria de escape.\nCaptura para ver transferencias.
astrogator_landedError = <<1>> se desembarca. Iniciar en órbita para ver las transferencias.
astrogator_highInclinationError = La inclinación es <<1>>°, la precisión es demasiado baja después de <<2>>°
astrogator_noTransfersError = No hay transferencias disponibles
astrogator_launchSubtitle = Transferencias de <<A:1>>\n(Lanzamiento ~<<2>>)
astrogator_transferColumnHeader = Transferir
astrogator_timeColumnHeader = Tiempo hasta quemar
astrogator_deltaVColumnHeader = Δv
astrogator_planetLabel = <<1>>
astrogator_maneuverButtonTooltip = Crear maniobra
astrogator_warpButtonTooltip = Deformar a la ventana
astrogator_yearsValue = <<1>>a
astrogator_daysValue = <<1>>d
astrogator_hoursValue = <<1>>h
astrogator_minutesValue = <<1>>m
astrogator_secondsValue = <<1>>s
astrogator_settingsButtonTooltip = Ajustes
astrogator_columnHeaderTooltip = Ordenar
astrogator_translationControlsNotification = Usar controles de traducción para ajustar nodos
astrogator_adjustManeuversMessage = Ajuste las maniobras para establecer el encuentro
astrogator_manualLink = Haga clic para obtener el manual en línea
astrogator_manualLinkTooltip = El significado de cada configuración se explica en el archivo README.md
astrogator_settingsSectionHeader = Ajustes:
astrogator_planeChangeBurnsSetting = Generar quemaduras de cambio de plano
astrogator_addChangeBurnsSetting = Añadir el plano cambie las quemaduras a la columna Δv
astrogator_autoDeleteNodesSetting = Eliminación automática de nodos de maniobra creados por el usuario
astrogator_asteroidsSetting = Calcular transferencias a asteroides rastreados
astrogator_maneuverCreationHeader = Creación de maniobras:
astrogator_autoTargetDestSetting = Destino de destino automático
astrogator_autoFocusDestSetting = Enfocar destino automáticamente
astrogator_autoEditEjecSetting = Editar automáticamente nodo de expulsión
astrogator_autoEditPlaneChgSetting = Editar automáticamente nodo de cambio de plano
astrogator_autoSetSASSetting = Establecer automáticamente SAS en modo de maniobra
astrogator_adjustNodesSetting = Ajustar nodos con controles de traducción cuando RCS está desactivado
astrogator_unitsHeader = Unidades:
astrogator_metricSetting = Système International d'Unités (Métrico)
astrogator_imperialSetting = United States Customary (Imperial)
astrogator_speedMetric = <<1>> m/s
astrogator_speedUSCustomary = <<1>> mph
}
}
Loading

0 comments on commit fd63164

Please sign in to comment.