I'm a big fan of online translators such as Google Translate and Linguee. They are great to translate single words and they are fast; faster than opening a dictionary! I use them all the time during my lessons. When a student neither knows how to say one word in French nor in English, I ask them to type it for me, I feed in into the translator and I give them back translation that I think fits best with the sentence they had started. I even use it when I (of all people!) forget how to say something in French. Yes, that happens! Frightening! But I think that's "normal" when you get comfortable in a second language, you sometimes stop thinking in your own mother tongue.
But, online translators have to be used sparingly. They are NO GOOD AT ALL at translating sentences. Why? Because they translate word-for-word. They don't know idioms, and they often fail to notice when 2 words should be combined together to create an entirely different meaning.
Take an example from a book I was reading. It's about teaching tricks to dogs. I randomly picked a short sentence: "Click as your dog rolls flat." If I put that into Google Translate, it becomes
Cliquez que votre chien roule à plat.
Not bad, there's only one mistake. "As" should have been “lorsque” (when), not “que” (that). But, if you don't know that, you better double check by putting the French translation into the translator and have it regurgitated in English again. This time, it's "Click your dog run flat." Right! One mistake and it's now gibberish. I bet a lot of instruction manuals have been translated that way.
Actually, I own one of those bad translation things. I went to my DIY shop in England and found this lovely key hooks set with French writing on it. I thought, how great for me! It reads:
LE JARDIN, les fleurs, les outils, les usines
Hang on! That means:
THE GARDEN, flowers, tools, factories.
That's weird! Then I got it. They meant to say "plants" but for some reasons, they translated "power plants". I thought it was hilarious, so I bought it, but if I was the translator I would be mortified. It's on my kitchen wall as a perpetual reminder of the danger of online translator.
Now, let's show you an example with an idiom. But first, let me clarify something. If you've just started to learn a second language, you may not know this: you use a lot of figures of speech when you speak. To soften up our thoughts, we use popular analogies. Take for example, "he shuffled off this mortal coil". Much nicer to say than "He died", but much more tricky to translate!! To get the same effect in French, one might say "il n'est plus" (he's no more) or "il a cassé sa pipe" (he broke his pipe) or something else entirely, depending on personal preferences.
If you put an idiom into an online translator, 3 things can happen:
1) You can be lucky! Sometimes expressions are very similar in both languages.
2) But more likely, it's utter nonsense: what you try to convey has no connections with the analogy used in French, or there isn't an idiom for such situation in French at all.
3) The expression will only be partly translated. That's what happened why I put "He shuffles off this mortal coil" into Google Translate, I got, for some reason,
Il mélange hors This Mortal Coil
(he mixes outside *English word* *English word**English word*).
If you take an expression like "Mum's the word", according to online translators, it's "maman est le mot". Say that to ANY French speakers and I'm fully convinced they won't get it. "What's mothers got to do with it, and which word are you talking about?" might be a natural response. In French, we may say, “Motus et bouche cousue" (Mostus is a latin word. The other bit means "and sewn lips") or "pas un mot !" (not one word!)
When you translate something containing idioms, first of all, spot it! That may seem funny, but you need to become aware that you do it. If you say something like "old hat", ask yourself: is this about hats at all? If the answer is no, it's an idiom. Secondly, rephrase it. Go back to the core meaning. But, if you really like idioms and would like to learn French equivalents, try a book called It's raining cats and dogs by Jean-Bernard Piat. It's not a book as such in fact, it's more like a long list (127 pages long) of idioms in French matched with their correct English counterparts. It's aimed for French speakers who want to learn English, but you can easily use it the other way around. It's loosely sorted by subjects like: food, health, love, etc. I think this kind of reading is probably best for B2 level student and over.
I would like to leave you with this very good word of advice:
Un homme averti en vaut deux.
Literally, it means "A warned man is worth two”
…or, in better English: Forewarned is forearmed.