In addition to context, another consideration is refactoring ... IE: over time, you may change the text, even in the primary language. If that be the case, your message will not match your key anymore (unless you change your code ... which seems counterproductive).
I tend to use keys like: SessionView.greeting="Hello"; It is contextual (SessionView) and it tells me what I'm doing on that view (greeting). It might be "Hi" and then changed on subsequent releases to "Hello" or possibly "Greetings Earthling". I also might have more common things like Global.cancel="Cancel"; I consider the key itself just another type of var. It's also about being lazy (in a positive way). Using symbols allows you think less about it while you're coding. IE: it matters less what the literal text is while you're coding ... you just know you want a greeting there. Later on, you can hand it over to a language expert or focus and update any phrases that don't seem to fit. I think that requiring the key to match the phrase in the primary language actually introduces a subtle dependency. I prefer to code in a way that is easier to refactor or change. Using 'symbols' or instead of literal strings seems to do just that. If the question were not "symbols" vs "literals" and instead were, how can you leverage symbolic keys? ... see where that takes you. On Fri, Aug 6, 2010 at 11:19 AM, Mark Ritchie <mark.ritc...@mac.com> wrote: > Hey Richard! > > On 6/Aug/2010, at 8:50 AM, Richard Somers wrote: > > It appears that literal keys would easier to translate because no cross > referencing would be required. Why then are symbolic keys also used? > > I think it's a matter of choosing what works best for your workflow and all > parties involved. However you do it, the context of the phrase needs to be > imparted to the translator so that the translation is contextually relevant. > > I also think that some developers are prone to using uppercase keys since > that's what's reported and displayed when the NSShowNonLocalizedStrings user > default is turned on. > > YMMV as I think there is no one way to do localizations! > M. > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/lutherbaker%40gmail.com > > This email sent to lutherba...@gmail.com > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com