Oddbean new post about | logout
 nostr:npub1p9kjc5uauqdfphar82xmq573tf3hnh3mcugkw3t6mjg2y76xkd3sum865w nostr:npub1y8cxmyrycwykgswx54jxl333zyu5jk5wmh9carpm6tv5uh48fxrq80ycms Using a switch as you did is great to benefit automatic localization export (especially with String Catalog), and detecting that let’s say a new flavor introduced later doesn’t get forgotten for localization.

For automatic export, the compiler needs the string to be declared as a raw string somewhere (or inferred).

I’d use the fact that LocalizedStringResource & String.LocalizationValue are ExpressibleByStringLiteral.

https://files.mastodon.social/media_attachments/files/111/173/756/513/003/073/original/7275c8341d29cbe1.png