Add missing l18n wrapper to ‘⚠Invalid Handle’ in handles.ts (#11071)
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
// Regex from the go implementation
|
// Regex from the go implementation
|
||||||
// https://github.com/bluesky-social/indigo/blob/main/atproto/syntax/handle.go#L10
|
// https://github.com/bluesky-social/indigo/blob/main/atproto/syntax/handle.go#L10
|
||||||
|
import {i18n} from '@lingui/core'
|
||||||
|
import {msg} from '@lingui/core/macro'
|
||||||
|
|
||||||
import {forceLTR} from '#/lib/strings/bidi'
|
import {forceLTR} from '#/lib/strings/bidi'
|
||||||
|
|
||||||
const VALIDATE_REGEX =
|
const VALIDATE_REGEX =
|
||||||
@@ -32,7 +35,7 @@ export function sanitizeHandle(
|
|||||||
): string {
|
): string {
|
||||||
const lowercasedWithPrefix = `${prefix}${handle.toLocaleLowerCase()}`
|
const lowercasedWithPrefix = `${prefix}${handle.toLocaleLowerCase()}`
|
||||||
return isInvalidHandle(handle)
|
return isInvalidHandle(handle)
|
||||||
? '⚠Invalid Handle'
|
? i18n._(msg({message: `⚠Invalid Handle`}))
|
||||||
: forceLeftToRight
|
: forceLeftToRight
|
||||||
? forceLTR(lowercasedWithPrefix)
|
? forceLTR(lowercasedWithPrefix)
|
||||||
: lowercasedWithPrefix
|
: lowercasedWithPrefix
|
||||||
|
|||||||
Reference in New Issue
Block a user