alucryd / oxyromon

Rusty ROM OrgaNizer
Other
111 stars 13 forks source link

[Feature] Language Support for 1G1R #79

Closed jdc0730 closed 3 months ago

jdc0730 commented 1 year ago

I have been using Retool to trim my datfiles down and prefer to include all the regions and then filter by language. It would be great to see a language filter added.

alucryd commented 1 year ago

Will look into it, if shiratsu-naming exposes these it should not be too hard to implement.

alucryd commented 1 year ago

First proof of concept: https://github.com/alucryd/oxyromon/commit/da0b070cb4e794299b263f303e12cac9621394d8

Added a LANGUAGES setting, this is a whitelist that must contain ISO-2 language codes using the same format as No-Intro (e.g. En for English). Will probably keep it that way to distinguish it from the ISO-2 country codes that are all uppercase. Any game that does not have at least one language in this list will be discarded. This happens before the region ordering, concurrently with the releases and flags discard step.

This needs refining however, as very few games actually have the languages in the names, so the languages list exposed by shiratsu is mostly empty. Also had to remove a false positive, as Nintendo Power games flagged (NP) end up in the languages list. Fortunately it is all uppercase, and NP is not a valid language code anyway.

Am I correct in assuming retool is inferring languages from single language regions? Working on that next, will need to map every country code to its language code.

Won't be able to do much about regions like Asia, Europe or World though, if the game name doesn't specify anything, the languages list will be empty, and these games will not be discarded by default.

alucryd commented 1 year ago

Just finished mapping countries to languages, did my best to list the dominant languages in countries that don't have an official language, or have several.

Here's a test build: https://mega.nz/file/5SplnAaT#fPoRP0QJRqfhqGvUVeRZEpWIGRswH8wcvNzK3YD8fWY

Please let me know if that checks your boxes or if it needs improving.

Oh BTW, forgot that World maps to USA, Europe and Japan, so in turn it will map to En and Ja.

jdc0730 commented 1 year ago

First proof of concept: da0b070

Added a LANGUAGES setting, this is a whitelist that must contain ISO-2 language codes using the same format as No-Intro (e.g. En for English). Will probably keep it that way to distinguish it from the ISO-2 country codes that are all uppercase. Any game that does not have at least one language in this list will be discarded. This happens before the region ordering, concurrently with the releases and flags discard step.

This needs refining however, as very few games actually have the languages in the names, so the languages list exposed by shiratsu is mostly empty. Also had to remove a false positive, as Nintendo Power games flagged (NP) end up in the languages list. Fortunately it is all uppercase, and NP is not a valid language code anyway.

Am I correct in assuming retool is inferring languages from single language regions? Working on that next, will need to map every country code to its language code.

Won't be able to do much about regions like Asia, Europe or World though, if the game name doesn't specify anything, the languages list will be empty, and these games will not be discarded by default.

I believe they are not inferring from the region but instead pulling that information from the file name as documented in the naming convention. https://datomatic.no-intro.org/stuff/The%20Official%20No-Intro%20Convention%20(20071030).pdf That being said, I am a developer of retool, so can't say with certainty, I believe by default it looks for language first and then if no match, looks at regions. This is based on the fact that there is a setting to reverse that logic.

Here is a link to the tool if you are not familiar: https://github.com/unexpectedpanda/retool

alucryd commented 1 year ago

Thanks for the input, if that's the case, my first commit would be sufficient, it just needs a little rework for performance. I'll keep the country/language mapping aside for now, should have a test build for you tomorrow.

alucryd commented 1 year ago

Removed the language inferring, and tweaked it a bit more to remove all false positives from shiratsu (at least I hope so, I applied a En,Ja filter to my entire collection without issue), link to the updated build is in your other issue.