Alternative answer
If two keyboard layouts don't differ by many symbols, you could add Alt-modifiers for the foreign language (say, standard US Layout symbols on the Alt layer of a German keyboard) with a utility like AutoHotKey or similar.
Or, create a keymap for the OS which is the more correct way of doing it.
- never have to switch and wonder which language is active (can be very distracting)
- you may access the Alt layer often and this slows down your flow.
For some European languages, you could move characters permanently, instead of having a layer.
For example, [] and {} to Alt/Shift combos of () and [];:'" to keys near üäö, allowing you to keep an almost normal US layout for coding and make room for your languages' characters in the spots where they usually reside.
2Problem with this is, it only offers 3 options, one of which is not on the same key on both layouts... The other option is to set a different key for each language, but it requires a modifier combo. Not ideal. – Henrik Erlandsson – 2016-10-21T17:35:09.120