mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[PR #922] [MERGED] fix(i18n): correct usage of language str having underscore #1465
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#1465
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/binwiederhier/ntfy/pull/922
Author: @imkero
Created: 10/19/2023
Status: ✅ Merged
Merged: 10/19/2023
Merged by: @binwiederhier
Base:
main← Head:bugfix/language-with-underline📝 Commits (1)
ef45ea5fix(i18n): correct usage of language str having underline📊 Changes
2 files changed (+10 additions, -4 deletions)
View changed files
📝
web/src/app/utils.js(+8 -2)📝
web/src/components/App.jsx(+2 -2)📄 Description
Goal
Fix the JS exception in web app when user selects a language which name contains an underscore (e.g.,
zh_Hans).Exception Stack
Reason
Intl.DateTimeFormat expects kebab-case language name (e.g.,
zh-Hans), buti18n.languagein snake-case (e.g.,zh_Hans) was passed toIntl.DateTimeFormatdirectly, which causes a RangeError.Reproduce
zh_Hans(or another one which has an underscore in its name)Changes
_with-inlanguagelangattribute of<html>, replace_with-inlanguage🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.