(36d2ff935) Merge branch 'dev' of github.com:Regalis11/Barotrauma-development into dev

This commit is contained in:
Joonas Rikkonen
2019-05-20 20:18:17 +03:00
parent 1340780205
commit 120dc39a9e
9 changed files with 101 additions and 76 deletions
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace Barotrauma
{
@@ -42,6 +43,26 @@ namespace Barotrauma
GetTextFilesRecursive(subDir, ref list);
}
}
/// <summary>
/// Returns the name of the language in the respective language
/// </summary>
public static string GetTranslatedLanguageName(string language)
{
if (!textPacks.ContainsKey(language))
{
return language;
}
foreach (var textPack in textPacks[language])
{
if (textPack.Language == language)
{
return textPack.TranslatedName;
}
}
return language;
}
public static void LoadTextPacks(IEnumerable<ContentPackage> selectedContentPackages)
{
@@ -111,8 +132,6 @@ namespace Barotrauma
throw new Exception("No text packs available in English!");
}
}
return false;
}
foreach (TextPack textPack in textPacks[Language])
{
@@ -393,42 +412,6 @@ namespace Barotrauma
return isCJK.IsMatch(text);
}
#if DEBUG
public static void CheckForDuplicates(string lang)
{
if (!textPacks.ContainsKey(lang))
{
DebugConsole.ThrowError("No text packs available for the selected language (" + lang + ")!");
return;
}
int packIndex = 0;
foreach (TextPack textPack in textPacks[lang])
{
textPack.CheckForDuplicates(packIndex);
packIndex++;
}
}
public static void WriteToCSV()
{
string lang = "English";
if (!textPacks.ContainsKey(lang))
{
DebugConsole.ThrowError("No text packs available for the selected language (" + lang + ")!");
return;
}
int packIndex = 0;
foreach (TextPack textPack in textPacks[lang])
{
textPack.WriteToCSV(packIndex);
packIndex++;
}
}
#endif
#if DEBUG
public static void CheckForDuplicates(string lang)
{