I think it is common when first learning a new language to try to "transliterate" code from another-language-you-know-well into this new language. When first starting out, you don't yet have a complete mental model of the new language to work with, so you need to leverage your existing knowledge and try to shoehorn it into the new language.
Of course, often this leads to non-idiomatic code in the new language, as well generally not using the new language well to leverage its unique strengths (and avoid its unique weaknesses). So with time, you need to abandon "trying to do it the way you did in your old language". That method is a useful first stepping-stone to get started, but will impair you in the long run.
I think it's somewhat analogous to learning a new spoken language as an adult. At first, you 'translate' what you hear back into your mother tongue in order to understand, but this 'translating' will hurt you in the long run, and with practice and immersion you learn the new language well enough to skip the 'translation' step and to use and appreciate the idioms of the new language.
To sum up, I think it's ok to use this strategy when first getting started in a new language, but the sooner you can abandon it, the better.