

Why internationalization of commands is a very bad idea - mkesper
https://gist.github.com/mkesper/173f0884f50e13c37a37

======
jameshart
Ran into something similar before on Windows with the permission system - The
name of the 'everyone' group is not fixed, and varies by locale. Unfortunately
not all windows commands accept SIDs, and you'll need to know the localized
name for the 'everyone' group to call them. Windows's troubled languagepack
journey and backwards compatibility shackles do mean that design decisions on
basic file-handling commands that were reasonable in 1995 look pretty dumb
now.

PowerShell _is_ making this better, but of course when you 'shell out' from
PSH to a legacy command you're stuck with its crappy commandline parsing which
is designed to be backwards compatible with batch files written 20 years ago.
The powershell way to do this (assuming 'set-owner' isn't built in to PSH) is
probably to end-run round takeown.exe and work with the shell win32 APIs
directly (or google for a cmdlet someone else has written that does that for
you).

------
meapix
In my language, there isn't No, there is only "YES" and "MAYBE".

~~~
bradbeattie
Mind pointing out which one?
[http://www.omniglot.com/language/phrases/yesnomaybe.htm](http://www.omniglot.com/language/phrases/yesnomaybe.htm)

~~~
hiq
Could be Japanese, depending on the situation.

[http://www.japanese-language.aiyori.org/article6.html](http://www.japanese-
language.aiyori.org/article6.html)

~~~
dalke
The account has a history.
[https://news.ycombinator.com/item?id=6225716](https://news.ycombinator.com/item?id=6225716)
and other comments from that account are consistent, and suggest a language
other than Japanese. And bradbeattie's own link points to a table which shows
that languages other than Japanese also have no direct translation for 'yes'.

------
klodolph
I was thinking that this would just be about parsing command output, or
searching for error messages online (i.e. copy and paste an error message into
Google) but this is beyond stupid.

------
Fannon
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.

~~~
mormegil
Care to expand on that? The API is not i18ned (apart from the content,
obviously), the only thing vaguely similar to what you wrote which I can see
are the names of the special pages. But even though they are translated into
the wiki content language, on input, every wiki accepts the English version as
well. Also, the canonical identifier is present in the page for scripts to
use. Or, what problems do you have?

------
Zikes
Wouldn't /f, /R, and /D also need i18n'd in this scenario?

~~~
lost_name
takeown.exe, which takes ownership of a file in some circumstances, will give
a Y/N prompt when the contents of a directory cannot be listed. The parameters
"/D Y" will default the answer to yes.

The script in the link is considering what the prompt might ask for, not what
the parameters of the program are. If the full thing was internationalized,
the script might as well have language specific versions as well, I think.

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

~~~
chris_wot
In PowerShell you do the following:

New-PSSessionOption -Culture=de-DE

Might be worthwhile looking up the PowerShell reference before making comments
like that...

~~~
Drdrdrq
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.

~~~
cremno
Since at least 2.0: [https://technet.microsoft.com/en-
us/library/hh849703%28v=wps...](https://technet.microsoft.com/en-
us/library/hh849703%28v=wps.620%29.aspx)

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

------
jakub_g
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.

------
yk
That is horrible code, there is not just _de-de_ but also _de-at_ and _de-ch_
and _fr-fuck-it-I-will-not-look-it-up_ etc. And the program should treat all
equally. ( I would suggest equally badly.)

~~~
mkesper
That was exactly my point.

------
vbnmvbnmvbnm
So, interpreting a wide variety of character arrays as corresponding boolean
values, is a bad idea?

------
rurban
And soon also properly gendered

~~~
davesque
Guys, I'm pretty sure he's talking about gender-inflected languages and not
making a sexist statement. Step away from the down-arrow and move on.

------
officialchicken
No, it's not a bad idea, and these 4 lines of bash script contain no solid
reasoning, argument, or business logic as to why helping the other 80% of the
world's population is a very bad idea.

Doing internationalization without support libraries is a very bad idea, as
this sample code helps illustrate.

~~~
mikeash
I'm pretty sure that's not bash.

In any case, the script makes a cogent and concise argument. That argument is
that command line options are not just a human interface, but also a machine
interface, and localization of machine interfaces leads to pain and
catastrophe.

You certainly don't have to agree with that argument, but it's there.

~~~
officialchicken
Sure, any naive implementation will lead to pain and catastrophe. But I don't
buy that this is a cogent and concise argument to NOT do it.

~~~
mikeash
What does the non-naive implementation look like? You say "support libraries"
but what sort of support do they provide for the machine-interface scenario?
How do they avoid problems such as forgetting to put a switch through the
libraries and ending up with code that only works in some localizations?

~~~
chris_wot
The non-naive version sets the PowerShell culture/Bash locale before it runs
anything.

~~~
mikeash
That works, but it also means that non-English speakers have to learn
everything twice.

~~~
chris_wot
Not sure I see the point you are attempting to make.

~~~
mikeash
The great thing about shell scripting is that you use the same commands for
interactive use and scripting. If interactive use is localized but scripting
is not then that no longer applies.

~~~
chris_wot
You add the locale to your script and the problem goes away. You still haven't
explained how that's a problem.

