Skip to content

test(i18n): cover ParseLocale cases#1293

Open
superShen0916 wants to merge 1 commit into
floatpane:masterfrom
superShen0916:test/parse-locale-cases
Open

test(i18n): cover ParseLocale cases#1293
superShen0916 wants to merge 1 commit into
floatpane:masterfrom
superShen0916:test/parse-locale-cases

Conversation

@superShen0916
Copy link
Copy Markdown

@superShen0916 superShen0916 commented May 15, 2026

What?

Adds table-driven tests for ParseLocale covering:

  • plain, hyphenated, and underscored English locale inputs
  • fallback behavior for an unregistered language
  • invalid empty and malformed locale inputs

Why?

ParseLocale is a small public i18n helper with no dedicated tests. The new tests lock down locale normalization, fallback direction, and invalid-input behavior before more locale work is added.

Fixes #1075

Tests

  • go test ./i18n
  • go test ./...

Signed-off-by: superShen0916 <superShen0916@users.noreply.github.com>
@superShen0916 superShen0916 requested a review from a team as a code owner May 15, 2026 13:02
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Hi @superShen0916! Please fix the following issues with your PR:

  • Body: Missing the ## What? or ## Why? headings required by the PR template.

@floatpanebot floatpanebot added bug Something isn't working size/M Diff: 51–200 lines area/i18n Localization / translations labels May 15, 2026
@floatpanebot floatpanebot dismissed their stale review May 15, 2026 13:03

Formatting issues have been resolved. Thank you!

@andrinoff
Copy link
Copy Markdown
Member

@superShen0916 You added no RTL test case, please add the test.

Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

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

review comment above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/i18n Localization / translations bug Something isn't working size/M Diff: 51–200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: Add unit tests for i18n/locale.go

3 participants