Tarferi / Starcraft-Translation-Tool

Easy map translation tool
2 stars 2 forks source link

I can't get this to build without errors. #5

Closed Psyda closed 7 months ago

Psyda commented 8 months ago

Even when I do it doesn't match the prebuilt exe. Its missing menu options and doesn't support Korean unicode characters.

Any idea whats up? https://i.imgur.com/25ZPG6T.png

Also it seems to be arbitrarily swapping newline (/r/n) into characters for imported translations. That would be okay, but it also does it for the "Original Translation" column which makes it impossible to edit maps that have a newline spacing out the text.

I'll provide an example map and translation:

KoreanMap_pretranslation

EnglishTranslation.xlsx

If you can successfully apply that translation as well I'd be very grateful. I created an Openai-Based translation tool for google sheets to help with more accurate translations that keep color codes intact. Example: https://i.imgur.com/LQCs8Y6.mp4

System.IndexOutOfRangeException: Index was outside the bounds of the array. at TranslatorData.TheLib.process(Settings settings, Int32 languageIndex) in C:\Users\travi\source\repos\Starcraft-Translation-Tool2\src\internal\TheLib.cs:line 260 at TranslatorUI.MainWindow.btnRun_Click(Object sender, RoutedEventArgs e) in C:\Users\travi\source\repos\Starcraft-Translation-Tool2\src\ui\MainWindow.xaml.cs:line 1202 at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Edit:

I was able to get it to build with the debugger disabled and the comparison between original and the translation disabled, still buggy, but actually was able to complete, but for some reason the color codes do not work. https://i.imgur.com/FaSZLwT.jpeg

Tarferi commented 7 months ago

Issue seems to be related to system encoding. Provided translation file contains korean characters. When I try to export translation from provided scx file I get unsupported characters. The UI after loading provided map shows unsupported characters. Newly created settings file favors UTF-8 encoding, which is probably why.

Switching default encoding to EUC-KR fixes encoding issue yet provided translation file fails to load err

This error comes from row 192 (string ID 308) of the excel spreadsheet. Original string cell contains both newlines and "<13>", which should have been replaced with newlines. When I tried exporting translation myself, it is indeed replaced with newlines.

While this is not necessarily a bug, I will release updated version which accepts combination of newlines and "<13>" that addresses this specific issues (and also an option for default encoding).

After getting translation fixed, processing indeed yields the exception that you mentioned. This is caused by settings not being updated when importing new translation. Intended workflow for working with export/import is not importing brand new external translation. It is rather process of making a copy of original translation, exporting it, translating externally and importing back, rewriting the exported version. This will also be fixed in the next update.

After resolving these issues, I was able to successfully translate your map. Please also check the updated version yourself. The_Collision_RPG_2.7.scx.zip

Regarding UI not looking the same as the official version, I honestly don't know. You can find me on Staredit Network discord server if you want to talk directly.

Tarferi commented 7 months ago

New version was just released.