-
Notifications
You must be signed in to change notification settings - Fork 45
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
Better Multi-Language Support #390
Conversation
Resource files no longer need to use the "Constants.Words.POKEMON" or any special "getC()" functions. This is all handled later. In this way, resource files can be pure text from other users/translators
The start of refactoring all buttons to use getText() instead of .text, such that their text can be dynamically retrieved. Necessary for resource integration.
Changing the Tracker's move description for this more to be more clear that it is, in fact correct and the game itself is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seemed good from a skim through (though yeah too much to properly look through everything in a reasonable time). I did spot one thing relating to the animated pokemon popout, left a comment below
As for some thoughts on the questions / discussion points in the PR:
Q1: Yeah i think that would make sense to have placeholders there, though definitely would want to make clear that the text copy/pasted over is a placeholder and not that it happens to be the same between English / other language there
Q2: Not too sure myself either, given how much text I could see it being sorta messy regardless, but yeah I think splitting up into groups (be it priority groups or categories, perhaps both?) and i think you could probably add each TODO item as tickboxes that we (or i guess whomever made the post with the TODO list) can check off as they are submitted / done, for people to easily see what is left to translate?
If the display language of the Tracker doesn't match the game rom language, then the log viewer won't function properly, since it has to match the names of things in the log with the names of things in the Tracker.
This one is tricky without some sort of big overhaul / rewrite of the log viewer. I think simplest solution may be to perhaps have like a LogParserData
table in Resources.lua
that contains the language data matching the loaded game needed for the log viewer to correctly parse the game's log file. Though I don't really know how much data this would be loading overall nor how much of an impact it could cause for people with perhaps lesser hardware or something.
At the very least, if not fixed then depending on how broken the log viewer is may need to throw an error or warning or something to tell the user "hey, this won't work right because X" but that's far from ideal
The LogViewer search screen currently doesn't work for accented characters. I couldn't find a clean solution for this, see
Utils.startsOrContains()
hm, maybe one approach could be a table mapping accented characters to a "closest matching non-accented character"? (e.g. é -> e and Á -> A etc) and using that to parse the text that is being searched through to replace accented characters with the mapped characters such that searching Siccita
matches Siccità
for example?
Also mentioning #62 as this is related and that issue is sorta our main "non-english support" update/progress log |
Reorganizing the various character constants into a single table, which helps contain information about each character's width, uppercase, lowercase, encoding (if required), and plain text form (useful for searching)
Fixed the ability to search for names of things containing accented characters in 6f81cd6 , using the keyboard that only has plain text characters. This required a good bit of reorganization work to get it done, partly why I avoided it in the first place, but had the energy today to get it resolved. One lingering issue that was present before and after this change is that on Bizhawk 2.8, for names of things that start with special characters, they don't seem to render properly... and I'm not entirely sure why. ÜBERWURF (Vital Throw) is not displayed correctly. |
@UTDZac Attaching some Console output below, the umlaut characters print to the console weird but as you can see they get formatted fine in the end. Although this then makes me wonder if it's down to a difference in character encoding between our own files being read by |
The resource changes broke the functionality of being able to replace an existing theme with an updated one. It wasn't properly reflecting the changes in the Tracker
In several cases, the parser wasn't properly detecting special characters, either because one or the other weren't encoded properly to be compatible with bizhawk.
Fixed the Bizhawk 2.8 encoding issue in 4f89287 by just adding duplicate entries to For example, instead of just one entry for ["ý"] = {
encoded = "\253",
upper = "Ý",
plain = "y",
width = 3,
},
["\253"] = {
upper = "\221",
plain = "y",
width = 3,
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me, quickly checked on my end and the issue move from before loaded up fine this time
Hitting approve on this as a "i don't have any issues with this current state" but ofc there's still the debug stuff to take out whenever you feel it's ready to merge or if you want to add more stuff i can take a look again etc
2aee88c Fixed the issue where the log couldnt be parsed if the Tracker's display language didnt match. |
Descriptions for Moves and Abilities now live in their respective language resource files; removing them from the Data files. Constants.Words is now deprecated and no longer needed.
Adding placeholder entries for all non-English language resource files. This is to assist anyone wanting to translate on their own.
With all that said, I'm ready to merge this in. Just wanting to see if you have any final thoughts. |
The dofile call was doing more than just loading in game resources.
Small adjustments to the language screen. Also removed an extra load language call when the autodetect language was used and it was different than the chosen language setting
When the source ROM is changed to a different game or language, the Game Settings weren't being properly reloaded for the new game.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, found a couple of typos in comments but that's it
This PR offers a way for the Tracker to become fully translated in languages other than English. To accomplish this, anywhere and everywhere that text appears on the Tracker has been "extracted" and moved to a resource file for it's corresponding language.
The ultimate goal of this project is to get help from the community to translate the Tracker into different languages. This will be accomplished through a GitHub Discussion forum.
This PR is massive beyond reason and I don't expect a full review of everything. I would like some extra eyes on some of the larger-scale changes.
Features
/Languages/English.lua
Primary Files to Focus Review
Resources.lua
DEBUG_REPLACE_ALL_RESOURCES
totrue
if you want a quick way to scan through the Tracker to make sure text resources are working and get replaced. Some names of things might not render or function properly with this enabled.Languages/English.lua
data/RandomizerLog.lua
(regex changes)screens/LanguageScreen.lua
screens/UpdateScreen.lua
Questions
English.lua
entries for all other Lua language files? I originally left them out, since there aren't any translations available, but perhaps it's easier to have all those text-keys already there instead of requiring others to add them in themselves. Granted, it will be us who eventually will add them all in, but if someone wants to translate on their own without our help, it might be easier if those entries were already there.Notes & Known Issues
Resources
lua is loaded, or because I felt they were minor and not worth the time. Let me know if you think otherwise.Utils.containsText()