Search results

  1. Sorrow0

    BL Des nouvelles - Nous ne sommes pas morts

    Bonjour, je vais m'attarder sur ces quelques lignes histoire de remettre les choses dans leur contexte, nous n'avons pas l'envie ni l'a prétention de dire quoi que ce soit sur la traduction des autres.

    Mais pour que ce soit plus clair pour tout le monde, j'ai reçu un message sur Nexus me signalant que le contenu de mon mod "FrenchTranslation" a été copié, sans même qu'on ne prenne le temps de citer l'auteur. Et effectivement après vérification il est même écrit sur ce mod qu’ils n’ont pas connaissance des auteurs originaux.
    1.png


    Or si je reprends les mots à Daneel53, il semblerait qu’il sache très bien à qui appartient ce travail.
    2.png


    Pourtant les règles du jeu sont bien définies sur Nexus.
    3.png

    4.png


    En soit, vous ne voler pas la tondeuse de votre voisin pour couper l'herbe chez vous ? Quand vous en avez besoin, vous lui demandez de vous la prêter gentiment. Vous ne la modifiez pas et quand on vous demande à qui est cette chouette tondeuse que vous possédez, vous dites que c’est votre voisin qui vous la prête.

    Je pense que nexus à fait une comparaison pour en arriver à cette conclusion. En soit si nexus se trompe, rien ne leur empêche de prouver leur innocence pour récupérer leur page.
    Désolé si certains ont pu se sentir offensés il faut voir avec nexus directement, je ne suis en aucun cas responsable de la modération qui règne sur la plateforme.

    Le but étant d'apporter de la nouveauté à M&B 2 : Bannerlord et ce nouveau mod vous permettra de redécouvrir le jeu sous une autre forme si je puis dire, ou en tout cas les factions.

    Enjoy, ne nous prenons pas la tête nous avons bien d'autres soucis à régler en ces temps de guerre contre le covid-19, je vous souhaite un bon jeu à tous.
  2. Sorrow0

    BL Coding How to override MBTextManager for custom TextProcessor

    Thanks anyway, I tried to overload the DefaultTextProcessor class which is loaded by default when you're in French but I don't see how to load it in a mod. Does anyone have an idea?
  3. Sorrow0

    BL Coding How to override MBTextManager for custom TextProcessor

    Thanks for this, but we have no problem translating the xml. Only we would like to add a TextProcessor file for French. To be able to prefix the words with "d' de du"...

    For example EnglishTextProcessor and TurkishTextProcessor
    C#:
    using System;
    using System.Collections.Generic;
    using System.Globalization;
    using System.Linq;
    using System.Text;
    
    namespace TaleWorlds.Localization.TextProcessor
    {
        // Token: 0x0200001B RID: 27
        public class EnglishTextProcessor : LanguageSpecificTextProcessor
        {
            // Token: 0x06000075 RID: 117 RVA: 0x0000386C File Offset: 0x00001A6C
            public override void ProcessToken(string sourceText, ref int cursorPos, string token, StringBuilder outputString)
            {
                char c = token[1];
                if (c == 'a')
                {
                    if (this.CheckNextCharIsVowel(sourceText, cursorPos))
                    {
                        outputString.Append("an");
                        return;
                    }
                    outputString.Append("a");
                    return;
                }
                else
                {
                    if (c != 'A')
                    {
                        if (c == 's')
                        {
                            string text = "";
                            int num = outputString.Length - 1;
                            while (num >= 0 && outputString[num] != ' ')
                            {
                                text += outputString[num].ToString();
                                num--;
                            }
                            text = new string(text.Reverse<char>().ToArray<char>());
                            if (text.Length > 1)
                            {
                                string newValue;
                                if (this.HandleIrregularNouns(text, out newValue))
                                {
                                    outputString.Replace(text, newValue);
                                    return;
                                }
                                if (this.Handle_ves_Suffix(text, out newValue))
                                {
                                    outputString.Replace(text, newValue);
                                    return;
                                }
                                if (this.Handle_ies_Suffix(text, out newValue))
                                {
                                    outputString.Replace(text, newValue);
                                    return;
                                }
                                if (this.Handle_es_Suffix(text, out newValue))
                                {
                                    outputString.Replace(text, newValue);
                                    return;
                                }
                                if (this.Handle_s_Suffix(text, out newValue))
                                {
                                    outputString.Replace(text, newValue);
                                    return;
                                }
                                outputString.Append(c);
                            }
                        }
                        return;
                    }
                    if (this.CheckNextCharIsVowel(sourceText, cursorPos))
                    {
                        outputString.Append("An");
                        return;
                    }
                    outputString.Append("A");
                    return;
                }
            }
    
            // Token: 0x06000076 RID: 118 RVA: 0x000039B4 File Offset: 0x00001BB4
            private bool CheckNextCharIsVowel(string sourceText, int cursorPos)
            {
                while (cursorPos < sourceText.Length)
                {
                    char value = sourceText[cursorPos];
                    if ("aeiouAEIOU".Contains(value))
                    {
                        return true;
                    }
                    if ("bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ".Contains(value))
                    {
                        return false;
                    }
                    cursorPos++;
                }
                return false;
            }
    
            // Token: 0x06000077 RID: 119 RVA: 0x000039F8 File Offset: 0x00001BF8
            private bool HandleIrregularNouns(string text, out string resultPlural)
            {
                resultPlural = null;
                char.IsLower(text[text.Length - 1]);
                string key = text.ToLower();
                string text2;
                if (this.IrregularNouns.TryGetValue(key, out text2))
                {
                    if (text.All((char c) => char.IsUpper(c)))
                    {
                        resultPlural = text2.ToUpper();
                    }
                    else if (char.IsUpper(text[0]))
                    {
                        char[] array = text2.ToCharArray();
                        array[0] = char.ToUpper(array[0]);
                        resultPlural = new string(array);
                    }
                    else
                    {
                        resultPlural = text2.ToLower();
                    }
                    return true;
                }
                return false;
            }
    
            // Token: 0x06000078 RID: 120 RVA: 0x00003A9C File Offset: 0x00001C9C
            private bool Handle_ves_Suffix(string text, out string resultPlural)
            {
                resultPlural = null;
                bool flag = char.IsLower(text[text.Length - 1]);
                char c = char.ToLower(text[text.Length - 1]);
                char c2 = char.ToLower(text[text.Length - 2]);
                if (c2 != 'o' && "aeiouAEIOU".Contains(c2) && c == 'f')
                {
                    resultPlural = text.Remove(text.Length - 1);
                    resultPlural += (flag ? "ves" : "VES");
                    return true;
                }
                if (c2 == 'f' && "aeiouAEIOU".Contains(c))
                {
                    resultPlural = text.Remove(text.Length - 2, 2);
                    resultPlural += (flag ? "v" : "V");
                    resultPlural += (flag ? c : char.ToUpper(c)).ToString();
                    resultPlural += (flag ? "s" : "S");
                    return true;
                }
                if (c2 == 'l' && c == 'f')
                {
                    resultPlural = text.Remove(text.Length - 1);
                    resultPlural += (flag ? "ves" : "VES");
                    return true;
                }
                return false;
            }
    
            // Token: 0x06000079 RID: 121 RVA: 0x00003BD0 File Offset: 0x00001DD0
            private bool Handle_ies_Suffix(string text, out string resultPlural)
            {
                resultPlural = null;
                bool flag = char.IsLower(text[text.Length - 1]);
                char c = char.ToLower(text[text.Length - 1]);
                char value = char.ToLower(text[text.Length - 2]);
                if ("bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ".Contains(value) && c == 'y')
                {
                    resultPlural = text.Remove(text.Length - 1);
                    resultPlural += (flag ? "ies" : "IES");
                    return true;
                }
                return false;
            }
    
            // Token: 0x0600007A RID: 122 RVA: 0x00003C5C File Offset: 0x00001E5C
            private bool Handle_es_Suffix(string text, out string resultPlural)
            {
                resultPlural = null;
                bool flag = char.IsLower(text[text.Length - 1]);
                string text2 = text[text.Length - 1].ToString();
                string text3 = text[text.Length - 2].ToString();
                if (text2 == "z")
                {
                    resultPlural = text;
                    resultPlural += (flag ? "zes" : "ZES");
                    return true;
                }
                if (this.Sibilants.Contains(text2))
                {
                    resultPlural = text;
                    resultPlural += (flag ? "es" : "ES");
                    return true;
                }
                if (this.Sibilants.Contains(text3 + text2))
                {
                    resultPlural = text;
                    resultPlural += (flag ? "es" : "ES");
                    return true;
                }
                if ("bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ".Contains(text3) && text2 == "o")
                {
                    resultPlural = text;
                    resultPlural += (flag ? "es" : "ES");
                    return true;
                }
                if (text3 == "o" && text2 == "e")
                {
                    resultPlural = text;
                    resultPlural = resultPlural.Remove(resultPlural.Length - 1);
                    resultPlural += (flag ? "es" : "ES");
                    return true;
                }
                if (text3 == "i" && text2 == "s")
                {
                    resultPlural = text;
                    resultPlural = resultPlural.Remove(resultPlural.Length - 2);
                    resultPlural += (flag ? "es" : "ES");
                    return true;
                }
                return false;
            }
    
            // Token: 0x0600007B RID: 123 RVA: 0x00003E00 File Offset: 0x00002000
            private bool Handle_s_Suffix(string text, out string resultPlural)
            {
                resultPlural = null;
                bool flag = char.IsLower(text[text.Length - 1]);
                char c = char.ToLower(text[text.Length - 1]);
                char c2 = char.ToLower(text[text.Length - 2]);
                if ("bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ".Contains(c))
                {
                    resultPlural = text;
                    resultPlural += (flag ? "s" : "S");
                    return true;
                }
                if (c == 'e')
                {
                    resultPlural = text;
                    resultPlural += (flag ? "s" : "S");
                    return true;
                }
                if ("aeiouAEIOU".Contains(c2) && c == 'y')
                {
                    resultPlural = text;
                    resultPlural += (flag ? "s" : "S");
                    return true;
                }
                if (c2 == 'f' && c == 'f')
                {
                    resultPlural = text;
                    resultPlural += (flag ? "s" : "S");
                    return true;
                }
                if (c2 == 'o' && c == 'f')
                {
                    resultPlural = text;
                    resultPlural += (flag ? "s" : "S");
                    return true;
                }
                if ("aeiouAEIOU".Contains(c2) && c == 'o')
                {
                    resultPlural = text;
                    resultPlural += (flag ? "s" : "S");
                    return true;
                }
                return false;
            }
    
            // Token: 0x17000014 RID: 20
            // (get) Token: 0x0600007C RID: 124 RVA: 0x00003F45 File Offset: 0x00002145
            public override CultureInfo CultureInfoForLanguage
            {
                get
                {
                    return CultureInfo.InvariantCulture;
                }
            }
    
            // Token: 0x04000035 RID: 53
            private Dictionary<string, string> IrregularNouns = new Dictionary<string, string>
            {
                {
                    "man",
                    "men"
                },
                {
                    "footman",
                    "footmen"
                },
                {
                    "crossbowman",
                    "crossbowmen"
                },
                {
                    "pikeman",
                    "pikemen"
                },
                {
                    "shieldman",
                    "shieldmen"
                },
                {
                    "shieldsman",
                    "shieldsmen"
                },
                {
                    "woman",
                    "women"
                },
                {
                    "child",
                    "children"
                },
                {
                    "mouse",
                    "mice"
                },
                {
                    "louse",
                    "lice"
                },
                {
                    "tooth",
                    "teeth"
                },
                {
                    "goose",
                    "geese"
                },
                {
                    "foot",
                    "feet"
                },
                {
                    "ox",
                    "oxen"
                },
                {
                    "sheep",
                    "sheep"
                },
                {
                    "fish",
                    "fish"
                },
                {
                    "species",
                    "species"
                },
                {
                    "aircraft",
                    "aircraft"
                },
                {
                    "news",
                    "news"
                },
                {
                    "advice",
                    "advice"
                },
                {
                    "information",
                    "information"
                },
                {
                    "luggage",
                    "luggage"
                },
                {
                    "athletics",
                    "athletics"
                },
                {
                    "linguistics",
                    "linguistics"
                },
                {
                    "curriculum",
                    "curricula"
                },
                {
                    "analysis",
                    "analyses"
                },
                {
                    "ellipsis",
                    "ellipses"
                },
                {
                    "bison",
                    "bison"
                },
                {
                    "corpus",
                    "corpora"
                },
                {
                    "crisis",
                    "crises"
                },
                {
                    "criterion",
                    "criteria"
                },
                {
                    "die",
                    "dice"
                },
                {
                    "graffito",
                    "graffiti"
                },
                {
                    "cactus",
                    "cacti"
                },
                {
                    "focus",
                    "foci"
                },
                {
                    "fungus",
                    "fungi"
                },
                {
                    "headquarters",
                    "headquarters"
                },
                {
                    "trousers",
                    "trousers"
                },
                {
                    "cattle",
                    "cattle"
                },
                {
                    "scissors",
                    "scissors"
                },
                {
                    "index",
                    "indices"
                },
                {
                    "vertex",
                    "vertices"
                },
                {
                    "matrix",
                    "matrices"
                },
                {
                    "radius",
                    "radii"
                },
                {
                    "photo",
                    "photos"
                },
                {
                    "piano",
                    "pianos"
                },
                {
                    "dwarf",
                    "dwarves"
                },
                {
                    "wharf",
                    "wharves"
                },
                {
                    "formula",
                    "formulae"
                },
                {
                    "moose",
                    "moose"
                },
                {
                    "phenomenon",
                    "phenomena"
                }
            };
    
            // Token: 0x04000036 RID: 54
            private string[] Sibilants = new string[]
            {
                "s",
                "x",
                "ch",
                "sh",
                "es",
                "ss"
            };
    
            // Token: 0x04000037 RID: 55
            private const string Vowels = "aeiouAEIOU";
    
            // Token: 0x04000038 RID: 56
            private const string Consonants = "bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ";
        }
    }

    C#:
    using System;
    using System.Globalization;
    using System.Linq;
    using System.Text;
    
    namespace TaleWorlds.Localization.TextProcessor
    {
        // Token: 0x02000027 RID: 39
        public class TurkishTextProcessor : LanguageSpecificTextProcessor
        {
            // Token: 0x060000E0 RID: 224 RVA: 0x00005EE0 File Offset: 0x000040E0
            private bool IsVowel(char c)
            {
                return TurkishTextProcessor.Vowels.Contains(c);
            }
    
            // Token: 0x060000E1 RID: 225 RVA: 0x00005EED File Offset: 0x000040ED
            private bool IsBackVowel(char c)
            {
                return TurkishTextProcessor.BackVowels.Contains(c);
            }
    
            // Token: 0x060000E2 RID: 226 RVA: 0x00005EFA File Offset: 0x000040FA
            private bool IsFrontVowel(char c)
            {
                return TurkishTextProcessor.FrontVowels.Contains(c);
            }
    
            // Token: 0x060000E3 RID: 227 RVA: 0x00005F07 File Offset: 0x00004107
            private bool IsClosedVowel(char c)
            {
                return TurkishTextProcessor.ClosedVowels.Contains(c);
            }
    
            // Token: 0x060000E4 RID: 228 RVA: 0x00005F14 File Offset: 0x00004114
            private bool IsConsonant(char c)
            {
                return TurkishTextProcessor.Consonants.Contains(c);
            }
    
            // Token: 0x060000E5 RID: 229 RVA: 0x00005F21 File Offset: 0x00004121
            private bool IsUnvoicedConsonant(char c)
            {
                return TurkishTextProcessor.UnvoicedConsonants.Contains(c);
            }
    
            // Token: 0x060000E6 RID: 230 RVA: 0x00005F2E File Offset: 0x0000412E
            private bool IsHardUnvoicedConsonant(char c)
            {
                return TurkishTextProcessor.HardUnvoicedConsonants.Contains(c);
            }
    
            // Token: 0x060000E7 RID: 231 RVA: 0x00005F3B File Offset: 0x0000413B
            private char FrontVowelToBackVowel(char c)
            {
                if (c == 'e')
                {
                    return 'a';
                }
                if (c == 'i')
                {
                    return 'ı';
                }
                if (c == 'ö')
                {
                    return 'o';
                }
                if (c != 'ü')
                {
                    return '*';
                }
                return 'u';
            }
    
            // Token: 0x060000E8 RID: 232 RVA: 0x00005F68 File Offset: 0x00004168
            private char OpenVowelToClosedVowel(char c)
            {
                if (c == 'a')
                {
                    return 'ı';
                }
                if (c == 'e')
                {
                    return 'i';
                }
                if (c == 'o')
                {
                    return 'u';
                }
                if (c != 'ö')
                {
                    return '*';
                }
                return 'ü';
            }
    
            // Token: 0x060000E9 RID: 233 RVA: 0x00005F95 File Offset: 0x00004195
            private char HardConsonantToSoftConsonant(char c)
            {
                if (c == 'p')
                {
                    return 'b';
                }
                if (c == 'ç')
                {
                    return 'c';
                }
                if (c == 't')
                {
                    return 'd';
                }
                if (c != 'k')
                {
                    return '*';
                }
                return 'ğ';
            }
    
            // Token: 0x060000EA RID: 234 RVA: 0x00005FC0 File Offset: 0x000041C0
            private char GetLastVowel(StringBuilder outputText)
            {
                for (int i = outputText.Length - 1; i >= 0; i--)
                {
                    if (this.IsVowel(outputText[i]))
                    {
                        return outputText[i];
                    }
                }
                return '*';
            }
    
            // Token: 0x060000EB RID: 235 RVA: 0x00005FFC File Offset: 0x000041FC
            public override void ProcessToken(string sourceText, ref int cursorPos, string token, StringBuilder outputString)
            {
                if (token == ".im")
                {
                    this.AddSuffix_im(outputString);
                    return;
                }
                if (token == ".sin")
                {
                    this.AddSuffix_sin(outputString);
                    return;
                }
                if (token == ".dir")
                {
                    this.AddSuffix_dir(outputString);
                    return;
                }
                if (token == ".iz")
                {
                    this.AddSuffix_iz(outputString);
                    return;
                }
                if (token == ".siniz")
                {
                    this.AddSuffix_siniz(outputString);
                    return;
                }
                if (token == ".dirler")
                {
                    this.AddSuffix_dirler(outputString);
                    return;
                }
                if (token == ".i")
                {
                    this.AddSuffix_i(outputString);
                    return;
                }
                if (token == ".e")
                {
                    this.AddSuffix_e(outputString);
                    return;
                }
                if (token == ".de")
                {
                    this.AddSuffix_de(outputString);
                    return;
                }
                if (token == ".den")
                {
                    this.AddSuffix_den(outputString);
                    return;
                }
                if (token == ".nin")
                {
                    this.AddSuffix_nin(outputString);
                    return;
                }
                if (token == ".ler")
                {
                    this.AddSuffix_ler(outputString);
                    return;
                }
                if (token == ".m")
                {
                    this.AddSuffix_m(outputString);
                    return;
                }
                if (token == ".n")
                {
                    this.AddSuffix_n(outputString);
                    return;
                }
                if (token == ".si")
                {
                    this.AddSuffix_si(outputString);
                    return;
                }
                if (token == ".miz")
                {
                    this.AddSuffix_miz(outputString);
                    return;
                }
                if (token == ".niz")
                {
                    this.AddSuffix_niz(outputString);
                    return;
                }
                if (token == ".leri")
                {
                    this.AddSuffix_leri(outputString);
                }
            }
    
            // Token: 0x060000EC RID: 236 RVA: 0x00006194 File Offset: 0x00004394
            private void AddSuffix_im(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                this.SoftenLastCharacter(outputString);
                this.AddYIfNeeded(outputString);
                outputString.Append(value);
                outputString.Append('m');
            }
    
            // Token: 0x060000ED RID: 237 RVA: 0x000061DC File Offset: 0x000043DC
            private void AddSuffix_sin(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                outputString.Append('s');
                outputString.Append(value);
                outputString.Append('n');
            }
    
            // Token: 0x060000EE RID: 238 RVA: 0x00006220 File Offset: 0x00004420
            private void AddSuffix_dir(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                char harmonizedD = this.GetHarmonizedD(outputString);
                outputString.Append(harmonizedD);
                outputString.Append(value);
                outputString.Append('r');
            }
    
            // Token: 0x060000EF RID: 239 RVA: 0x0000626C File Offset: 0x0000446C
            private void AddSuffix_iz(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                this.SoftenLastCharacter(outputString);
                this.AddYIfNeeded(outputString);
                outputString.Append(value);
                outputString.Append('z');
            }
    
            // Token: 0x060000F0 RID: 240 RVA: 0x000062B4 File Offset: 0x000044B4
            private void AddSuffix_siniz(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                outputString.Append('s');
                outputString.Append(value);
                outputString.Append('n');
                outputString.Append(value);
                outputString.Append('z');
            }
    
            // Token: 0x060000F1 RID: 241 RVA: 0x00006308 File Offset: 0x00004508
            private void AddSuffix_dirler(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                char value2 = this.IsBackVowel(lastVowel) ? 'a' : 'e';
                char harmonizedD = this.GetHarmonizedD(outputString);
                outputString.Append(harmonizedD);
                outputString.Append(value);
                outputString.Append('r');
                outputString.Append('l');
                outputString.Append(value2);
                outputString.Append('r');
            }
    
            // Token: 0x060000F2 RID: 242 RVA: 0x0000637C File Offset: 0x0000457C
            private void AddSuffix_i(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                this.SoftenLastCharacter(outputString);
                this.AddYIfNeeded(outputString);
                outputString.Append(value);
            }
    
            // Token: 0x060000F3 RID: 243 RVA: 0x000063BC File Offset: 0x000045BC
            private void AddSuffix_e(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsBackVowel(lastVowel) ? 'a' : 'e';
                this.SoftenLastCharacter(outputString);
                this.AddYIfNeeded(outputString);
                outputString.Append(value);
            }
    
            // Token: 0x060000F4 RID: 244 RVA: 0x000063F8 File Offset: 0x000045F8
            private void AddSuffix_de(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsBackVowel(lastVowel) ? 'a' : 'e';
                char harmonizedD = this.GetHarmonizedD(outputString);
                outputString.Append(harmonizedD);
                outputString.Append(value);
            }
    
            // Token: 0x060000F5 RID: 245 RVA: 0x00006438 File Offset: 0x00004638
            private void AddSuffix_den(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsBackVowel(lastVowel) ? 'a' : 'e';
                char harmonizedD = this.GetHarmonizedD(outputString);
                outputString.Append(harmonizedD);
                outputString.Append(value);
                outputString.Append('n');
            }
    
            // Token: 0x060000F6 RID: 246 RVA: 0x00006480 File Offset: 0x00004680
            private void AddSuffix_nin(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                char lastCharacter = this.GetLastCharacter(outputString);
                this.SoftenLastCharacter(outputString);
                if (this.IsVowel(lastCharacter))
                {
                    outputString.Append('n');
                }
                outputString.Append(value);
                outputString.Append('n');
            }
    
            // Token: 0x060000F7 RID: 247 RVA: 0x000064DC File Offset: 0x000046DC
            private void AddSuffix_ler(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsBackVowel(lastVowel) ? 'a' : 'e';
                outputString.Append('l');
                outputString.Append(value);
                outputString.Append('r');
            }
    
            // Token: 0x060000F8 RID: 248 RVA: 0x0000651C File Offset: 0x0000471C
            private void AddSuffix_m(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                char lastCharacter = this.GetLastCharacter(outputString);
                this.SoftenLastCharacter(outputString);
                if (this.IsConsonant(lastCharacter))
                {
                    outputString.Append(value);
                }
                outputString.Append('m');
            }
    
            // Token: 0x060000F9 RID: 249 RVA: 0x00006570 File Offset: 0x00004770
            private void AddSuffix_n(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                char lastCharacter = this.GetLastCharacter(outputString);
                this.SoftenLastCharacter(outputString);
                if (this.IsConsonant(lastCharacter))
                {
                    outputString.Append(value);
                }
                outputString.Append('n');
            }
    
            // Token: 0x060000FA RID: 250 RVA: 0x000065C4 File Offset: 0x000047C4
            private void AddSuffix_si(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                char lastCharacter = this.GetLastCharacter(outputString);
                this.SoftenLastCharacter(outputString);
                if (this.IsVowel(lastCharacter))
                {
                    outputString.Append('s');
                }
                outputString.Append(value);
            }
    
            // Token: 0x060000FB RID: 251 RVA: 0x00006618 File Offset: 0x00004818
            private void AddSuffix_miz(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                char lastCharacter = this.GetLastCharacter(outputString);
                this.SoftenLastCharacter(outputString);
                if (this.IsConsonant(lastCharacter))
                {
                    outputString.Append(value);
                }
                outputString.Append('m');
                outputString.Append(value);
                outputString.Append('z');
            }
    
            // Token: 0x060000FC RID: 252 RVA: 0x0000667C File Offset: 0x0000487C
            private void AddSuffix_niz(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsClosedVowel(lastVowel) ? lastVowel : this.OpenVowelToClosedVowel(lastVowel);
                char lastCharacter = this.GetLastCharacter(outputString);
                this.SoftenLastCharacter(outputString);
                if (this.IsConsonant(lastCharacter))
                {
                    outputString.Append(value);
                }
                outputString.Append('n');
                outputString.Append(value);
                outputString.Append('z');
            }
    
            // Token: 0x060000FD RID: 253 RVA: 0x000066E0 File Offset: 0x000048E0
            private void AddSuffix_leri(StringBuilder outputString)
            {
                char lastVowel = this.GetLastVowel(outputString);
                char value = this.IsBackVowel(lastVowel) ? 'a' : 'e';
                char value2 = this.IsBackVowel(lastVowel) ? 'ı' : 'i';
                outputString.Append('l');
                outputString.Append(value);
                outputString.Append('r');
                outputString.Append(value2);
            }
    
            // Token: 0x060000FE RID: 254 RVA: 0x0000673C File Offset: 0x0000493C
            private char GetHarmonizedD(StringBuilder outputString)
            {
                char c = this.GetLastCharacter(outputString);
                if (c == '\'')
                {
                    c = this.GetSecondLastCharacter(outputString);
                }
                if (!this.IsUnvoicedConsonant(c))
                {
                    return 'd';
                }
                return 't';
            }
    
            // Token: 0x060000FF RID: 255 RVA: 0x0000676C File Offset: 0x0000496C
            private void AddYIfNeeded(StringBuilder outputString)
            {
                char lastCharacter = this.GetLastCharacter(outputString);
                if (this.IsVowel(lastCharacter) || (lastCharacter == '\'' && this.IsVowel(this.GetSecondLastCharacter(outputString))))
                {
                    outputString.Append('y');
                }
            }
    
            // Token: 0x06000100 RID: 256 RVA: 0x000067A8 File Offset: 0x000049A8
            private void SoftenLastCharacter(StringBuilder outputString)
            {
                char lastCharacter = this.GetLastCharacter(outputString);
                if (this.IsHardUnvoicedConsonant(lastCharacter) && !this.LastWordNonMutating(outputString))
                {
                    outputString[outputString.Length - 1] = this.HardConsonantToSoftConsonant(lastCharacter);
                }
            }
    
            // Token: 0x06000101 RID: 257 RVA: 0x000067E4 File Offset: 0x000049E4
            private bool LastWordNonMutating(StringBuilder outputString)
            {
                int num = -1;
                int num2 = outputString.Length - 1;
                while (num2 >= 0 && num < 0)
                {
                    if (outputString[num2] == ' ')
                    {
                        num = num2;
                    }
                    num2--;
                }
                if (num < outputString.Length - 1)
                {
                    string text = outputString.ToString(num + 1, outputString.Length - num - 1);
                    return TurkishTextProcessor.NonMutatingWord.Contains(text.ToLower(this.CultureInfoForLanguage));
                }
                return false;
            }
    
            // Token: 0x06000102 RID: 258 RVA: 0x0000684E File Offset: 0x00004A4E
            private char GetLastCharacter(StringBuilder outputString)
            {
                if (outputString.Length <= 0)
                {
                    return '*';
                }
                return outputString[outputString.Length - 1];
            }
    
            // Token: 0x06000103 RID: 259 RVA: 0x0000686A File Offset: 0x00004A6A
            private char GetSecondLastCharacter(StringBuilder outputString)
            {
                if (outputString.Length <= 1)
                {
                    return '*';
                }
                return outputString[outputString.Length - 2];
            }
    
            // Token: 0x17000021 RID: 33
            // (get) Token: 0x06000104 RID: 260 RVA: 0x00006886 File Offset: 0x00004A86
            public override CultureInfo CultureInfoForLanguage
            {
                get
                {
                    return TurkishTextProcessor._cultureInfo;
                }
            }
    
            // Token: 0x04000085 RID: 133
            private static CultureInfo _curCultureInfo = CultureInfo.InvariantCulture;
    
            // Token: 0x04000086 RID: 134
            private static char[] Vowels = new char[]
            {
                'a',
                'ı',
                'o',
                'u',
                'e',
                'i',
                'ö',
                'ü'
            };
    
            // Token: 0x04000087 RID: 135
            private static char[] BackVowels = new char[]
            {
                'a',
                'ı',
                'o',
                'u'
            };
    
            // Token: 0x04000088 RID: 136
            private static char[] FrontVowels = new char[]
            {
                'e',
                'i',
                'ö',
                'ü'
            };
    
            // Token: 0x04000089 RID: 137
            private static char[] OpenVowels = new char[]
            {
                'a',
                'e',
                'o',
                'ö'
            };
    
            // Token: 0x0400008A RID: 138
            private static char[] ClosedVowels = new char[]
            {
                'ı',
                'i',
                'u',
                'ü'
            };
    
            // Token: 0x0400008B RID: 139
            private static char[] Consonants = new char[]
            {
                'b',
                'c',
                'ç',
                'd',
                'f',
                'g',
                'ğ',
                'h',
                'j',
                'k',
                'l',
                'm',
                'n',
                'p',
                'r',
                's',
                'ş',
                't',
                'v',
                'y',
                'z'
            };
    
            // Token: 0x0400008C RID: 140
            private static char[] UnvoicedConsonants = new char[]
            {
                'ç',
                'f',
                'h',
                'k',
                'p',
                's',
                'ş',
                't'
            };
    
            // Token: 0x0400008D RID: 141
            private static char[] HardUnvoicedConsonants = new char[]
            {
                'p',
                'ç',
                't',
                'k'
            };
    
            // Token: 0x0400008E RID: 142
            private static string[] NonMutatingWord = new string[]
            {
                "ak",
                "at",
                "ek",
                "et",
                "göç",
                "ip",
                "çöp",
                "ok",
                "ot",
                "saç",
                "sap",
                "süt",
                "üç",
                "suç",
                "top"
            };
    
            // Token: 0x0400008F RID: 143
            private static CultureInfo _cultureInfo = new CultureInfo("tr-TR");
        }
    }
  4. Sorrow0

    BL Coding How to override MBTextManager for custom TextProcessor

    Hi everyone, I have a question, I want to translate this game but I have a problem. In my native language, the TextProcessor doesn't exist. I have decompiled TaleWorlds.Localization to see how it works and I see two localized text processors. One for English (EnglishTextProcessor.cs) and one...
Top Bottom