views:

18

answers:

1

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

+1  A: 

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.

Stefan Kendall
I like the shortness of it. Just realized this may be an issue as I am working with vbscript embedded in html. Could get confused with a <tr> tag. I forgot to mention this in my original post so you wouldn't have known that. I have since corrected!
Rob Segal
Meh, I'd still use tr. Wordiness in something so common would really get to me.
Stefan Kendall
Yeh you could be right. I'm going to think it over. Thanks for the suggestion.
Rob Segal