Skip to content

Fix alert normalization - #91

Merged
VirgilClyne merged 2 commits into
NSRingo:devfrom
shindgew:fix/alert-normalization
Aug 11, 2026
Merged

Fix alert normalization#91
VirgilClyne merged 2 commits into
NSRingo:devfrom
shindgew:fix/alert-normalization

Conversation

@shindgew

Copy link
Copy Markdown
Contributor

Fixes #90

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d224db7d91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +855 to +856
const issues = title.match(/^.+?\s+issues?\b\s*[::]?\s*(.+)$/i);
return issues?.[1] ? WeatherAlerts.#NormalizeTranslatedEnglishAlertTitle(issues[1]) : WeatherAlerts.#TrimWeatherAlertTitle(structuredTitle || title);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve non-English localized alert headlines

For QWeather requests using supported languages other than Chinese or English (for example ja, or passthrough locales such as de), localized headlines generally contain neither 发布 nor issues/issued. This fallback therefore selects the nonempty phenomenon instead of title, discarding the full localized headline and qualifiers such as the warning level; both WeatherAlerts.Build and mergeAlerts now expose only the generic event type. Fall back to the original title when no recognized issuer grammar matched, using phenomenon only when the title is empty.

Useful? React with 👍 / 👎.

@VirgilClyne
VirgilClyne changed the base branch from main to dev August 11, 2026 06:25
@VirgilClyne
VirgilClyne merged commit 48aa12e into NSRingo:dev Aug 11, 2026
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.

Preserve international alert titles, language, and attribution

2 participants