[[Module:scripts]]
We can add lookup_script, similar to lookup_language, to Module:language utilities. I think data of scripts and languages should be in one module, we need both of them in almost all entries.
It's actually pretty rare to need the script name currently. Not that many entries need it.
Yes... my mistake. Should we create a utility module for it? We only need one function.
I think we can add it to the language utilities module. Small modules have a relatively large overhead, because they have to be retrieved from the database.
What about having one single function for both purposes, this way we can avoid duplication.
We can detect if the input is the code of a language or a script, from its first letter. But by merging Module:scripts to Module:languages, lookup_language doesn't need to know that, so we can use lookup_language for looking up both languages and scripts.
I think we should rather focus on speed. lookup_language is a very heavily used function, so we should try to keep it fast. String pattern/search operations would slow it down. I know that it can be useful to make "smart" functions, but it's easy to overdo it...
I actually meant we should merge Module:scripts to Module:languages, the data in Module:scripts is relatively small.