Feature Request #3960
language code instead of number in language files
allow ##grflangid nl instead of ##grflangid 0x1F
Feature #3960: use language code instead of number as argument for ##grflangid pragma in language files (Alberth)
#1 Updated by Alberth about 1 year ago
- File fr3960.patch added
Patch adds all OpenTTD languages and their iso code.
#2 Updated by yexo about 1 year ago
"Invalid grflangid %r"
Is the %r an accident or does it have some meaning I'm not aware of? The rest of the patch looks good.
One could argue that allowing just "nl" instead of only "nl_NL" is good, but I'm currently not convinced either way.
#3 Updated by Alberth about 1 year ago
%s outputs str(x), the pretty-print version.
%r outputs repr(x), the technical version. The most striking difference is that strings get quoted and escaped, so you can see exactly what you have.
It is not essential though, '%s' could work too imho.
#4 Updated by Alberth about 1 year ago
I forgot about the 'nl'. I thought about it but did not get to a good conclusion. Technically, you can just add more entries in the dictionary, and they will be found properly. The trouble however is which language to add. There are 3 english languages, or 2 prtugese ones. I see no sane way to decide which language should get 'preference', so I omitted the short hands entirely.
It is bad in the sense you still need to dig in the manual to know which language code to add, but you are always precise in what you mean, and at least it is now more readable than it was.