Translate your English source code into a foreign language
Python, Koine Greek - Πύθων
My favorite programming language, in my favorite foreign language--perfect! And it doesn't hurt that the name is already Greek.
The translator program in Python 3 (thank goodness for native Unicode support):
with open(__file__, encoding=&quot;utf-8&quot;) as f:
    code = f.read()

replacements = [
    (&quot;print&quot;, &quot;γραψάτω&quot;),
    (&quot;input&quot;, &quot;λαβέτω&quot;),
    (&quot;read&quot;, &quot;ἀναγνώτω&quot;),
    (&quot;open&quot;, &quot;ἀνεῳξάτω&quot;),
    (&quot;file&quot;, &quot;βιβλίον&quot;),
    (&quot;import&quot;, &quot;εἰσενεγκάτω&quot;),
    (&quot;encoding&quot;, &quot;τύπος&quot;),
    (&quot;code&quot;, &quot;λόγοι&quot;),
    (&quot;replacements&quot;, &quot;νεόλογοι&quot;),
    (&quot;location&quot;, &quot;τόπος&quot;),
    (&quot;old&quot;, &quot;παλαιόν&quot;),
    (&quot;new&quot;, &quot;νέον&quot;),
    (&quot;find&quot;, &quot;εὑρέτω&quot;),
    (&quot;replace&quot;, &quot;ἀλλαξάτω&quot;),
    (&quot;for&quot;, &quot;ἕκαστον&quot;),
    (&quot;while&quot;, &quot;ἐν τῷ&quot;),
    (&quot;elif&quot;, &quot;εἰ δὲ&quot;),
    (&quot;if&quot;, &quot;εἰ&quot;),
    (&quot;else&quot;, &quot;εἰ δὲ μή&quot;),
    (&quot;is not&quot;, &quot;οὐκ ἔστιν&quot;),
    (&quot;is&quot;, &quot;ἔστιν&quot;),
    (&quot;not in&quot;, &quot;οὐκ ἐν&quot;),
    (&quot;in&quot;, &quot;ἐν&quot;),
    (&quot;and&quot;, &quot;καὶ&quot;),
    (&quot;or&quot;, &quot;ἢ&quot;),
    (&quot;not&quot;, &quot;οὐ&quot;),
    (&quot;with&quot;, &quot;μετὰ&quot;),
    (&quot;as&quot;, &quot;ὡς&quot;),
    (&quot;re&quot;, &quot;ῥλ&quot;),
    (&quot;sys&quot;, &quot;σύς&quot;),
    (&quot;:&quot;, &quot;·&quot;),
    (&quot;ph&quot;, &quot;φ&quot;),
    (&quot;th&quot;, &quot;θ&quot;),
    (&quot;ch&quot;, &quot;χ&quot;),
    (&quot;ps&quot;, &quot;ψ&quot;),
    (&quot;a&quot;, &quot;α&quot;),
    (&quot;b&quot;, &quot;β&quot;),
    (&quot;c&quot;, &quot;κ&quot;),
    (&quot;d&quot;, &quot;δ&quot;),
    (&quot;e&quot;, &quot;ε&quot;),
    (&quot;f&quot;, &quot;φ&quot;),
    (&quot;g&quot;, &quot;γ&quot;),
    (&quot;h&quot;, &quot;&quot;),
    (&quot;i&quot;, &quot;ι&quot;),
    (&quot;j&quot;, &quot;ι&quot;),
    (&quot;k&quot;, &quot;κ&quot;),
    (&quot;l&quot;, &quot;λ&quot;),
    (&quot;m&quot;, &quot;μ&quot;),
    (&quot;n&quot;, &quot;ν&quot;),
    (&quot;o&quot;, &quot;ο&quot;),
    (&quot;p&quot;, &quot;π&quot;),
    (&quot;r&quot;, &quot;ρ&quot;),
    (&quot;s &quot;, &quot;ς &quot;),
    (&quot;s.&quot;, &quot;ς.&quot;),
    (&quot;s,&quot;, &quot;ς,&quot;),
    (&quot;s·&quot;, &quot;ς·&quot;),
    (&quot;s&quot;, &quot;σ&quot;),
    (&quot;t&quot;, &quot;τ&quot;),
    (&quot;u&quot;, &quot;ου&quot;),
    (&quot;v&quot;, &quot;ου&quot;),
    (&quot;w&quot;, &quot;ου&quot;),
    (&quot;x&quot;, &quot;ξ&quot;),
    (&quot;y&quot;, &quot;υ&quot;),
    (&quot;z&quot;, &quot;ζ&quot;)
    ]

