Oddbean new post about | logout

Notes by 1fb598bc | export

 nostr:npub1wtsfwre3sf5y9fcv4n2r85ddlc8j68mh5f9jycmc9639qx9k704q43ld0t nostr:npub1y8cxmyrycwykgswx... 
 @096d2c53 @21f06d90 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 
 nostr:npub1wtsfwre3sf5y9fcv4n2r85ddlc8j68mh5f9jycmc9639qx9k704q43ld0t nostr:npub1y8cxmyrycwykgswx... 
 @096d2c53 @21f06d90 LocalizedStringResource can either be initialized with a raw [static] string, .init(aRawString), or .init(aLocalizationValue).
Would the latter one work? 
 nostr:npub1p9kjc5uauqdfphar82xmq573tf3hnh3mcugkw3t6mjg2y76xkd3sum865w Pretty sure that's a no, be... 
 @21f06d90 @096d2c53 Exactly but it should work if you can make `name` a String.LocalizationValue