Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update several files #23

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Update several files #23

merged 1 commit into from
Jul 8, 2024

Conversation

Lzw104522773
Copy link
Contributor

Update the punctuation format of several files.

Update the tp2 file to avoid installation errors and avoid garbled prompts.

Update the punctuation format of several files.

Update the tp2 file to avoid installation errors and avoid garbled prompts.
@11jo
Copy link
Collaborator

11jo commented Jul 8, 2024

But is this really enough to resolve the prompt thing you mention ?

@Lzw104522773
Copy link
Contributor Author

Just looking unhappy. It does not affect playing games.

After converting setup-ee.tra to UTF-8, the mod installation is complete and there will be no garbled dialog.tlk.

Copy link
Collaborator

@Roberciiik Roberciiik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one looks fine. If you still want to update console prompts, please make a separated Pull Request and I will guide you how to update the prompt strings correctly without copying of the whole setup.tra file.

@11jo
Copy link
Collaborator

11jo commented Jul 8, 2024

@Lzw104522773

The prompt issue appear for others mods or only DarkHorizons ?

Don't get me wrong, I want to understand why but if a workaround is needed it's ok.

@Roberciiik

Thanks for your time.

@11jo 11jo merged commit 23433ff into The-Gate-Project:main Jul 8, 2024
@Lzw104522773
Copy link
Contributor Author

When using the latest version of weiduexe, if setup.tra is encoded with ANSI, the prompt will be garbled. But this mod needs to transcode setup.tra to UTF-8, but if I encode setup.tra using UTF-8, the transcoded setup.tra will be garbled. So I added setup-osx.tra, setup-unix.tra, and setup-win32.tra (all using UTF-8 encoding) to avoid garbled prompts. This method has been adopted in other mods, such as bg1ub.

@Lzw104522773
Copy link
Contributor Author

