Stichoza / google-translate-php

🔤 Free Google Translate API PHP Package. Translates totally free of charge.
MIT License
1.79k stars 380 forks source link

can i translate a Array at one time? #181

Closed vingoyuan closed 1 year ago

vingoyuan commented 2 years ago

i want to translate some words in one time . how to achieve it.

Stichoza commented 1 year ago

Each translation would require separate HTTP request, because Google Translate doesn't offer translating arrays. You can join strings as multiple sentences but it would not be accurate.

You can simply iterate over an array and translate each item, but be careful with Google IP bans.

P.S. sorry for late answer