Open QY-Dong opened 1 year ago
you are doing it completely wrong. copy paste the primer from a different game will not work at all.
you need to enable EnableTextPathLogging in your config, install the RuntimeUnityEditor plugin, start the game and now you need to check the log to find what primer used in the specific sentence to control the text. then you copy and save the path to the resizer and set the desired size.
you can also check here https://github.com/bbepis/XUnity.AutoTranslator/issues/366#issuecomment-1477144926
you are doing it completely wrong. copy paste the primer from a different game will not work at all.
you need to enable EnableTextPathLogging in your config, install the RuntimeUnityEditor plugin, start the game and now you need to check the log to find what primer used in the specific sentence to control the text. then you copy and save the path to the resizer and set the desired size.
you can also check here #366 (comment)
Thank you. I figured out how to check out the text path following your instruction. It worked well in the game The West of Loathing (I can see the path of each translated text in log file). However, in the other game, when I enable EnableTextPathLogging=True
, it only translates without showing the translated text in the game (there are still translations in the autotranslation file. and it will work again if I turn it into False). It's the same case for both bepinex and melonloader. so is there another way to know the path of those text?
Here's the error when I enable EnableTextPathLogging=True
[Error :XUnity.AutoTranslator] An error occurred while setting text on a component. System.ArgumentException: Expected object to be a GameObject or component. Parameter name: obj at XUnity.AutoTranslator.Plugin.Core.Extensions.ComponentExtensions.GetAssociatedGameObject (System.Object obj) [0x0001d] in <1a6ac5ec5b0a4c7096c6ff8454095a49>:0 at XUnity.AutoTranslator.Plugin.Core.Extensions.ComponentExtensions.GetPathSegments (System.Object obj) [0x00000] in <1a6ac5ec5b0a4c7096c6ff8454095a49>:0 at XUnity.AutoTranslator.Plugin.Core.Extensions.ComponentExtensions.GetPath (System.Object obj) [0x00006] in <1a6ac5ec5b0a4c7096c6ff8454095a49>:0 at XUnity.AutoTranslator.Plugin.Core.AutoTranslationPlugin.SetText (System.Object ui, System.String text, System.Boolean isTranslated, System.String originalText, XUnity.AutoTranslator.Plugin.Core.TextTranslationInfo info) [0x00033] in <1a6ac5ec5b0a4c7096c6ff8454095a49>:0
you are doing it completely wrong. copy paste the primer from a different game will not work at all.
you need to enable EnableTextPathLogging in your config, install the RuntimeUnityEditor plugin, start the game and now you need to check the log to find what primer used in the specific sentence to control the text. then you copy and save the path to the resizer and set the desired size.
you can also check here #366 (comment)
Hello. Can you have sample for this?
[Info :XUnity.AutoTranslator] Setting text on 'TMPro.TextMeshProUGUI' to '> Сервер' [Info :XUnity.AutoTranslator] Path : /Canvas/MenuContainer/MainButtons/HostButton/Text (TMP) [Info :XUnity.AutoTranslator] Level: 2 [Info :XUnity.AutoTranslator] Setting text on 'TMPro.TextMeshProUGUI' to '> Авторы' [Info :XUnity.AutoTranslator] Path : /Canvas/MenuContainer/MainButtons/Credits/Text (TMP) [Info :XUnity.AutoTranslator] Level: 2 [Info :XUnity.AutoTranslator] Setting text on 'TMPro.TextMeshProUGUI' to '> Настройки' [Info :XUnity.AutoTranslator] Path : /Canvas/MenuContainer/MainButtons/SettingsButton/Text (TMP) [Info :XUnity.AutoTranslator] Level: 2 [Info :XUnity.AutoTranslator] Setting text on 'TMPro.TextMeshProUGUI' to '> Подключиться' [Info :XUnity.AutoTranslator] Path : /Canvas/MenuContainer/MainButtons/JoinACrew/Text (TMP) [Info :XUnity.AutoTranslator] Level: 2 [Info :XUnity.AutoTranslator] Setting text on 'TMPro.TextMeshProUGUI' to '> Выход' [Info :XUnity.AutoTranslator] Path : /Canvas/MenuContainer/MainButtons/QuitButton/Text (TMP)
I create fileresizer.txt
and add
/Canvas/MenuContainer/MainButtons/HostButton/Text=ChangeFontSizeByPercentage(0.5)
but its not work(
you are doing it completely wrong. copy paste the primer from a different game will not work at all. you need to enable EnableTextPathLogging in your config, install the RuntimeUnityEditor plugin, start the game and now you need to check the log to find what primer used in the specific sentence to control the text. then you copy and save the path to the resizer and set the desired size. you can also check here #366 (comment)
Hello. Can you have sample for this?
[Info :XUnity.AutoTranslator] Setting text on 'TMPro.TextMeshProUGUI' to '> Сервер' [Info :XUnity.AutoTranslator] Path : /Canvas/MenuContainer/MainButtons/HostButton/Text (TMP) [Info :XUnity.AutoTranslator] Level: 2 [Info :XUnity.AutoTranslator] Setting text on 'TMPro.TextMeshProUGUI' to '> Авторы' [Info :XUnity.AutoTranslator] Path : /Canvas/MenuContainer/MainButtons/Credits/Text (TMP) [Info :XUnity.AutoTranslator] Level: 2 [Info :XUnity.AutoTranslator] Setting text on 'TMPro.TextMeshProUGUI' to '> Настройки' [Info :XUnity.AutoTranslator] Path : /Canvas/MenuContainer/MainButtons/SettingsButton/Text (TMP) [Info :XUnity.AutoTranslator] Level: 2 [Info :XUnity.AutoTranslator] Setting text on 'TMPro.TextMeshProUGUI' to '> Подключиться' [Info :XUnity.AutoTranslator] Path : /Canvas/MenuContainer/MainButtons/JoinACrew/Text (TMP) [Info :XUnity.AutoTranslator] Level: 2 [Info :XUnity.AutoTranslator] Setting text on 'TMPro.TextMeshProUGUI' to '> Выход' [Info :XUnity.AutoTranslator] Path : /Canvas/MenuContainer/MainButtons/QuitButton/Text (TMP)
I create fileresizer.txt
and add
/Canvas/MenuContainer/MainButtons/HostButton/Text=ChangeFontSizeByPercentage(0.5)
but its not work(
The resize did not work for you because the path is not fully specified, you wrote part of the name Elsenta Let me give you an example /main/MainButtons/text= - the path can be like this maybe so /main/Main buttons/text element (tmp)= boring-sounding component name in full but we can allow the last full release /main/Main Buttons=-thus you don’t need the full path to write a resize that can be transferred to all menu items if you apply it to the parent element
Need
/Canvas/MenuContainer/MainButtons/HostButton/Text (TMP)=ChangeFontSizeByPercentage(0.5)
-- full path
Or
/Canvas/MenuContainer/MainButtons/HostButton=ChangeFontSizeByPercentage(0.5)
--
Or
/Canvas/MenuContainer/MainButtons=ChangeFontSizeByPercentage(0.5)
-- resize all buttons in container MainButtons
I try /Canvas/MenuContainer/MainButtons/HostButton and /Canvas/MenuContainer/MainButtons not work. filename resizer.txt may be need edit... Where should this file be located?
I try /Canvas/MenuContainer/MainButtons/HostButton and /Canvas/MenuContainer/MainButtons not work. filename resizer.txt may be need edit... Where should this file be located?
where your translated texts are!
It's there, but it doesn't work.
It's there, but it doesn't work.
that means then you're probably doing something wrong... I can't give you any advice here, I don't know, I'll have to install the game and check it out..
how many line in resizer.txt possibly?
how many line in resizer.txt possibly?
how many size changes will you write as many lines the extra ones need to be removed remove empty lines
I mean, I can write this? In resizer.txt
/Systems/UI/Canvas/PlayerCursor/InteractText=ChangeFontSizeByPercentage(50);
/Systems/UI/Canvas/IngamePlayerHUD=ChangeFontSizeByPercentage(50);
resizer.txt Here's an example from another game of what the file should look like
I mean, I can write this? In resizer.txt
/Systems/UI/Canvas/PlayerCursor/InteractText=ChangeFontSizeByPercentage(50); /Systems/UI/Canvas/IngamePlayerHUD=ChangeFontSizeByPercentage(50);
No you not correct 50% = 0.5 100%= 1 ...
I checked it on another text, it works. but doesn’t want menu items) /Canvas/MenuContainer/MainButtons/HostButton
I checked it on another text, it works. but doesn’t want menu items) /Canvas/MenuContainer/MainButtons/HostButton
If you want to find a specific path of text, you can change the translated text to something completely wrong to make it easier for you to search in the log, for example, change "Main Menu" button in the translation file to doggy.
I don't recommend the ChangeFontSizeByPercentage command, as it is buggy sometimes and causes further text resizing on translation file reload.
I edited this issue for so many times as I try to find a solution
I autotranslated a game from English into Chinese. It worked well, except that there's something wrong with the font size. Sometimes the translated text needs more space than the original text (like in “Bravo!=太棒了!” it only displays “了!”)
I tried to change
but didn't work (I don't really know what they mean).
I copied the solution in this issue, for the game The Forest of Love: https://github.com/bbepis/XUnity.AutoTranslator/issues/57 but it didn't work either (I think I did exactly what it said. And I think our problems are exactly the same)
I read this: https://github.com/bbepis/XUnity.AutoTranslator#ui-font-resizing but don't really know how to change resizer.txt. I don't fully understand what the code means. Do I need to do some change with the resizer.txt downloaded from this https://github.com/bbepis/XUnity.AutoTranslator/issues/57 issue, for The Forest of Love?
like do I need to change the path? I wrote [Behaviour] EnableTextPathLogging=True in Config.ini, but don't know where to check the logged out path
...
Is there a way to solve this? I don't know the easier way to change the font size in _AutoGeneratedTranslations.txt either. Is
New Game=<size=50%>新游戏</size>
supposed to work?