Skip to content

[ROMM-3026] Region/language shortcodes should be case sensitive#3035

Merged
gantoine merged 1 commit intomasterfrom
romm-3026
Feb 18, 2026
Merged

[ROMM-3026] Region/language shortcodes should be case sensitive#3035
gantoine merged 1 commit intomasterfrom
romm-3026

Conversation

@gantoine
Copy link
Member

Description
Explain the changes or enhancements you are proposing with this pull request.

Fixes #3026

Checklist
Please check all that apply.

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gantoine, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where region and language shortcodes were inadvertently treated as case-insensitive during parsing. By modifying the dictionary creation for these shortcodes and updating the tag parsing logic, the system now correctly respects the original casing of shortcodes, ensuring more accurate and precise identification of regions and languages from file names.

Highlights

  • Shortcode Case Sensitivity: Region and language shortcode mappings (REGIONS_BY_SHORTCODE, LANGUAGES_BY_SHORTCODE) are now created using their original casing, making them case-sensitive.
  • Tag Parsing Logic Update: The parse_tags function in roms_handler.py has been updated to perform lookups against the case-sensitive shortcode dictionaries using the original raw_tag, while still using lowercase for name-based lookups.
Changelog
  • backend/handler/filesystem/base_handler.py
    • Removed .lower() calls when populating REGIONS_BY_SHORTCODE and LANGUAGES_BY_SHORTCODE to enforce case sensitivity for shortcode keys.
  • backend/handler/filesystem/roms_handler.py
    • Adjusted the parse_tags method to use the original raw_tag for lookups in the case-sensitive REGIONS_BY_SHORTCODE and LANGUAGES_BY_SHORTCODE dictionaries.
    • Ensured that name-based lookups (e.g., REGIONS_NAME_KEYS) continue to use the lowercase version of the tag.
Activity
  • The author has confirmed local testing of the changes.
  • Relevant comments within the codebase have been updated.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Contributor

Test Results

801 tests  ±0   800 ✅ ±0   2m 7s ⏱️ +3s
  1 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 8a56e9b. ± Comparison against base commit 10f2e13.

@github-actions
Copy link
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
13010 8513 65% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
backend/handler/filesystem/base_handler.py 90% 🟢
backend/handler/filesystem/roms_handler.py 78% 🟢
TOTAL 84% 🟢

updated for commit: 8a56e9b by action🐍

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request successfully addresses the requirement for region and language shortcodes to be case-sensitive. The changes in backend/handler/filesystem/base_handler.py correctly update the REGIONS_BY_SHORTCODE and LANGUAGES_BY_SHORTCODE dictionaries to store keys with their original casing. The corresponding updates in backend/handler/filesystem/roms_handler.py generally align with this change by using raw_tag for case-sensitive shortcode lookups and lower_tag for case-insensitive full name lookups. A minor logical issue was identified in the handling of region prefixes, which could lead to incorrect parsing for shortcode values extracted by the REGION_TAG_REGEX.

@gantoine gantoine merged commit 445bd92 into master Feb 18, 2026
8 checks passed
@gantoine gantoine deleted the romm-3026 branch February 18, 2026 22:43
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.

[Bug] "Nl" language tag in file name is reported as Region "Netherlands" instead of language "Dutch" in the UI

1 participant

Comments