ReactiveDrop / reactivedrop_translations

Translations for Alien Swarm: Reactive Drop (2017), a mod of Valve's Alien Swarm (2010)
Creative Commons Zero v1.0 Universal
15 stars 47 forks source link

Brazilian portuguese translation #15

Closed FurtadoPires closed 2 years ago

FurtadoPires commented 2 years ago

I'm intended to work in translating the game files to Brazilian Portuguese language (commonly know as PT-BR)

Steam already makes distinction between portuguese and brazilian portuguese (it's called "brazilian" in translation files) and I will work with the files following this name pattern.

While the game already have portuguese translation, I would rather not touching it due to the fact that, while it's the same understandable language there are some words that are odd to one another.

@BenLubar once the files are done, could this translation be used as default for brazilian portuguese on steam? If so, which process should I do besides the MR?


BenLubar commented 2 years ago

I'll enable brazilian in the update script and do a sync. Other than the actual translating of the files, everything that needs to be done is on my end.

FurtadoPires commented 2 years ago

Very nice, I would also like to use this issue to ask questions that may appear during the process, since I want to keep the terms as consistent as possible to the english version. Is it ok?

BenLubar commented 2 years ago

Yep, that's fine.

The files for you to edit are (and there's a lot of them, so this will take a while):

[edit: checklist moved to OP so it shows up in the issue list]

(roughly in order of importance)

FurtadoPires commented 2 years ago

@BenLubar I've notice that a lot of lines from resource/basemodui_ seems to de reminiscent from Xbox Live components and Left 4 Dead leftovers, is it necessary to translate everything or there's a specific session that's used in Alien Swarm?

Blueberryy commented 2 years ago

@BenLubar I've notice that a lot of lines from resource/basemodui_ seems to de reminiscent from Xbox Live components and Left 4 Dead leftovers, is it necessary to translate everything or there's a specific session that's used in Alien Swarm?

Most of the strings inside resource/basemodui_ file are used in-game. You will have to translate it whole i guess :/

Tarkoviski commented 2 years ago

Heya! I can assist with proofreading and editing once the base translation is done. I actually proofread the original when it was on STS, it's a shame it was never shipped.

FurtadoPires commented 2 years ago

Most of the strings inside resource/basemodui_ file are used in-game. You will have to translate it whole i guess :/

I will translate everything to make sure, but in the future I suggest that might be worth the effort to clean this file from unused parameters, in order to make maintenance easier and help in possible future new translations :)

An example of leftover parameters: "L4D360UI_Boomer" "Boomer" "L4D360UI_Hunter" "Hunter" "L4D360UI_Smoker" "Smoker"

Heya! I can assist with proofreading and editing once the base translation is done. I actually proofread the original when it was on STS, it's a shame it was never shipped.

Thanks for the help @Tarkoviski, once I MR the files back, any help with revision will be welcome

FurtadoPires commented 2 years ago

Currently translating resource/reactivedrop_brazilian.txt

What's the meaning of ROSTER in game context?

BenLubar commented 2 years ago

asw_roster does not appear to be used. My best guess is that it was either some kind of unlock system for marines or part of the campaign wounding system that was cut during the development of the 2010 game.

FurtadoPires commented 2 years ago

@BenLubar I'm not sure what should I do with community/item-schema.json

It seems to be an unique file (not separated by language like the others), won't my modifications impact for other languages too?

BenLubar commented 2 years ago

For each line that has _english and needs translating (eg. isn't blank), copy it and make _brazilian. Since b comes before e, the _brazilian line should go above the _english line.

https://github.com/ReactiveDrop/reactivedrop_translations#item-schema

FurtadoPires commented 2 years ago

For each line that has _english and needs translating (eg. isn't blank), copy it and make _brazilian. Since b comes before e, the _brazilian line should go above the _english line.

https://github.com/ReactiveDrop/reactivedrop_translations#item-schema

Now I've notice that I had an old version of this file, which was missing the language parameters.

FurtadoPires commented 2 years ago

There's also an typo in the original file

image

Line 80 is the same as line 75

BenLubar commented 2 years ago

Thanks, I've removed the duplicate.

FurtadoPires commented 2 years ago

Almost all files translated, now it's only missing the big one.

@BenLubar I've noticed that you made an resource/reactivedrop_brazilian.txt file that's a little different from the original resource/reactivedrop_english.txt

Should I work in this file or I can follow the the original layout?

BenLubar commented 2 years ago

You should work in resource/reactivedrop_brazilian.txt, since that's what the sync tool is assuming the input file will look like.

FurtadoPires commented 2 years ago

So I finally finished the translation of all the files and now I breathe with the help of devices.

@BenLubar I want to test ingame but Steam doesn't offer Brazilian Portuguese option for this game, anything I can do to force the gate to use my files?

BenLubar commented 2 years ago

I've added Brazilian Portuguese as an option. If you don't see it, you can restart Steam to force it to update app information.

https://steamdb.info/app/563560/history/?changeid=15425452

FurtadoPires commented 2 years ago

I've managed to make it work, but that's a lot of Conditional Error: Bad expression token: errors. would you know what the cause? Game is UTF-8 right?

BenLubar commented 2 years ago

If it works despite the error messages, then it's fine. The game files use UTF-16LE, but one of the two ways that localization files get loaded also supports UTF-8. It's transformed to UTF-16 by the build script.

FurtadoPires commented 2 years ago

If it works despite the error messages, then it's fine. The game files use UTF-16LE, but one of the two ways that localization files get loaded also supports UTF-8. It's transformed to UTF-16 by the build script.

It only working partially, apparently game can't load my reactivedrop_brazilian.txt file, any way I can debug it? Might be some broken parameter since everything I wrote is UTF-8

BenLubar commented 2 years ago

If you send it to me, I can help you find it using regular expressions. My guess (based on what other people have had happen in the past) is that there's a missing or extra quotation mark somewhere.

FurtadoPires commented 2 years ago

An example of my current file reactivedrop_brazilian.txt

BenLubar commented 2 years ago

Lines 1506, 2978, and 4944 are missing one quotation mark each.

FurtadoPires commented 2 years ago

Thanks, that did the trick

How did you found those line? I think I might have other files with the same problem

BenLubar commented 2 years ago

The regular expression I wrote is

^(?!^\s*"[^"\\]*"\t\t"([^"\\]|\\["n\\])*"$).*$
FurtadoPires commented 2 years ago

The regular expression I wrote is

^(?!^\s*"[^"\\]*"\t\t"([^"\\]|\\["n\\])*"$).*$

Could you teach me how to do it if it isn't a problem?

BenLubar commented 2 years ago

There's a guide on how to use regular expressions on the wiki:

https://github.com/ReactiveDrop/reactivedrop_translations/wiki/How-to-translate-using-vscode#search-and-replace-using-regular-expressions

FurtadoPires commented 2 years ago

So far, I think I'm almost ready to release the first version

There are only some problems that I couldn't figure out what's the cause:

ILocalize::AddFile() failed to load file "Resource/valve_brazilian.txt".

KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file c:\program files (x86)\steam\steamapps\common\alien swarm reactive drop\reactivedrop\resource\closecaption_brazilian.txt
lang, Tokens, 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file c:\program files (x86)\steam\steamapps\common\alien swarm reactive drop\reactivedrop\resource\closecaption_brazilian.txt
lang, (*Tokens*), 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file c:\program files (x86)\steam\steamapps\common\alien swarm reactive drop\reactivedrop\resource\closecaption_brazilian.txt
lang, Tokens, 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file c:\program files (x86)\steam\steamapps\common\alien swarm reactive drop\reactivedrop\resource\closecaption_brazilian.txt
lang, (*Tokens*), 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file c:\program files (x86)\steam\steamapps\common\alien swarm reactive drop\reactivedrop\resource\closecaption_brazilian.txt
lang, Tokens, 
KeyValues Error: RecursiveLoadFromBuffer:  got EOF instead of keyname in file c:\program files (x86)\steam\steamapps\common\alien swarm reactive drop\reactivedrop\resource\closecaption_brazilian.txt
lang, (*Tokens*), 
Failed to init 'maps/soundcache/_master_brazilian.cache'
Failed to init 'maps/soundcache/_master_brazilian.cache'

And of course, I think there's something wrong in this image :p 20220714221629_1

Those are my current problematic files reactivedrop_brazilian.txt valve_brazilian.txt

BenLubar commented 2 years ago

The mission completion screen needs to be manually updated for new letters, but that's my job: https://github.com/ReactiveDrop/reactivedrop_public_src/blob/reactivedrop_public/src/game/client/swarm/vgui/asw_scalable_text.cpp#L197

Failed to init 'maps/soundcache/_master_brazilian.cache' is safe to ignore - it means there's no translated version of the sound cache, which is correct because we don't have any translated sounds, so having separate sound caches for different languages would just waste disk space.

The error message mentions closecaption_brazilian.txt, so I'd check that for mismatched quotes in there.

FurtadoPires commented 2 years ago

The mission completion screen needs to be manually updated for new letters, but that's my job

I can also change my text to not include punctuation if that's the only problem, I only need to know which parameter is that one

The error message mentions closecaption_brazilian.txt, so I'd check that for mismatched quotes in there.

Now I've notice that you've updated this file to include the [english] tags, but in the meantime I've translated based on the closecaption_english.txt

Would be feasible to include those tags in my file? It'll be a lot of work to translate everything again :/

my current closecaption_brazilian.txt

BenLubar commented 2 years ago

copy your changes somewhere else as a backup (or commit them) and try running translation-sync-tool.exe in the utils folder. it should add the [english] lines, but it will also indent all of the strings it does that to, so you'll have to delete the indentation after.

FurtadoPires commented 2 years ago
   brazilian: panic: expected language name to match filename

goroutine 1 [running]:
main.updateLanguageFile(0x4d1808?, {0x4ae197?, 0x4aac1c?}, {0x4ab0d9, 0x9}, {0x4aa50e?, 0x1?})
        C:/Users/Owner/Documents/GitHub/reactivedrop_translations/utils/update_translations.go:353 +0x6ae
main.syncTranslations({0x4ae197, 0x15}, {0x4aa50e, 0x4}, 0x0)
        C:/Users/Owner/Documents/GitHub/reactivedrop_translations/utils/update_translations.go:125 +0x2b9
main.main()
        C:/Users/Owner/Documents/GitHub/reactivedrop_translations/utils/update_translations.go:76 +0x92

I tried to run in my branch without success, should I follow this path C:/Users/Owner/Documents/GitHub/reactivedrop_translations/utils/ to make it work?

BenLubar commented 2 years ago

That means one of your files does not have brazilian as its language near the start of the file (it should say right above that error which file it's working on)

The C:/Users/Owner/Documents/GitHub/reactivedrop_translations/utils/ paths are just where the source code was when I compiled the tool.

FurtadoPires commented 2 years ago

That means one of your files does not have brazilian as its language near the start of the file (it should say right above that error which file it's working on)

I check out and I have a _brazilian file for every _english one, but for some reason the script seems to not recognize it, the output says translation is in 0%

BenLubar commented 2 years ago

If it's the same as https://github.com/FurtadoPires/reactivedrop_translations/runs/7348525048?check_suite_focus=true#step:4:84

the translation sync tool wants https://github.com/FurtadoPires/reactivedrop_translations/blob/master/resource/chat_brazilian.txt#L3 to be "Language" "brazilian"

BenLubar commented 2 years ago

It says 0% because when it added the [english] lines, it also indented everything to mark it as needing to be checked by a translator. if you run it again once the indentation is removed, it should say the correct percentage.

FurtadoPires commented 2 years ago

Found the cause, the script only recognize "Language" "brazilian" if it's everything in lower case (I based on the _english file which starts with a capital letter) now the script recognize my files :)

Unfortunately the game still doesn't use my closedcaption_brazilian file and I suspect it's probably related to the .dat file with the same name inside game folder

image

Game also seems to be complaining about those files, but the translation is apparently working for everything except dialogue captions

image

BenLubar commented 2 years ago

If the files are UTF-8 those error messages are expected and ignorable. (The game engine loads them, and then AS:RD loads them again with more features, such as the ability to have multiple addons contribute to the same file.)

At some point I want to get rid of compiled closecaption files - they made sense in Source Engine games where the server did not have access to the game's assets, but AS:RD is free and the compile doesn't really give us anything (they let the server send 4 byte IDs for closed captions instead of full variable-length strings, but we can compute those 4-byte IDs at runtime fairly cheaply).

BenLubar commented 2 years ago

Once you get it to a point where the sync tool is no longer making changes, send in a PR and let's get your files in the game.

FurtadoPires commented 2 years ago

At some point I want to get rid of compiled closecaption files - they made sense in Source Engine games where the server did not have access to the game's assets, but AS:RD is free and the compile doesn't really give us anything (they let the server send 4 byte IDs for closed captions instead of full variable-length strings, but we can compute those 4-byte IDs at runtime fairly cheaply).

So once I PR my files, captions will work? It's a separated process related to those dat files?

Once you get it to a point where the sync tool is no longer making changes, send in a PR and let's get your files in the game.

I'll make some more tests, but I think I'm good to send it today, should I squash my commits?

BenLubar commented 2 years ago

The closed caption compiler runs as part of the build script.

It's up to you whether you want to squash your commits. Some translators do, others don't.

FurtadoPires commented 2 years ago

Send my PR to approval #159