DiNaSoR Posted September 10, 2024 Share Posted September 10, 2024 Hello ONI modding community, I'm working on a mod to add proper Arabic support to Oxygen Not Included, but I'm running into some issues. I'm hoping someone with more experience in ONI modding or Arabic language support can help out. Current Approach: I'm trying to patch the Localization.GetLocalized method to reverse the Arabic text for proper display. Here's the relevant part of my code: [HarmonyPatch(typeof(Localization), "GetLocalized", new Type[] { typeof(string), typeof(string[]) })] public class LocalizationGetLocalizedPatch { public static void Postfix(ref string __result) { if (!string.IsNullOrEmpty(__result)) { __result = TextUtils.ReverseArabicText(__result); } } } Issues: 1. The patch doesn't seem to be applying correctly. I'm getting an error: "Undefined target method for patch method static System.Void ONITextReversalMod.LocalizationGetLocalizedPatch::Postfix(System.String& __result)" 2. Even when I've managed to get the patch to apply in previous attempts, I'm only getting the original (English) strings, not the translated Arabic ones. Questions: 1. Is there a better way to intercept the translated strings before they're displayed? 2. I've noticed there's an ArabicSupport.dll file in the game. Is there a way to leverage this for proper Arabic display instead of manually reversing the text? 3. Does anyone have experience with adding right-to-left language support to ONI that they could share? Any help or guidance would be greatly appreciated. If you need any more information about my mod or setup, please let me know. Thank you in advance for your help! PS: Here's what I've tried: Harmony Patching: I've been trying to use Harmony to patch the Localization.GetLocalized method to reverse the translated Arabic strings. However, I've encountered issues finding the correct method signature and consistently patching it. The game seems to be throwing HarmonyLib.HarmonyException errors, suggesting that my patching is not targeting the right method or that the method signature might be different in my game version. ArabicSupport.dll: I've noticed there's an ArabicSupport.dll file in the game files. Could this be helpful for proper Arabic support? I'm unsure how to leverage this DLL in my mod. More Questions: Harmony Patching: Is there a reliable way to patch Localization.GetLocalized and ensure it captures the translated string for reversal? I've experimented with various method signatures and targeting techniques, but the patching still seems unreliable. ArabicSupport.dll: Can the ArabicSupport.dll be used to enable proper RTL text rendering and reshaping? If so, how can I integrate it into my mod? Alternative Approaches: Are there any alternative methods for achieving correct Arabic text display (RTL and reshaping) in ONI? Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/ Share on other sites More sharing options...
SGT_Imalas Posted September 10, 2024 Share Posted September 10, 2024 Localization.GetLocalized does not exist (which is also what that error is telling you) Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1747018 Share on other sites More sharing options...
DiNaSoR Posted September 13, 2024 Author Share Posted September 13, 2024 No way to get Localization string without getting original string ? Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1747590 Share on other sites More sharing options...
SGT_Imalas Posted September 13, 2024 Share Posted September 13, 2024 text reversal for arabic is already part of the game. refer to the official guide on how to properly make translation mods (the localization code is "ar"): there is also already an existing arabic translation: https://steamcommunity.com/sharedfiles/filedetails/?id=2922482730 Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1747593 Share on other sites More sharing options...
DiNaSoR Posted September 14, 2024 Author Share Posted September 14, 2024 That my mod https://steamcommunity.com/sharedfiles/filedetails/?id=2922482730 I am facing the issue of not displaying the correct way and i need to update it. Thank you for pointing me to ar function that was helpful thanks Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1748180 Share on other sites More sharing options...
DiNaSoR Posted September 14, 2024 Author Share Posted September 14, 2024 I am facing a problem using ar in .po all that related to ArabicSupport.dll file need adjustment please its reverse the numbers and flowrate strings like kg/s become s/gk and number 2000 w become w 0002 any fix for that please ? can you make a hot fix to not reverse anything between {} {CurrentLoadAndColor} {MaxLoad} {ElementTypes}: {FlowRate} Thanks Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1748209 Share on other sites More sharing options...
SGT_Imalas Posted September 16, 2024 Share Posted September 16, 2024 On 9/15/2024 at 12:21 AM, DiNaSoR said: can you make a hot fix to not reverse anything between {} I dont think that would be possible, since he ReverseText function inside Localization is called on the final text, not the pre-filled one. if anything, you'd need to prefix skip that method and write your own function for it that automatically detects formulas and skips them during the reversal process. (but ideally, Klei would implement a fix for that) Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1748574 Share on other sites More sharing options...
SGT_Imalas Posted September 16, 2024 Share Posted September 16, 2024 public static class Localization_ReverseText_Patch { [HarmonyPatch(typeof(Localization), "ReverseText")] public static class Localization_ReverseText_Patch { /// <summary> /// skips the original ReverseText method and uses the conditional one below that excludes numbers /// </summary> /// <param name="text"></param> /// <returns></returns> public static bool Prefix(string text, ref string __result) { __result = ReverseTextConditional(text); return false; } } /// <summary> /// This regex detects numbers with formulaic values attached to them. /// adjust/add to the "(kg\\/s|kg|w|lux|rads)" part for any values I forgot/that are translated so it can properly detect them /// add them inside the brackets and insert a "|" between them. /// the detection automatically casts to lower case, so no need to add an upper case variant. /// any numbers detected by this are excluded by the reverse function. /// </summary> static Regex NumberDetection = new("(\\d+((\\.|,)?\\d+)?\\s?(kg\\/s|kg|w|lux|rads)?)"); static HashSet<int> indicesToIgnore = new HashSet<int>(256); static StringBuilder sb = null; public static string ReverseTextConditional(string source) { ///instantiate single instance of stringbuilder if not already existent, this is a lot more performant than string concatination if (sb == null) sb = new StringBuilder(); ///clean up previous run else sb.Clear(); ///split source text by linebreak (each line is handled separatly) string[] lines = source.Split('\n'); for(int lineIndex = 0; lineIndex < lines.Length; lineIndex++) { string line = lines[lineIndex]; ///cast to lower case for detection string detectionString = line.ToLowervariant(); MatchCollection? foundNumbers = NumberDetection.Matches(detectionString); ///no matches -> normal reversal if (foundNumbers == null || foundNumbers.Count == 0) { foreach(char c in line.Reverse()) sb.Append(c); } else { indicesToIgnore.Clear(); int regexHitsCount = foundNumbers.Count; ///grep all char indices that are the detected numbers occupy for (int i = 0; i < regexHitsCount; i++) { Match? match = foundNumbers[i]; ///we are iterating from the back to the front, so the first index to hit is the last letter of the number entry indicesToIgnore.Add(match.Index+(match.Length-1)); //Console.WriteLine(match.ToString()+" "+ match.Index+"->"+(match.Index+match.Length-1)); } ///reusing that variable as regex index regexHitsCount--; ///iterate all chars in the line from back to front for (int i = line.Length-1 ; i >= 0; i--) { //Console.WriteLine(i+": "+ line[i]); if (indicesToIgnore.Contains(i) && regexHitsCount >= 0) { Match? match = foundNumbers[regexHitsCount]; regexHitsCount--; sb.Append(line.Substring(match.Index, match.Length)); i = match.Index; } else sb.Append(line[i]); } } ///Linebreak after each line except the last one if (lineIndex < lines.Length - 1) sb.AppendLine(); } return sb.ToString(); } } I tested this with english text and it properly excluded numbers + unit attached to them. adjust that part of the regex if the units are translated and/or if I forgot some: (kg\\/s|kg|w|lux|rads) I used https://regex101.com/r/sS2dM8/207 for creating that regex Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1748584 Share on other sites More sharing options...
DiNaSoR Posted September 16, 2024 Author Share Posted September 16, 2024 I tried it did not work, Thanks tho you can see [1] become ]1[ and watts reversed. here is the code using HarmonyLib; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Text; public static class Localization_ReverseText_Patch { [HarmonyPatch(typeof(Localization), "ReverseText")] public static class ReverseTextPatch { /// <summary> /// Skips the original ReverseText method and uses the conditional one below that excludes numbers. /// </summary> /// <param name="source"></param> /// <returns></returns> public static bool Prefix(string source, ref string __result) { __result = ReverseTextConditional(source); return false; } } /// <summary> /// This regex detects numbers with formulaic values attached to them. /// Adjust/add to the "(kg\\/s|kg|w|lux|rads)" part for any values I forgot/that are translated so it can properly detect them. /// </summary> static Regex NumberDetection = new("(\\d+((\\.|,)?\\d+)?\\s?(kg\\/s|kg|w|lux|rads)?)"); static HashSet<int> indicesToIgnore = new HashSet<int>(256); static StringBuilder sb = null; public static string ReverseTextConditional(string source) { Debug.Log("Source before processing: " + source); if (sb == null) sb = new StringBuilder(); else sb.Clear(); string[] lines = source.Split('\n'); for (int lineIndex = 0; lineIndex < lines.Length; lineIndex++) { string line = lines[lineIndex]; Debug.Log("Processing line: " + line); string detectionString = line.ToLowerInvariant(); MatchCollection foundNumbers = NumberDetection.Matches(detectionString); if (foundNumbers == null || foundNumbers.Count == 0) { foreach (char c in line.Reverse()) sb.Append(c); } else { indicesToIgnore.Clear(); int regexHitsCount = foundNumbers.Count; for (int i = 0; i < regexHitsCount; i++) { Match match = foundNumbers[i]; indicesToIgnore.Add(match.Index + (match.Length - 1)); } regexHitsCount--; for (int i = line.Length - 1; i >= 0; i--) { if (indicesToIgnore.Contains(i) && regexHitsCount >= 0) { Match match = foundNumbers[regexHitsCount]; regexHitsCount--; sb.Append(line.Substring(match.Index, match.Length)); i = match.Index; } else sb.Append(line[i]); } } if (lineIndex < lines.Length - 1) sb.AppendLine(); } string result = sb.ToString(); Debug.Log("Final reversed string: " + result); return result; } } and this solution as well using HarmonyLib; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Text.RegularExpressions; using UnityEngine; public static class Localization_ReverseText_Patch { [HarmonyPatch(typeof(Localization), "ReverseText")] public static class ReverseTextPatch { /// <summary> /// Skips the original ReverseText method and uses the conditional one below that excludes numbers. /// </summary> public static bool Prefix(string source, ref string __result) { __result = ReverseTextConditional(source); return false; } } // Regular expression to detect numbers with optional units. static Regex NumberDetection = new Regex(@"(\d+[\d\.,\s]*(?:kg\/s|kg|w|lux|rads|ºC|°C|%|C|germs)?)", RegexOptions.Compiled); // Regular expression to detect brackets and special characters. static Regex BracketDetection = new Regex(@"[\[\]\(\)\{\}]"); // StringBuilder for efficient string manipulation. static StringBuilder sb = new StringBuilder(); public static string ReverseTextConditional(string source) { Debug.Log("Source before processing: " + source); sb.Clear(); // Split the source into lines. string[] lines = source.Split('\n'); for (int lineIndex = 0; lineIndex < lines.Length; lineIndex++) { string line = lines[lineIndex]; Debug.Log("Processing line: " + line); // Process each line. string processedLine = ProcessLine(line); sb.Append(processedLine); if (lineIndex < lines.Length - 1) sb.Append('\n'); } string result = sb.ToString(); Debug.Log("Final reversed string: " + result); return result; } private static string ProcessLine(string line) { // Find all numbers in the line. MatchCollection numberMatches = NumberDetection.Matches(line); // Store the positions of numbers to skip during reversal. List<(int start, int length)> numberSpans = new List<(int, int)>(); foreach (Match match in numberMatches) { numberSpans.Add((match.Index, match.Length)); } // Reverse the line while skipping numbers. StringBuilder lineBuilder = new StringBuilder(); int lineLength = line.Length; int index = 0; while (index < lineLength) { // Check if current index is at the start of a number span. var numberSpan = numberSpans.FirstOrDefault(span => span.start == index); if (numberSpan != default) { // Append the number as is. string numberText = line.Substring(numberSpan.start, numberSpan.length); numberText = ConvertEasternToWesternDigits(numberText); // Apply bidirectional marks to ensure correct display. lineBuilder.Append('\u202A'); // LRE lineBuilder.Append(numberText); lineBuilder.Append('\u202C'); // PDF index += numberSpan.length; } else { // Collect characters until the next number or end of line. int nextNumberIndex = numberSpans.Where(span => span.start > index).Select(span => span.start).DefaultIfEmpty(lineLength).Min(); int length = nextNumberIndex - index; string textSegment = line.Substring(index, length); // Reverse the text segment and handle brackets. string reversedSegment = ReverseAndSwapBrackets(textSegment); lineBuilder.Append(reversedSegment); index += length; } } return lineBuilder.ToString(); } private static string ReverseAndSwapBrackets(string text) { // Map for swapping brackets. Dictionary<char, char> bracketMap = new Dictionary<char, char> { { '(', ')' }, { ')', '(' }, { '[', ']' }, { ']', '[' }, { '{', '}' }, { '}', '{' } }; // Reverse the text. char[] chars = text.ToCharArray(); Array.Reverse(chars); // Swap brackets. for (int i = 0; i < chars.Length; i++) { if (bracketMap.ContainsKey(chars[i])) { chars[i] = bracketMap[chars[i]]; } } return new string(chars); } // Convert Eastern Arabic numerals to Western numerals. public static string ConvertEasternToWesternDigits(string input) { // Use Unicode digit substitutions. return input .Replace('٠', '0') .Replace('١', '1') .Replace('٢', '2') .Replace('٣', '3') .Replace('٤', '4') .Replace('٥', '5') .Replace('٦', '6') .Replace('٧', '7') .Replace('٨', '8') .Replace('٩', '9'); } } I am so tired, I cant seems to fix it. I think the dev need to fix this, its simple if they can tell do not reverse anything inside {} such as {CurrentLoadAndColor} {MaxLoad} {ElementTypes}: {FlowRate} Here 2 mods if anyone or dev would like to test Arabic.rar ArabicTextFixMod.rar Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1748728 Share on other sites More sharing options...
SGT_Imalas Posted September 16, 2024 Share Posted September 16, 2024 1 hour ago, DiNaSoR said: I think the dev need to fix this, its simple if they can tell do not reverse anything inside {} such as that is straight up impossible. Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1748747 Share on other sites More sharing options...
SGT_Imalas Posted September 16, 2024 Share Posted September 16, 2024 public static class Localization_ReverseText_Patch { [HarmonyPatch(typeof(Localization), "ReverseText")] public static class Localization_ReverseText_Patch { /// <summary> /// skips the original ReverseText method and uses the conditional one below that excludes numbers /// </summary> /// <param name="text"></param> /// <returns></returns> public static bool Prefix(string text, ref string __result) { __result = ReverseTextConditional(text); return false; } } /// <summary> /// This regex detects numbers with formulaic values attached to them. /// adjust/add to the "(kg\\/s|kg|w|lux|rads)" part for any values I forgot/that are translated so it can properly detect them /// add them inside the brackets and insert a "|" between them. /// the detection automatically casts to lower case, so no need to add an upper case variant. /// any numbers detected by this are excluded by the reverse function. /// </summary> static Regex NumberDetection = new("(((\\[|\\(|\\{)*\\d+((\\.|,)?\\d+)?(\\]|\\)|\\})*(\\ ?(kg|w|lux|rads|ºC|°C|%|C|germs|\\s?\\/\\s?s|\\/s)+)?)|(\\s(\\/|\\\\))\\s)+", RegexOptions.Compiled); static HashSet<int> indicesToIgnore = new HashSet<int>(256); //only instantiate that once. Hashsets are faster than lists static StringBuilder sb = null; //only instantiate that once. static Dictionary<char, char> bracketMap = new Dictionary<char, char> //only instantiate that once. { { '(', ')' }, { ')', '(' }, { '[', ']' }, { ']', '[' }, { '{', '}' }, { '}', '{' } }; public static string ReverseTextConditional(string source) { ///instantiate single instance of stringbuilder if not already existent, this is a lot more performant than string concatination /// (do NOT make a new string builder for each instance of this method call.) /// also avoid any linQ if possible if (sb == null) sb = new StringBuilder(); ///clean up previous run else sb.Clear(); ///split source text by linebreak (each line is handled separatly) string[] lines = source.Split('\n'); for (int lineIndex = 0; lineIndex < lines.Length; lineIndex++) { string line = lines[lineIndex]; ///cast to lower case for detection string detectionString = line.ToLowerInvariant(); MatchCollection? foundNumbers = NumberDetection.Matches(detectionString); indicesToIgnore.Clear(); int regexHitsCount = 0; if (foundNumbers != null && foundNumbers.Count > 0) { regexHitsCount = foundNumbers.Count; ///grep all char indices that are the detected numbers occupy for (int i = 0; i < regexHitsCount; i++) { Match? match = foundNumbers[i]; ///we are iterating from the back to the front ///so the first index to hit is the last letter of the number entry indicesToIgnore.Add(match.Index + (match.Length - 1)); } } ///reusing that variable as regex index, if no hits were found, it is set to -1 and thus it skips the first check regexHitsCount--; ///iterate all chars in the line from back to front and append it to the line builder* ///if its a number line, dont reverse and move the iterator, replace all arabic numbers in the number line ///otherwise, if its a bracket, reverse the bracket, else simply append the char for (int i = line.Length - 1; i >= 0; i--) { char c = line[i]; if (regexHitsCount >= 0 && indicesToIgnore.Contains(i) && foundNumbers != null) //null check to make the compiler happy { Match? match = foundNumbers[regexHitsCount]; regexHitsCount--; string numberSpan = line.Substring(match.Index, match.Length); //sb.Append('\u202A'); // LRE for (int j = 0; j < numberSpan.Length; j++) //replace arabic numbers with western numbers { char numChar = numberSpan[j]; switch (numChar) { case '٠': sb.Append('0'); break; case '١': sb.Append('1'); break; case '٢': sb.Append('2'); break; case '٣': sb.Append('3'); break; case '٤': sb.Append('4'); break; case '٥': sb.Append('5'); break; case '٦': sb.Append('6'); break; case '٧': sb.Append('7'); break; case '٨': sb.Append('8'); break; case '٩': sb.Append('9'); break; default: sb.Append(numChar); break; //if not a number, attach it } } //sb.Append('\u202C'); // PDF i = match.Index; } //if current char is a bracket, reverse it else if (bracketMap.TryGetValue(c, out var replacementBracket)) { sb.Append(replacementBracket); } else { sb.Append(c); } } ///Linebreak after each line except the last one if (lineIndex < lines.Length - 1) sb.AppendLine(); } return sb.ToString(); } } I have updated the code and the Regex to account for fractions, arabic number conversion and brackets reversal. in my tests, these were working: (I left the LRE, PDF additions commented for my tests) Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1748755 Share on other sites More sharing options...
DiNaSoR Posted September 21, 2024 Author Share Posted September 21, 2024 using HarmonyLib; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; #nullable enable [HarmonyPatch(typeof(Localization), "ReverseText")] public static class Localization_ReverseText_Patch { /// <summary> /// Skips the original ReverseText method and uses the conditional one below that excludes numbers. /// </summary> public static bool Prefix(string source, ref string __result) { __result = ReverseTextConditional(source); return false; } /// <summary> /// This regex detects numbers with formulaic values attached to them. /// Adjust/add to the "(kg\\/s|kg|w|lux|rads)" part for any values I forgot/that are translated so it can properly detect them. /// Add them inside the brackets and insert a "|" between them. /// The detection automatically casts to lower case, so no need to add an upper case variant. /// Any numbers detected by this are excluded by the reverse function. /// </summary> static Regex NumberDetection = new Regex("(((\\[|\\(|\\{)*\\d+((\\.|,)?\\d+)?(\\]|\\)|\\})*(\\ ?(kg|w|lux|rads|ºC|°C|%|C|germs|\\s?\\/\\s?s|\\/s)+)?)|(\\s(\\/|\\\\))\\s)+", RegexOptions.Compiled); static HashSet<int> indicesToIgnore = new HashSet<int>(256); // Only instantiate that once. HashSets are faster than Lists. static StringBuilder sb = null; // Only instantiate that once. static Dictionary<char, char> bracketMap = new Dictionary<char, char> // Only instantiate that once. { { '(', ')' }, { ')', '(' }, { '[', ']' }, { ']', '[' }, { '{', '}' }, { '}', '{' } }; public static string ReverseTextConditional(string source) { // Instantiate single instance of StringBuilder if not already existent. if (sb == null) sb = new StringBuilder(); else sb.Clear(); // Split source text by linebreak (each line is handled separately). string[] lines = source.Split('\n'); for (int lineIndex = 0; lineIndex < lines.Length; lineIndex++) { string line = lines[lineIndex]; // Cast to lower case for detection. string detectionString = line.ToLowerInvariant(); MatchCollection? foundNumbers = NumberDetection.Matches(detectionString); indicesToIgnore.Clear(); int regexHitsCount = 0; if (foundNumbers != null && foundNumbers.Count > 0) { regexHitsCount = foundNumbers.Count; // Collect all character indices that the detected numbers occupy. for (int i = 0; i < regexHitsCount; i++) { Match? match = foundNumbers[i]; indicesToIgnore.Add(match.Index + (match.Length - 1)); } } // Decrement regexHitsCount to use as an index. regexHitsCount--; // Iterate all chars in the line from back to front and append it to the StringBuilder. for (int i = line.Length - 1; i >= 0; i--) { char c = line[i]; if (regexHitsCount >= 0 && indicesToIgnore.Contains(i) && foundNumbers != null) { Match? match = foundNumbers[regexHitsCount]; regexHitsCount--; string numberSpan = line.Substring(match.Index, match.Length); // Replace Arabic numbers with Western numbers. for (int j = 0; j < numberSpan.Length; j++) { char numChar = numberSpan[j]; switch (numChar) { case '٠': sb.Append('0'); break; case '١': sb.Append('1'); break; case '٢': sb.Append('2'); break; case '٣': sb.Append('3'); break; case '٤': sb.Append('4'); break; case '٥': sb.Append('5'); break; case '٦': sb.Append('6'); break; case '٧': sb.Append('7'); break; case '٨': sb.Append('8'); break; case '٩': sb.Append('9'); break; default: sb.Append(numChar); break; // If not a number, attach it. } } i = match.Index; } // If current char is a bracket, reverse it. else if (bracketMap.TryGetValue(c, out var replacementBracket)) { sb.Append(replacementBracket); } else { sb.Append(c); } } // Add a linebreak after each line except the last one. if (lineIndex < lines.Length - 1) sb.AppendLine(); } return sb.ToString(); } } didnot solve it , i tried many different ways nothing works Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1749937 Share on other sites More sharing options...
SGT_Imalas Posted September 23, 2024 Share Posted September 23, 2024 Does the patch get applied? Normal mods need to inherit abd implement UserMod2 to apply and run patches, but translation mods usually dont do that. Im not entirely sure if such a patched fix can be included directly in the actual translation mod, it might be necessary to make a "arabic translation fixer" mod that works like a regular mod, is activated in the mod menu in addition to the language mod and inherits usermod2 (I remember seeing such a mod for a different language) Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1750175 Share on other sites More sharing options...
DiNaSoR Posted September 27, 2024 Author Share Posted September 27, 2024 On 9/23/2024 at 4:03 AM, SGT_Imalas said: Does the patch get applied? Normal mods need to inherit abd implement UserMod2 to apply and run patches, but translation mods usually dont do that. Im not entirely sure if such a patched fix can be included directly in the actual translation mod, it might be necessary to make a "arabic translation fixer" mod that works like a regular mod, is activated in the mod menu in addition to the language mod and inherits usermod2 (I remember seeing such a mod for a different language) I did that from the start still not working Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1751028 Share on other sites More sharing options...
Aki Art Posted October 6, 2024 Share Posted October 6, 2024 if you are still having issues: did you try on mod load, adding a new locale preset to Localization.Locales, with direction RightToLeft as the default, matching your languages code. If a language is not added yet it otherwise defaults to LeftToRight. And none of this manual reversing stuff. Specifically Localization.SwapToLocalizedFont is where the magic happens, if that runs before mods are loaded you may need to reapply this method. nvm i realized that preset already exists. If it doesn't work this should be a bug report to Klei, as it should already be "properly" supported. Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1752057 Share on other sites More sharing options...
DiNaSoR Posted October 12, 2024 Author Share Posted October 12, 2024 On 10/6/2024 at 7:18 PM, Aki Art said: if you are still having issues: did you try on mod load, adding a new locale preset to Localization.Locales, with direction RightToLeft as the default, matching your languages code. If a language is not added yet it otherwise defaults to LeftToRight. And none of this manual reversing stuff. Specifically Localization.SwapToLocalizedFont is where the magic happens, if that runs before mods are loaded you may need to reapply this method. nvm i realized that preset already exists. If it doesn't work this should be a bug report to Klei, as it should already be "properly" supported. its a bug from Klei Link to comment https://forums.kleientertainment.com/forums/topic/159612-help-needed-reversing-arabic-translations-in-oxygen-not-included-mod/#findComment-1752700 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.