Live data from Hacker News

Why internationalization of commands is a very bad idea

gist.github.com

31–40 of 52 posts

Re: Why internationalization of commands is a very bad idea

#31
post #2

just export LANG=C... oh, right, microsoft...

In PowerShell you do the following: New-PSSessionOption -Culture=de-DE Might be worthwhile looking up the PowerShell reference before making comments like that...

Sure, but how long is this solution available and in how many years do you think it will be deprecated? Getting a bit offtopic though.

Re: Why internationalization of commands is a very bad idea

#33
post #31

Earlier quoted context omitted.

In PowerShell you do the following: New-PSSessionOption -Culture=de-DE Might be worthwhile looking up the PowerShell reference before making comments like that...

Sure, but how long is this solution available and in how many years do you think it will be deprecated? Getting a bit offtopic though.

Since at least 2.0: https://technet.microsoft.com/en-us/library/hh849703%28v=wps...

It was probably even in 1.0 but MSDN doesn't contain documentation for old software.

Re: Why internationalization of commands is a very bad idea

#36
post #27
post #22

Earlier quoted context omitted.

There really should be a "Falsehoods programmers believe about languages". One entry would be: * All languages have the word "yes".

That's actually an interesting point. Indeed, how works internalization for Irish, for example? I mean some big international app, like Windows or something. I don't think it's trivial to customize some internal "yes/no" dialog in Windows to use different words for every question, but only for some languages.

It probably helps that dialogs usually use "ok"/"cancel" rather than "yes"/"no". Chinese, for example, doesn't really have a word for "yes", but it does have a word/phrase meaning basically "ok" ("好的"), which is what's used on windows for those dialogs.

Re: Why internationalization of commands is a very bad idea

#37
post #20

Earlier quoted context omitted.

Could you explain the argument to me a bit more? Because the way I am reading your comment and the code is that doing this localization is a pain in the ass (therefore also extremely easy to screw up and not notice), and therefore 'a very bad idea.' However it seems like you would write a library that was basically a collection of user command/language/machine command triplets, expanding the library as you needed new…

The problem is that sometimes the command is being run directly by a human at the keyboard, and sometimes it's being run as part of a program. And it doesn't really have a way to know which. Localizing the former is fine, but the latter is bad. In short, if you write a script that uses /Y to indicate "yes" as an option to a command, then that script will fail on computers which are set to a language where /Y doesn't…

> If you can solve the problem of differentiating between direct human interaction and running a program, this would be a lot better.

This is already solved to an extent in the Unix world by providing the ability for a program to detect whether its standard input/output is wired to an interactive terminal. This is how, for example, many Unix programs detect whether they're being piped into another program and to therefore be more strict about their output.

Re: Why internationalization of commands is a very bad idea

#38
This problem also applies to MediaWiki. They decided to internationalize pretty much everything, too. Not only functions are translated; the functionality of some URL parts also depends on the language - and you'll get a lot of duplicates when more languages are enabled.

Re: Why internationalization of commands is a very bad idea

#39
Two semi-related random facts:

- keyboard shortcuts in Windows also sometimes differ depending on locale (for instance, in Spanish version of Notepad shortcut for "save" is CTRL-G, from "guardar", instead of CTRL-S like "save")

- output of some command-line utilities is inconsistent between versions of Windows (XP, 7 etc): sometimes it delimits stuff by tabs, sometimes by whitespaces etc.

Re: Why internationalization of commands is a very bad idea

#40
post #24

Earlier quoted context omitted.

That's one potential problem, yes. For your solution of running through the same mapping library on both ends, that works, but it transforms the scripting language into something dramatically different from writing commands on the command line. The beauty of shell scripting (and, I would argue, the only thing that even makes it worth doing at all) is that you write the same commands in the script that you would write…

So another dumb question, how do we get from it being a very bad thing in shell scripting to it being a very bad thing in general as the post states? By the way thank you again for taking the time to answer my questions, I do appreciate it as these are honestly things I am wondering. I seem to be getting down voted because I am so stupid, but at least you are helping me learn to be less stupid on this subject (which…

I don't see any dumb questions on your part. Maybe some differences of opinion. Don't ask me about the downvotes. I personally only downvote stuff that's deeply counterproductive. But it seems other people are more twitchy with them.

Anyway, I take the post as just saying that internationalization is bad for shell commands, not necessarily for other things.

Shell commands are unusual in that they are both a programming interface and a human interface. That puts strange constraints on them that don't show up elsewhere. For things that are clearly just a human interface (for example, a GUI app) you definitely want to localize. For things that are clearly just a computer interface (for example, a REST API) you definitely don't want to. But how do you deal with something like this where it's half and half? Trying to optimize for one use case can hurt the other, which is what this post is trying to show.

Post reply on HN