@0 = "Dark Horizons" Mod
@1 = /****************************************
@2 = * Dark Horizons Mod *
@3 = * http://www.teambg.net *
@4 = * Copyright 2015 CoM_Solaufein *
@5 = * THIS FILE WILL INSTALL *
@6 = * THE DARK HORIZONS IN YOUR GAME *
@7 = * DIRECTORY. *
@8 = *****************************************
@9 = You do not appear to have BG:EE, EET, TotSC, TuTu or BGT installed.

@890 = BG:EE install detected.
@891 = Tutu install detected.
@892 = BGT install detected.
@893 = Please install on BG:EE, EET, TotSC, Tutu or BGT.
@894 = BG1 install detected.
@895 = EET install detected.

I think it's okay to separate the above content in setup osx.tra, setup unix.tra, and setup win32.tra. Of course, for Chinese, that's Chinese.

@Roberciiik
Copy link
Collaborator

Generally speaking, Windows 10 console is printing characters in UTF-8. So to have correct localized names of components, you need to have UTF-8 encoded setup.tra file. So the proposed workaround from @Lzw104522773 is to create a second setup file with only UTF-8 encoded lines related to installation.

@Lzw104522773
Copy link
Contributor Author

Yes,add setup-osx.tra, setup-unix.tra, and setup-win32.tra, It also does not affect the setup.tra of other languages.

@11jo
Copy link
Collaborator

11jo commented Jul 8, 2024

Yeah, I understand it's only for chinese.

So the issue is only for BGT since EE always load Setup-ee.tra ?

This method has been adopted in other mods, such as bg1ub.

It's not adopted yet.

And why three duplicated files are needed, only one can do the job, no ?

And if I understand correctly this garbled issue arise for every mods that have vanilla and EE compatibility ?

@Roberciiik
Copy link
Collaborator

Roberciiik commented Jul 8, 2024

So the issue is only for BGT since EE always load Setup-ee.tra ?

Unfortunately no, setup-ee.tra is loaded in later stage, after you click [Install] then weidu loads all components name from setup ee file.

And why three duplicated files are needed, only one can do the job, no ?

Potentially osx or linux console could have different encoding from Windows and therefore there are dedicated files for each operating system.

And if I understand correctly this garbled issue arise for every mods that have vanilla and EE compatibility ?

I would say that for every mod that uses ANSI encoding and not UTF. This is not related to EE in fact. Also this workaround could be implemented for all other languages but we in Polish, for example, skip special characters to print only English letters. It is harder for Chinese alphabet.

@Lzw104522773
Copy link
Contributor Author

Add setup-osx.tra, setup-unix.tra, and setup-win32.tra, It is currently an effective method to solve the problem of garbled Chinese installation prompts. My friends: yoshimo0417 and MephistosataDevil, have already practiced on several mods.

@11jo
Copy link
Collaborator

11jo commented Jul 8, 2024

Unfortunately no, setup-ee.tra is loaded in later stage, after you click [Install] then weidu loads all components name from setup ee file.

Oh, yes you right !

Potentially osx or linux console could have different encoding from Windows and therefore there are dedicated files for each operating system.

Hum, don't understand that part, since only UTF8 can deal with symbole in prompt windows, but I don't have good knowledge about this.

I would say that for every mod that uses ANSI encoding and not UTF. This is not related to EE in fact. Also this workaround could be implemented for all other languages but we in Polish, for example, skip special characters to print only English letters. It is harder for Chinese alphabet.

Ok, but this way is gonna be confusing for modders and translators, I think.

@GraionDilach
Copy link
Collaborator

Potentially osx or linux console could have different encoding from Windows and therefore there are dedicated files for each operating system.

For Linux, that depends on $LANG. UTF-8 is mostly commonplace by now, but some server-oriented distros might fall back to ANSI for legacy terminal support.

@Roberciiik
Copy link
Collaborator

Many mods do a separation from install prompts and translation of items, scripts needed from setup file nowadays. We can see sometime file named "instal.tra", this is basically the same idea what @Lzw104522773 is trying to implement.

@Lzw104522773 if all three files are encoded in UTF-8 anyway, can you simple add a single new file like install.tra with all lines required for translation?

@11jo
Copy link
Collaborator

11jo commented Jul 8, 2024

Hello Graion !

Many mods do a separation from install prompts and translation of items, scripts needed from setup file nowadays. We can see sometime file named "instal.tra", this is basically the same idea what @Lzw104522773 is trying to implement.

@Lzw104522773 if all three files are encoded in UTF-8 anyway, can you simple add a single new file like install.tra with all lines required for translation?

Anyway we can do whatever we want for DarkHorizons but a method more common with other language could be nice. (I mean if this workaround is mandatory for most mod)

@Roberciiik
Copy link
Collaborator

That's why I suggested having only a single install.tra file, that is optional, and other languages could implement it as well in the future.

@11jo
Copy link
Collaborator

11jo commented Jul 8, 2024

Yes, if @Lzw104522773 is willing to try your way maybe we can try to adapt it for other languages too.

And it will provide a template of the method (though looking into mods with install.tra is already an exemple)

@11jo
Copy link
Collaborator

11jo commented Jul 8, 2024

It's funny but no matter how many mods I work on, encodage has been a pain to deal with, for each of them. Every time I think I definitly understand how it works something new or odd arise !

@Lzw104522773
Copy link
Contributor Author

Yes,we can.For the install.tra like:
QQ截图20240708194840
(Install.tra, using English as an example)
And tp2 fife is

LANGUAGE Simplified Chinese (Latest Chinese accent by YouYe)
Schinese
DarkHorizons/Language/Schinese/install.tra

 If the installation prompt is placed in install.tra, the transcoding of Setup.tra can be ignored. This way, the installation prompt will not be garbled.

I have tested this method and the installation prompt will not be garbled. After installation, the dialog.tlk will also not be garbled.

For Chinese translators, this should be a relatively convenient solution and do not require too many changes to the TP2 file. If the installation prompt is in a separate file, taking this mod as an example, at most we can modify "ACTION_DEFINE_ARRAY charsetsNoConvertArray BEGIN setup-ee END" to "ACTION_DEFINE_ARRAY charsetsNoConvertArray BEGIN setup-ee install END". For other languages, this can also be done, and we need to conduct some testing

@Lzw104522773
Copy link
Contributor Author

If we don't consider the operating system, we just need to add an install.tra that includes installation prompts.

@MephistoSatanDevil
Copy link

MephistoSatanDevil commented Jul 8, 2024

In fact, this is a historical issue.
We are aware that there are multiple release versions of WeiDU. If we install a mod using an older version or the x86-legacy version, the setup.tra file needs to be encoded in ANSI; otherwise, it will appear as gibberish in the Windows console.
However, we recently found that when using the latest version of WeiDU (WeiDU-Windows-249-amd64) for installation, the UTF8 Chinese characters can be displayed normally in the console without special settings when the default codepage is 936. Therefore, we adopted this method for translation, which is also the reason why Chinese translators sometimes updated the weidu.exe file when submitting translations a while ago.

Currently, when installing with the latest version of WeiDU, for the enhanced edition of the game, all tra files need to be encoded in UTF-8. Only for the original edition of the game, the game content part needs to be converted to ANSI encoding.
However, since last year when we completed the Chinese localization work for SoD, both Chinese mod authors and players in the community have shifted to the enhanced edition and abandoned the original edition.

Therefore, the simplest solution now is to convert all tra files to UTF-8 without any conversion, which will no longer cause encoding issues. As a result, but at the same time, we are not aware of the situation in other language communities, so we have adopted this method to avoid affecting other languages.

In fact, for other languages, using UTF-8 encoding for everything should also be problem-free. Therefore, if everyone can agree to use only UTF-8 encoding, and even abandon support for the original edition, it would actually be the best. For mod authors, this would be a matter of reducing the burden on the code.

The only cost that needs to be paid is simply giving up support for the original version.

@Roberciiik
Copy link
Collaborator

The only cost that needs to be paid is simply giving up support for the original version.

Yes, and I think we should not do this. There is large community that still use Original Baldur's Gate games and we don't want to cut them off from the latest updates of mods. Keeping multiple branches / repositories for EE and non-EE games are horrible for maintenance.

So I am ok with a single optional install.tra file or event with the three setup-OS dependent files, unless it contains only the installation prompts.

@MephistoSatanDevil
Copy link

The only cost that needs to be paid is simply giving up support for the original version.

Yes, and I think we should not do this. There is large community that still use Original Baldur's Gate games and we don't want to cut them off from the latest updates of mods. Keeping multiple branches / repositories for EE and non-EE games are horrible for maintenance.

So I am ok with a single optional install.tra file or event with the three setup-OS dependent files, unless it contains only the installation prompts.

Perhaps using a setupEE.tra is indeed a very good option. or insstall.tra or whatever other name.

Alternatively, we could set development standards where all tra files are encoded in UTF-8, and only use WeiDU to convert them to ANSI encoding when installing the original edition. This approach would maintain compatibility with both the enhanced and original editions while simplifying the development and maintenance process.

@Roberciiik
Copy link
Collaborator

Alternatively, we could set development standards where all tra files are encoded in UTF-8, and only use WeiDU to convert them to ANSI encoding when installing the original edition. This approach would maintain compatibility with both the enhanced and original editions while simplifying the development and maintenance process.

A lot of new mods are created this way, or even some older one are updated to be exclusively in UTF-8. However, here we are talking about older mod, that would benefit a bit less to make it rearranged of the translation files. Of course, if someone is willing to do so, and would do it correctly for all languages, I will be glad to merge such change. However, there were such examples like here, where such conversion failed for some languages, and then it created critical issue for the people of that country.

So I think that adding additional file that works for Chinese is fine, and it is fast for you as translators. But of course, it's up to you guys.

@11jo
Copy link
Collaborator

11jo commented Jul 8, 2024

Yeah, keeping vanilla compatibility is mandatory for me too.

Alternatively, we could set development standards where all tra files are encoded in UTF-8, and only use WeiDU to convert them to ANSI encoding when installing the original edition. This approach would maintain compatibility with both the enhanced and original editions while simplifying the development and maintenance process.

This way is interesting but I didn't found the courage to look at it yet...

And I may be wrong but both mentionned method (install.tra and native UTF8) will not help if players use an old or a legacy version of weidu, right ? (for EE or vanilla)

So if we don't keep a version of prompt without symbol the mentionned players will always have garbled prompts ?
And chinese player using an old or a legacy version of weidu will always got garbled prompt ?

@Lzw104522773
Copy link
Contributor Author

So I am ok with a single optional install.tra file or event with the three setup-OS dependent files, unless it contains only the installation prompts.

So,can I submit the PR as I mentioned above?

@Roberciiik
Copy link
Collaborator

And I may be wrong but both mentionned method (install.tra and native UTF8) will not help if players use an old or a legacy version of weidu, right ? (for EE or vanilla)

From my understanding, this is true. However if any mod uses a newer version of WeiDU.exe then all older ones are updated to the latest you have. So this is the case if someone tries to install an ancient mod alone with prehistorical weidu version. But hey - if you are implementing this patch here, the newer version of Dark Horizon will use the latest weidu installer so only UTF-8 prompts should be used no matter how old other mods are.

So,can I submit the PR as I mentioned above?

Yes please, we will look at it.

@11jo
Copy link
Collaborator

11jo commented Jul 8, 2024

From my understanding, this is true. However if any mod uses a newer version of WeiDU.exe then all older ones are updated to the latest you have. So this is the case if someone tries to install an ancient mod alone with prehistorical weidu version. But hey - if you are implementing this patch here, the newer version of Dark Horizon will use the latest weidu installer so only UTF-8 prompts should be used no matter how old other mods are.

It's probably unusual but until last year my computer was on windows XP so only legacy weidu was working to install mods.
In this case UTF8 is not enough.

Anyway thanks for the discussion and explanation everybody !

@MephistoSatanDevil
Copy link

From my understanding, this is true. However if any mod uses a newer version of WeiDU.exe then all older ones are updated to the latest you have. So this is the case if someone tries to install an ancient mod alone with prehistorical weidu version. But hey - if you are implementing this patch here, the newer version of Dark Horizon will use the latest weidu installer so only UTF-8 prompts should be used no matter how old other mods are.

It's probably unusual but until last years my computer was on windows XP so only legacy weidu was working to install mods. In this case UTF8 is not enough.

Anyway thanks for the discussion and explanation everybody !

For old computers and players of the original game, it may be necessary for them to perform some necessary manual operations, which would greatly simplify the difficulty of maintaining the mods.

@11jo
Copy link
Collaborator

11jo commented Jul 8, 2024

For old computers and players of the original game, it may be necessary for them to perform some necessary manual operations, which would greatly simplify the difficulty of maintaining the mods.

You're right, and probably not many players are in this situation.

In the french communauty we still encourage translators to avoid accent and symbol in prompts, but for chinese it's more complicated.

@MephistoSatanDevil
Copy link

MephistoSatanDevil commented Jul 8, 2024

For old computers and players of the original game, it may be necessary for them to perform some necessary manual operations, which would greatly simplify the difficulty of maintaining the mods.

You're right, and probably not many players are in this situation.

In the french communauty we still encourage translators to avoid accent and symbol in prompts, but for chinese it's more complicated.

Yes, fortunately, the vast majority of Chinese players have now completely switched to the Enhanced Edition, so UTF-8 alone is perfectly normal. As a translator, as long as the mod code does not perform any special encoding conversions, there are no issues with the translation work.

@burner1024
Copy link

For Linux, that depends on $LANG. UTF-8 is mostly commonplace by now, but some server-oriented distros might fall back to ANSI for legacy terminal support.

I think it is safe enough to assume that Linux and Mac consoles are UTF-8, whoever runs more exotic distros, or even BSD, can likely handle the charset issue.
But the draw of using setup-%WEIDU_OS% is to have different encodings. If they are the same, there's no point in that indeed.

The only cost that needs to be paid is simply giving up support for the original version.

Hell no. I'll sooner drop support for EEs.

The main issue here, I think, is the lack of clarity from weidu side:

  • not sure if some integration into Windows that only newer OCaml provide entails only console thing or something else.
  • not sure on which windows versions does the newer weidu even run.
  • not sure if this auto console encoding switch only happens for Chinese, or all languages. And on which windows versions.

Ultimately, if weidu drops legacy version, then mods will have to follow suit. If it doesn't, then why even have the newer one, it seems to just complicate things.

@Lzw104522773
Copy link
Contributor Author

But the draw of using setup-%WEIDU_OS% is to have different encodings. If they are the same, there's no point in that indeed.

MephistoSatanDevil solved the problem of garbled prompts when installing several mods in a Chinese environment using setup -% WEIDU-OS%. Of course, it only worked very well on Windows and has not been tested on other operating systems.After all, in China, the majority of players use my Windows.

@Lzw104522773
Copy link
Contributor Author

@11jo @Roberciiik @GraionDilach

I found that "Ding0's Quest Pack" is solved using setup -% WEIDUUOS%. tra.

https://www.pocketplane.net/quest-pack/

@Roberciiik
Copy link
Collaborator

Yes, it is a working solution. Since all files are in the UTF-8, I think there is no need to have separated 3 files for the console prompts.

@11jo
Copy link
Collaborator

11jo commented Jul 9, 2024

OSX and UNIX have the same encodage, but win32 is in ANSI.

Using %WEIDU_OS% requires us to add a file for each OS, even if they have the same encodage ?

I was thinking but for chinese, if the .tra files use GB2312 then prompt will be garbled anyway, no ? (no matter the OS or weidu version) Install.tra in UTF8 can be used even for vanilla game.

So for chinese the only way to have regular prompt on vanilla game is to revert the prompt to English. Arf, no I mean for player who use legacy weidu.

EDIT : At the end for my little understanding, the workaround with three setup-OS.tra is interesting but probably more for languages in ANSI. (By allowing to use prompt without accent or symbole for older system)

Chinese and Russian for exemple will always be garbled on older weidu version whatever the file or encodage. And need to use another language for prompt.

@Roberciiik
Copy link
Collaborator

Chinese and Russian for exemple will always be garbled on older weidu version whatever the file or encodage. And need to use another language for prompt.

This is correct. Russian community has 3 different code pages for their consoles, and they agreed on using English names for components and to not translate any command prompts.

Using setup-%WEIDU_OS%.tra or install.tra in UTF-8 is always partial solution.

Install.tra in UTF8 can be used even for vanilla game.

Yes, this is also true.

@11jo
Copy link
Collaborator

11jo commented Jul 9, 2024

Ok, thanks Roberciik !

If one day some chinese players complain about prompt because they are on older system, we could use the setup-%WEIDU_OS%.tra workaround with prompt in english for setup-win32.tra.

But according to Lzw104522773 and MephistoSatanDevil this is unlikely to be necessary.

@MephistoSatanDevil
Copy link

MephistoSatanDevil commented Jul 10, 2024

If one day some chinese players complain about prompt because they are on older system, we could use the setup-%WEIDU_OS%.tra workaround with prompt in english for setup-win32.tra.

But according to Lzw104522773 and MephistoSatanDevil this is unlikely to be necessary.

Compared to the issues with "installation problems on the old system", the questions we are being asked more frequently now are "how to install mods on the phone". So there's no need to worry too much. XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants