Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localization fixes + ru #57

Merged
merged 5 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions GameData/Kaboom/Localization/en-us.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// en-us.cfg v1.0.1.0
// en-us.cfg v1.0.2.0
// Kaboom! (BOOM)
// created: 25 Feb 2020
// updated: 05 Oct 2021
// updated: 13 Oct 2021

// Initially auto generated by KSPDev Localization tool at: 8/28/2021 4:44:57 PM
// final localization and strings provided by zer0Kerbal.
Expand All @@ -12,30 +13,27 @@ Localization
{
// ********** Type: Kaboom.ModuleKaboom, KSP Actions
#BOOM-modname = Kaboom!
#BOOM-modnameV = Kaboom! v<<0>>
#BOOM-modnameV = Kaboom! v<<1>>

// ********** Type: Kaboom.ModuleKaboom, KSP Fields, Events
#BOOM-GroupName = Kaboom
#BOOM-delay = Kaboom delay
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#BOOM-modname probably can be used for multiple instances in order to simplify and streamline.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#BOOM-modname is there, I removed #BOOM-GroupName because GroupName is internal and need to be English

#BOOM-delay-Units = \u0020Seconds
#BOOM-KaboomEvent = Kaboom!
#BOOM-Cancel = Cancel Kaboom!
#BOOM-SafetyCover = Kaboom Safety Cover
#BOOM-KaboomItMsg = Kaboom set for <<0>> seconds.
#BOOM-SafetyCoverColor = <color=red>Kaboom Safety Cover</color>
#BOOM-KaboomItMsg = Kaboom set for <<1>> seconds.
#BOOM-CancelKoboomIt = Kaboom canceled.
#BOOM-ThankYou = Thank you for using Kaboom! <<1>> for all your explosive needs!\n <b><i>Have a booming day!</b></i>

// ********** Type: Kaboom.Welding
#BOOM-MergePartsMsg = You cannot weld the root part! <<0>>
#BOOM-MergePartsMsg = You cannot weld the root part!
#BOOM-WeldingData-A = Docked vessels detected, unable to explode the docking port.\nTrying to explode both docking ports
#BOOM-WeldingData-B = This part need to have 2 parts on attachment nodes
#BOOM-WeldingData-C = This part is the root part! Cancelling

// ********** Type: Kaboom.ModuleKaboom, KSP Fields
#BOOM-GluedEvent = Superklue

#BOOM-ModuleKaboom-delay = Kaboom delay
#BOOM-ModuleKaboom-delay-Units = Seconds

// ********** Global strings
#BOOM-settings-titl = Kaboom! Settings
#BOOM-settings-sect = Kaboom! (BOOM)
Expand Down
19 changes: 8 additions & 11 deletions GameData/Kaboom/Localization/es-es.cfg
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
// es-es.cfg v1.0.0.1
// es-es.cfg v1.0.1.1
// Kaboom! (BOOM)
// created: 05 Oct 2021
// updated:
// updated: 13 Oct 2021

// thank you to @Tacombel for the Spanish translations!

// Spanish localization

Localization
{
es-es
{

// ********** Type: Kaboom.ModuleKaboom, KSP Actions
#BOOM-modname = ¡Kaboom!
#BOOM-modnameV = ¡Kaboom! v<<0>>
#BOOM-modnameV = ¡Kaboom! v<<1>>

// ********** Type: Kaboom.ModuleKaboom, KSP Fields, Events
#BOOM-GroupName = Kaboom
#BOOM-delay = Retardo para el ¡Kaboom!
#BOOM-delay-Units = \u0020segundos
#BOOM-KaboomEvent = ¡Kaboom!
#BOOM-Cancel = Cancelar ¡Kaboom!
#BOOM-SafetyCover = Cubierta de seguridad: ¡Kaboom!
#BOOM-KaboomItMsg = ¡Kaboom! actuará en <<0>> segundos.
#BOOM-SafetyCoverColor = <color=red>Cubierta de seguridad: ¡Kaboom!</color>
#BOOM-KaboomItMsg = ¡Kaboom! actuará en <<1>> segundos.
#BOOM-CancelKoboomIt = ¡Kaboom! cancelado.
#BOOM-ThankYou = ¡Gracias por utilizar Kaboom! <<1>> para todas tus necesidades explosivas!\n <b><i>¡Que tengas un dia lleno de explosiones!</b></i>

// ********** Type: Kaboom.Welding
#BOOM-MergePartsMsg = ¡No puedes soldar la pieza raiz! <<0>>
#BOOM-MergePartsMsg = ¡No puedes soldar la pieza raiz!
#BOOM-WeldingData-A = Naves atracadas detectadas, imposible destruir el puerto de atraque.\nIntentando destruir ambos puertos de atraque.
#BOOM-WeldingData-B = Esta pieza necesita tener dos piezas acopladas en nodos de acoplamiento.
#BOOM-WeldingData-C = ¡Esta pieza es la pieza raiz! Cancelando.

// ********** Type: Kaboom.ModuleKaboom, KSP Fields
#BOOM-GluedEvent = Superklue

#BOOM-ModuleKaboom-delay = Retardo para el ¡Kaboom!
#BOOM-ModuleKaboom-delay-Units = segundos

// ********** Global strings
#BOOM-settings-titl = Configuración de ¡Kaboom!
#BOOM-settings-sect = ¡Kaboom! (BOOM)
Expand Down
52 changes: 52 additions & 0 deletions GameData/Kaboom/Localization/ru.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// ru.cfg v1.0.0.0
// Kaboom! (BOOM)
// created: 13 Oct 2021 by flart

Localization
{
ru
{
// ********** Type: Kaboom.ModuleKaboom, KSP Actions
#BOOM-modname = Kaboom!
#BOOM-modnameV = Kaboom! v<<1>>

// ********** Type: Kaboom.ModuleKaboom, KSP Fields, Events
#BOOM-delay = Задержка взрыва // Kaboom delay
#BOOM-delay-Units = \u0020сек.
#BOOM-KaboomEvent = Бабах! // Kaboom!
#BOOM-Cancel = Отмена взрыва // Cancel Kaboom!
#BOOM-SafetyCover = Меню взрыва // Kaboom Safety Cover
#BOOM-SafetyCoverColor = <color=red>Меню взрыва</color>
#BOOM-KaboomItMsg = Взрыв установлен на <<1>> сек.
#BOOM-CancelKoboomIt = Взрыв отменён.
#BOOM-ThankYou = Thank you for using Kaboom! <<1>> for all your explosive needs!\n <b><i>Have a booming day!</b></i>

// ********** Type: Kaboom.Welding
#BOOM-MergePartsMsg = You cannot weld the root part!
#BOOM-WeldingData-A = Docked vessels detected, unable to explode the docking port.\nTrying to explode both docking ports
#BOOM-WeldingData-B = This part need to have 2 parts on attachment nodes

// ********** Type: Kaboom.ModuleKaboom, KSP Fields
#BOOM-GluedEvent = Суперклей

// ********** Global strings
#BOOM-settings-titl = Kaboom! Настройки
#BOOM-settings-sect = Kaboom! (BOOM)
#BOOM-settings-disp = Kaboom!

#BOOM-settings-softExplode = Мягкий взрыв
#BOOM-settings-softExplode-tt = Меньше шума и огня при взрыве.

#BOOM-settings-coloredPaw = Меню взрыва красное
#BOOM-settings-coloredPaw-tt = Меню безопасности взыва в PAW красное.\nОбновляется после смены сцены.

#BOOM-settings-xDebug = Отладка
#BOOM-settings-xDebug-tt = Включить отладку (если предусмотрено) (выкл. по-умолчанию)

#BOOM-settings-xLogging = Расширенное логирование
#BOOM-settings-xLogging-tt = Включить дополнительное логирование (если предусмотрено) (выкл. по-умолчанию)\nНегативно влияет на производительность.
}
}

// GPLv2 BY
// zer0Kerbal
12 changes: 6 additions & 6 deletions source/Kaboom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Kaboom
public class ModuleKaboom : PartModule
{
[KSPField(isPersistant = true,
guiName = "#BOOM-delay", groupName = "KaboOm", groupStartCollapsed = true, guiUnits = " Seconds",
guiName = "#BOOM-delay", groupName = "KaboOm", groupStartCollapsed = true, guiUnits = "#BOOM-delay-Units",
guiActive = true, guiActiveUnfocused = true, unfocusedRange = 10f, guiActiveEditor = true),
UI_FloatRange(minValue = 0f, maxValue = 30f, stepIncrement = 1f)]
public float delay = 0;
Expand Down Expand Up @@ -58,11 +58,11 @@ public override void OnStart(StartState state)
base.OnStart(state);

if (HighLogic.CurrentGame.Parameters.CustomParams<KaboomSettings>().coloredPAW)
//Fields["delay"].group.displayName = Localizer.Format("<color=red>#BOOM-SafetyCover</color>");
Fields["delay"].group.displayName = "<color=red>Kaboom Safety Cover</color>";
Fields["delay"].group.displayName = Localizer.Format("#BOOM-SafetyCoverColor");
Copy link
Owner

@zer0Kerbal zer0Kerbal Oct 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer the color to remain in the code; keeps things simple for those who translate IMHO.

Fields["delay"].group.displayName = System.String.Format("<color=red>" + Localizer.Format("Kaboom Safety Cover") + "</color>");

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually put color tag to the loc file, so users could change colors if needed

//Fields["delay"].group.displayName = "<color=red>Kaboom Safety Cover</color>";
else
//Fields["delay"].group.displayName = Localizer.Format("#BOOM-SafetyCover");
Fields["delay"].group.displayName = "Kaboom Safety Cover";
Fields["delay"].group.displayName = Localizer.Format("#BOOM-SafetyCover");
//Fields["delay"].group.displayName = "Kaboom Safety Cover";

GUITextUpdate();
}
Expand Down Expand Up @@ -111,7 +111,7 @@ private void CancelKaboomIt()
{
Events["CancelKaboomEvent"].active = false;
Events["KaboomEvent"].active = true;
ScreenMessages.PostScreenMessage(Localizer.Format("#BOOM-CancelKoboomIt"), 5.0f, ScreenMessageStyle.UPPER_CENTER);
ScreenMessages.PostScreenMessage(Localizer.Format("#BOOM-CancelKoboomIt"));
}
}
}
4 changes: 2 additions & 2 deletions source/Support/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public class KaboomSettings : GameParameters.CustomParameterNode
[GameParameters.CustomParameterUI("#BOOM-settings-xDebug",
toolTip = "#BOOM-settings-xDebug-tt",
unlockedDuringMission = true)]
public bool xDebug = true;
public bool xDebug = false;

[GameParameters.CustomParameterUI("#BOOM-settings-xLogging",
toolTip = "#BOOM-settings-xLogging-tt",
unlockedDuringMission = true)]
public bool xLogging = true;
public bool xLogging = false;

// If you want to have some of the game settings default to enabled, change
// the "if false" to "if true" and set the values as you like
Expand Down
18 changes: 6 additions & 12 deletions source/Welding/Welding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ public Welding(Vessel vessel, Part part)

public bool MergeParts(bool compress)
{
if (vessel.rootPart == part)
{
ScreenMessages.PostScreenMessage(Localizer.Format("#BOOM-MergePartsMsg", part.name));
return false;
}

var wData = LoadWeldingData();
if (wData == null)
return false;
Expand All @@ -47,6 +41,12 @@ private WeldingData LoadWeldingData()
*
**********************/

if (vessel.rootPart == part)
{
ScreenMessages.PostScreenMessage(Localizer.Format("#BOOM-MergePartsMsg"));
return null;
}

var wData = new WeldingData();


Expand Down Expand Up @@ -100,12 +100,6 @@ private WeldingData LoadWeldingData()
return null;
}

if (wData.KaboomGluedPart == vessel.rootPart)
{
ScreenMessages.PostScreenMessage(Localizer.Format("#BOOM-WeldingData-C"));
return null;
}

return wData;
}

Expand Down