8 ms·
Why internationalization of commands is a very bad idea
- krispyfi 11y agojust export LANG=C... oh, right, microsoft...
- krallja 11y agoCould write a function to execute a command in the InvariantCulture: http://stackoverflow.com/questions/4105224/how-to-set-culture-in-powershell http://stackoverflow.com/questions/4105224/how-to-set-cultur...
- chris_wot 11y agoIn PowerShell you do the following: New-PSSessionOption -Culture=de-DE Might be worthwhile looking up the PowerShell reference before making comments like that...
- Drdrdrq 11y agoSure, 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 11y agoSince at least 2.0: https://technet.microsoft.com/en-us/library/hh849703%28v=wps.620%29.aspx 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.
- chris_wot 11y agoI'm afraid I was very much on point.
- rurban 11y agoAnd soon also properly gendered
- davesque 11y agoGuys, 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.
- klodolph 11y agoI 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.
- officialchicken 11y agoNo, 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.
- astrodust 11y agoIt's a terrible idea unless you can force the command to accept arguments in a specific language. Do you expect someone to iterate all the possible variants of "yes"?
- officialchicken 11y agoWith the proper support libraries, Da/Yes/Ha/Ja/etc/etc/etc it's trivial.
- delluminatus 11y agoWhat support libraries would you recommend?
- im3w1l 11y agoThere really should be a "Falsehoods programmers believe about languages". One entry would be: * All languages have the word "yes".
- krick 11y agoThat'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.
- Epenthesis 11y ago
- vbnmvbnmvbnm 11y agoSo, interpreting a wide variety of character arrays as corresponding boolean values, is a bad idea?
- Zikes 11y agoWouldn't /f, /R, and /D also need i18n'd in this scenario?
- lost_name 11y agotakeown.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.
- jameshart 11y agoRan 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 11y agoIn my language, there isn't No, there is only "YES" and "MAYBE".
- bradbeattie 11y agoMind pointing out which one? http://www.omniglot.com/language/phrases/yesnomaybe.htm http://www.omniglot.com/language/phrases/yesnomaybe.htm
- bryanlarsen 11y agoPerhaps Japanese. The meaning of "Hai" is more like "true" than "yes".
- mchahn 11y agoHai means neither true, yes, or no. It only means "I have heard you". This trips up many westerners.
- hiq 11y agoCould be Japanese, depending on the situation. http://www.japanese-language.aiyori.org/article6.html http://www.japanese-language.aiyori.org/article6.html
- dalke 11y agoThe 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'.
- yk 11y agoThat 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 11y agoThat was exactly my point.
- Fannon 11y agoThis 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 11y agoCare 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?
- jakub_g 11y agoTwo 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.