for old, new in replacements:
    if old == &quot;for&quot;:
        location = 0
        while old in code[location:]:
            location = code.find(old, location)
            if code[location+3] != '&quot;':
                location = code.find(&quot;in&quot;, location)
                code = code[:location] + &quot;ἐκ&quot; + code[location+2:]
            else:
                location += 1
    code = code.replace(old, new)

print(code)

Results of running the code on itself (with the big translation list redacted):
μετὰ ἀνεῳξάτω(__βιβλίον__, τύπος=&quot;ουτφ-8&quot;) ὡς φ·
    λόγοι = φ.ἀναγνώτω()

νεόλογοι = [
    (&quot;γραψάτω&quot;, &quot;γραψάτω&quot;),
    (&quot;λαβέτω&quot;, &quot;λαβέτω&quot;),
    (&quot;ἀναγνώτω&quot;, &quot;ἀναγνώτω&quot;),
    ...
    ]

ἕκαστον παλαιόν, νέον ἐκ νεόλογοι·
    εἰ παλαιόν == &quot;ἕκαστον&quot;·
        τόπος = 0
        ἐν τῷ παλαιόν ἐν λόγοι[τόπος·]·
            τόπος = λόγοι.εὑρέτω(παλαιόν, τόπος)
            εἰ λόγοι[τόπος+3] != '&quot;'·
                τόπος = λόγοι.εὑρέτω(&quot;ἐν&quot;, τόπος)
                λόγοι = λόγοι[·τόπος] + &quot;ἐκ&quot; + λόγοι[τόπος+2·]
            εἰ δὲ μή·
                τόπος += 1
    λόγοι = λόγοι.ἀλλαξάτω(παλαιόν, νέον)

γραψάτω(λόγοι)

Koine Greek is 2000 years old, so it was fun translating programming terms. Here's a few of my favorites:

βιβλίον = &quot;scroll&quot; (file)
γραψάτω = &quot;write&quot; (print)
λαβέτω = &quot;take&quot; (input)
εἰσενεγκάτω = &quot;bring in&quot; (import)
τύπος = &quot;pattern, type&quot; (encoding)
λόγοι/νεόλογοι = &quot;words&quot;/&quot;new words&quot; (code/replacements)
ἕκαστον... ἐκ = &quot;each... from&quot; (for ... in)
εἰ... εἰ δὲ... εἰ δὲ μή = &quot;if... but if... but if not&quot; (if ... elif ... else)
ἐν τῷ literally means &quot;in the,&quot; but in certain contexts it can be an idiom for &quot;when, while&quot;
&quot;Regular expression&quot; became ῥήμα λογικόν, &quot;rational/reasonable saying&quot;; thus, the abbreviation re is ῥλ

Most of the words can be also found by searching on Wiktionary.
Some other salient features:

English programming uses a bunch of imperative verbs (print, read, replace). I suspect the ancient Greeks would feel a bit foolish talking to the computer like this, so I made them all third-person imperatives: &quot;it must print,&quot; &quot;it must read,&quot; &quot;it must replace.&quot;
Greek punctuation is a bit different from English. I didn't go overboard with this, because I'm not sure what to replace the square brackets and underscores with, but I did swap out colons for ano teleia or &quot;high period&quot; (·).
For words that aren't in the list, I made sure to transliterate all the lowercase letters too. There isn't always a straight one-to-one correspondence; so for example, utf turns into ουτφ--which sounds about like &quot;ootf&quot; if you try to pronounce it.

This still leaves a lot to be desired grammar-wise. Greek is a much more highly inflected language than English, and my code isn't nearly sophisticated enough to get all the cases and numbers right. For example, ἕκαστον παλαιόν, νέον ἐκ νεόλογοι ought to read ἐκ νεολόγων, with the object of the preposition in the genitive case. However, I'm not about to put that much time into this! The look is sufficiently Greek (at least to the untrained eye) and the high periods add a nice touch. All in all, I'm pretty satisfied with the results.