Bluesky app fork with some witchin' additions 💫

Fix i18n string interpolation for device name (#9806)

Use a separate translatable string for "Media stored on another device"
instead of interpolating a translated fragment into another string.
This allows translators to properly handle the complete sentence for
languages with different grammar structures.

https://claude.ai/code/session_01TJMLcXE9HHneEXMEBJqL4u

Co-authored-by: Claude <noreply@anthropic.com>

authored by samuel.fm

Claude and committed by
GitHub
864af57f ab981302

+15 -17
+15 -17
src/view/com/composer/drafts/DraftItem.tsx
··· 45 45 mediaExistsOnOtherDevice || 46 46 draft.meta.hasQuotes 47 47 48 - const deviceName = useMemo(() => { 48 + const isUnknownDevice = useMemo(() => { 49 49 const raw = draft.draft.deviceName 50 - let name = raw 51 50 switch (raw) { 52 51 case device.FALLBACK_IOS: 53 52 case device.FALLBACK_ANDROID: 54 53 case device.FALLBACK_WEB: 55 - name = _( 56 - msg({ 57 - message: `another device`, 58 - comment: `Prefixed with "This media is stored on...". Example: "This media is stored on another device"`, 59 - }), 60 - ) 61 - break 54 + return true 55 + default: 56 + return false 62 57 } 63 - return name 64 - }, [_, draft]) 58 + }, [draft]) 65 59 66 60 const handleDelete = useCallback(() => { 67 61 onDelete(draft) ··· 115 109 {mediaExistsOnOtherDevice && ( 116 110 <DraftMetadataTag 117 111 icon={WarningIcon} 118 - text={_( 119 - msg({ 120 - message: `Media stored on ${deviceName}`, 121 - comment: `This media is stored on... Example: "This media is stored on John's iPhone"`, 122 - }), 123 - )} 112 + text={ 113 + isUnknownDevice 114 + ? _(msg`Media stored on another device`) 115 + : _( 116 + msg({ 117 + message: `Media stored on ${draft.draft.deviceName}`, 118 + comment: `Example: "Media stored on John's iPhone"`, 119 + }), 120 + ) 121 + } 124 122 /> 125 123 )} 126 124 {mediaIsMissing && (