Multi-lingual Challenge

6 languages, 169 bytes

Expects 0\n or 1\n as input, and prints words in:

  • Python 2 (Dutch vals/waar),
  • Python 3 (French faux/vrai),
  • Ruby (English false/true),
  • CJam (Norwegian usant/sant),
  • Golfscript (Danish usand/sand),
  • Befunge-93 (Italian falso/vero).

"#{puts gets>?1;exit}"" "#"& 1v
""
print('vwfvaaarlauasrxi'[int(1/2*4+int(input()))::4])
""#";;;;ri"u">"sant"+o
""""
__END__
]0=~"u">"sand"""#@,,,,"vero"  _"oslaf",,,,,@

All the Funges, 6 languages, 146 bytes

Now in 3D!

A vv"faux"0"vrai"mv#<v&#;9*j"kslaf"6j"etke">:#,_@;
; >"otreic"0"oslaf"v^<
&^>"murev"0"muslaf">
&^&<"false"0"true"<
>_>:#,_@
^_^

For clarity I've separated the two planes of code so you can see how they're layered. On disk these two blocks would be separated with a form feed character at the end of the line above.

   h"vals"0"waar"<

The rules did say different versions of a language count as separate languages, so this one is six versions of Funge/Befunge. :)

  • Befunge-93 (Spanish - cierto/falso) Try it online!
  • Befunge-96 (Latin - verum/falsum) Try it online!
  • Befunge-97 (French - vrai/faux) Try it online!
  • Befunge-98 (English - true/false) Try it online!
  • Unefunge-98 (Norwegian - ekte/falsk)
  • Trefunge-98 (Dutch - waar/vals)

Thanks to Dennis, all of the Befunge versions can now be tested online at TIO. There aren't currently working implementations of the Unefunge and Trefunge variants, though, so for those I'd recommend Rc/Funge.

A is ignored in Befunge 93 and 96, but is the About Face command in 97 and is unsupported in 98 and thus reflects. This means that 93 and 96 follow the v downwards while 97 and 98 wrap around to the opposite side of the playfield.

In Befunge 96 a ; followed by space at the start of the line marks it as a comment, so that line is skipped and the interpreter continues to the > on the third line. In 93, though, the interpreter follows the > on the second line.

The 97/98 path continues on the first line from right to left, skipping over the section inside the ; comment markers, bridges the & command, eventually reaching the U-bend sequence v<^<. In Unefunge, these direction changes aren't supported so the interpreter reverses direction and executes the previously skipped section in the comments. In Befunge/Trefunge it continues to the left.

In Befunge 97 the m command is unsupported and thus skipped, so the interpreter continues along the first line. In 98 it's 3D-only so it reflects in Befunge (2D) and the interpreter follows the v to the right of it down to the fourth line. In Trefunge (3D) it's a High-Low branch which transfers up a level along the z-axis to the second plane.

So other than the Unefunge case, we have each version gathering their string pair from a separate line before being directed to one of the & commands to get the user input. Those code paths then all merge together via the ^ commands in the second column, directing the program flow upwards through the top of the playfield, wrapping around to the bottom again.

Finally we have the ^_^ sequence which decides which path to follow based on the user input. If 0, we go straight to the output sequence (>:#,_) writing out the false string. If 1, we first execute >_ which clears the first string off the stack, and thus output the true string.


Dyalog APL, 243 237 bytes: 14 languages, extendable to 131*

-6 bytes thanks to Soaku.

Requires ⎕IO←0 which is default on many systems. Prompts for input of 0 or 1.

((⎕AV⍳'ëáàÆÅÄòðÓÈÇ')⍳⍎⎕D∩⍨4↑1⊃#⎕WG'APLVersion')⊃⎕⊃s¨⌽(s←{1↓¨⍵⊂⍨⍵=⊃⍵})';,true,adevarat,haqiqiy,otito,tunay,bener,prawda,dogru,vrai,that,wahr,vero,verdade,cierto;,false,fals,yolg''on,eke,mali,palsu,falsz,yanlis,faux,sai,falsch',18⍴',falso'

Depending on version (9.0 through 16.0, with minor versions) it outputs in English, Spanish, Portuguese, German, Vietnamese, French, Turkish, Italian, Polish, Sundanese, Filipino, Yoruba, Uzbek, or Romanian, although without diacritics.

⎕AV⍳'ëáàÆÅÄòðÓÈÇ' in the indices of the Atomic Vector (151 142 141 133 132 131 122 121 111 102 101 96)

((...)⍳...) find the position of

the evaluated

⎕D∩⍨ intersection of Digits and

4↑ the four* first characters of

1⊃ the second element of

#⎕WG'APLVersion' the version number

(...)⊃ then use that to pick among

⎕⊃ the input'th (0: first; 1: second) element of

the function s (which we will define shortly) applied to each of

the reverse of

(s←{...}) s applied to – where s is defined as

1↓¨ the first character dropped from each of

⍵⊂⍨ the argument partitioned where

⍵= the characters of the argument are equal to

⊃⍵ the argument's first character

';,true,adevarat,...,falsch', this string prepended to

18⍴',falso' eighteen characters taken cyclically from that string

* Since version 12.1, the version number includes build number, so by increasing the number of characters taken from this string, it is easy to cover all 131 Latin script languages.