Naming a function for provided localized strings
I'm putting together a list of function names for a function which would return back a localized string for a website I am working on. I'm still undecided what would be a good name for this function. My two goals are two try and make it as short as possible as I will have to replace tons of hardcoded text embedded in HTML but make it intuitive enough that new developers would understand what it is meaning. 开发者_高级运维 In many ways I think this is a personal preference but I am curious to hear what all of you folks would do.
Here's some example function calls of what I am looking at right now...
// This would return "Hello" for english, "Bonjour" for french
LangString("Hello")
// Same as above just different function name
LSTR("Hello")
I am working in HTML and embedded classic ASP/VBscript
I'd just use tr
for translate. It's short, doesn't muddle the context too much, and it has a pretty universal meaning.
Qt and Unix use tr
, at any rate, so it's not really a proprietary naming scheme.
精彩评论