3 ms·
> a) sometimes the same sentence is used in two areas and has the same translation in one language I suspect it's not that rare of a thing, it would explain at
by TeMPOraL 11y ago
> a) sometimes the same sentence is used in two areas and has the same translation in one language
I suspect it's not that rare of a thing, it would explain at least some of the bad translation cases I've seen, that are the reason I never use software in my native language if I can avoid it.
> b) if you change the text wording later, you have to edit it in the source code instead of in a separate English locale file.
And, if I understand correctly, in every other locale file too. This tingles my DRY sense in a bad way.
> You're doing something horrendously wrong if your application spends even 0.1% of its time looking up strings to put into GUI windows.
True. Though you can use this reasoning for pretty much every single thing in the source code, and this way lies Java and XML. Premature optimization may be bad, but I still try to always pick the faster option when it doesn't require too much work :).
- byuu 11y ago> And, if I understand correctly, in every other locale file too. This tingles my DRY sense in a bad way. Not as long as your locale file is ordered the same for each region. Then the index match on the English string tells you which line to read from. > Premature optimization may be bad, but I still try to always pick the faster option when it doesn't require too much work :) Certainly. It's definitely a balancing act. But I think I give up maybe ~5% total performance for a ~500% improvement in code clarity. Moving to Java and things like that would increase the overhead by an order of magnitude while probably not helping readability at all (maybe just a little.) Of course, if I were trying to parse a 20GiB text file, I'd probably be working on it via mmap() over a char* array :D