Skip to content

i18n: Localize notification-channel names - #6195

Open
eliotcougar wants to merge 1 commit into
2dust:masterfrom
eliotcougar:fix/notification-channel-localization
Open

eliotcougar wants to merge 1 commit into
2dust:masterfrom
eliotcougar:fix/notification-channel-localization

Conversation

@eliotcougar

Copy link
Copy Markdown
Contributor

Replace hard-coded channel labels with dedicated resource names for the main service, subscription updates, and connection checks in all nine supported locales. Resolve names through AppLocaleManager for service and application contexts.

Reuse the existing channel when refreshing its localized name, preserving channel IDs and user-controlled importance, sound, vibration, and visibility. Apply initial defaults only to newly created channels and remove the obsolete hard-coded service-channel name.

@eliotcougar

Copy link
Copy Markdown
Contributor Author

Compatibility note for #6204: the two branches currently have a content conflict in NotificationHelper.kt. This is a small integration issue rather than a behavioral contradiction.

Preferred reconciliation: merge/rebase this channel-localization PR first, then rebase #6204 and have its transient-message channel use ensureNotificationChannel(...) with R.string.notification_channel_other. #6204 should retain its notification-permission checks, posting, timeout, and cancellation behavior. The locale XML changes merge cleanly.

Replace hard-coded channel labels with dedicated resource names for the main service, subscription updates, and connection checks in all nine supported locales. Resolve names through AppLocaleManager for service and application contexts.

Reuse the existing channel when refreshing its localized name, preserving channel IDs and user-controlled importance, sound, vibration, and visibility. Apply initial defaults only to newly created channels and remove the obsolete hard-coded service-channel name.

Extract channel localization from local/talkback-all-10 without adding its transient-message channel, snackbar fallback, or accessibility announcement infrastructure.
@eliotcougar
eliotcougar force-pushed the fix/notification-channel-localization branch from 7b88da8 to bf7a002 Compare September 10, 2026 07:41
@2dust

2dust commented Sep 11, 2026

Copy link
Copy Markdown
Owner

这个完全没有必要,特别是在 NotificationChannelType 还加入了 string 。

@eliotcougar

Copy link
Copy Markdown
Contributor Author

这个完全没有必要,特别是在 NotificationChannelType 还加入了 string 。

I'm not sure I understand what you mean. This PR makes notification channel names localized in the Android notification settings. Right now they are always in English.

This PR follows the Android guidelines for localized notification channel names. If the user changes the OS language, the notification channel should change without resetting the notification channel preferences (sound, vibration, importance, etc)

@eliotcougar

Copy link
Copy Markdown
Contributor Author

Perhaps I explained the scope poorly. These are the channel names users see in Android Settings → Apps → v2rayNG → Notifications, not internal identifiers or notification message text.

NotificationChannelType already contained hard-coded English names. This PR replaces those names with translated string-resource references. Channel IDs remain unchanged.

Would you prefer keeping the resource mapping in NotificationHelper instead of the enum?

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.

2 participants