Skip to content

E/fix experimental locale res#855

Merged
ErnestM1234 merged 3 commits intomainfrom
e/fix-experimental-locale-res
Dec 4, 2025
Merged

E/fix experimental locale res#855
ErnestM1234 merged 3 commits intomainfrom
e/fix-experimental-locale-res

Conversation

@ErnestM1234
Copy link
Copy Markdown
Contributor

No description provided.

@ErnestM1234 ErnestM1234 requested a review from a team as a code owner December 4, 2025 02:13
Copy link
Copy Markdown
Contributor

@SamEggert SamEggert left a comment

Choose a reason for hiding this comment

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

lgtm

@ErnestM1234 ErnestM1234 merged commit a46a1ff into main Dec 4, 2025
15 checks passed
@ErnestM1234 ErnestM1234 deleted the e/fix-experimental-locale-res branch December 4, 2025 02:16
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Dec 4, 2025

Greptile Overview

Greptile Summary

This PR removes an unused import after a previous fix that switched from using the standalone isValidLocale function to the GT instance method that properly handles custom locale mappings.

  • The previous commit (d07c425) fixed experimental locale resolution to account for custom locales by calling gt.isValidLocale() instead of the imported isValidLocale() function
  • This PR cleans up by removing the now-unused import from generaltranslation
  • The GT instance method correctly uses the configured customMapping from the I18NConfiguration, ensuring custom locales are properly validated

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • This is a straightforward cleanup PR that only removes an unused import. The actual logic change was made in a previous commit (d07c425), and this PR simply removes the orphaned import statement. No functional changes are introduced.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
.changeset/beige-readers-drop.md 5/5 Standard changeset file documenting the patch-level fix for experimental locale resolution validation
packages/next/src/request/utils/getRequestFunction.ts 5/5 Removed unused isValidLocale import after switching to GT instance method that properly handles custom locale mappings

Sequence Diagram

sequenceDiagram
    participant Caller
    participant getRequestFunction
    participant handleExperimentalLocaleResolution
    participant getRootParam
    participant getI18NConfig
    participant I18NConfiguration
    participant GT

    Caller->>getRequestFunction: getRequestFunction('getLocale')
    getRequestFunction->>getRequestFunction: Check experimental flag
    alt Experimental Locale Resolution Enabled
        getRequestFunction->>handleExperimentalLocaleResolution: Handle getLocale request
        handleExperimentalLocaleResolution->>getRootParam: Get unverified locale from env
        getRootParam-->>handleExperimentalLocaleResolution: Return unverifiedLocale
        handleExperimentalLocaleResolution->>getI18NConfig: Get I18NConfig instance
        getI18NConfig-->>handleExperimentalLocaleResolution: Return I18NConfig
        handleExperimentalLocaleResolution->>I18NConfiguration: getGTClass()
        I18NConfiguration-->>handleExperimentalLocaleResolution: Return GT instance
        handleExperimentalLocaleResolution->>GT: isValidLocale(unverifiedLocale)
        Note over GT: Uses customMapping from config
        GT-->>handleExperimentalLocaleResolution: Return validation result
        alt Valid Locale
            handleExperimentalLocaleResolution-->>Caller: Return locale
        else Invalid Locale
            handleExperimentalLocaleResolution-->>Caller: Return undefined
        end
    end
Loading

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@github-actions github-actions bot mentioned this pull request Dec 4, 2025
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.

3 participants