Comments (6)
Yes, the array translation is broken and that's why the CI build badge is red :(
from google-translate-php.
The solution I have found for this, that is more or less accurate, is to implode texts with " \r\n ", and then call the translate on this string. After you can use explode(PHP_EOL, $results); to get translations. There is also some limitation for string length, that is why I am sending text which length is no more then 2000. So in case you have 8000 characters, you should call translate function 4 or 5 times. This is not very accurate, but it is something at least.
from google-translate-php.
@Stichoza yeah i've seen that the issue is with the array nesting level. But the solution seems too simple just to change the nesting level, right?
But there are two issues here, when I check the result of the getResponse()
method on a multi-sentence translation it only returns one translation:
[[["Katze","cat",,,2]],,"en"]
I'm not sure how it has worked in the past but when I look at the request I see that the individual sentences are passed in using the same param name:
q=cat&q=dog&q=fish
Did it work like this in the past too without providing either an array of q's like q[]
or a different body?
from google-translate-php.
@armantsh iirc \r\n
still made the response make arbitrary strings relocation, the string I have come to use for like 2 months and has not afaik given me problems is \nΒΆ\n
, the paragraph symbol should make sure no context is shared between lines.
from google-translate-php.
Fixed in this PR:
from google-translate-php.
Array translation is removed in v4.0.0. You can either implode the array with new lines as @geoffreyc suggested, or just loop translate method.
from google-translate-php.
Related Issues (20)
- Brazilian Portuguese translation error HOT 4
- How can I translate to serbian? HOT 1
- can i translate a Array at one time? HOT 1
- setUrl is not work for me HOT 1
- setUrl() It is not available in mainland China HOT 1
- Memory Usage HOT 4
- Very slow HOT 1
- Country an cities sometimes are not translated HOT 4
- ErrorException: Maximum execution time of 60 seconds exceeded HOT 4
- Class "Stichoza\GoogleTranslate\GoogleTranslate" not found HOT 1
- How do I swap to using my own paid api key? HOT 1
- Loading Problem. HOT 2
- I use the IP of a VPN server as a proxy, I wonder why it doesn't work when I use 'https' instead? HOT 5
- Can you give me a list of free Proxies that I can use so that translation is not blocked in the future? HOT 1
- Can you fix this bug in your library for me?
- 400 Bad Request Client error: GET HOT 5
- Can you add the link of my package to your package? HOT 1
- Ignore escaped keys on translations HOT 4
- Error: Class "Stichoza\GoogleTranslate\GoogleTranslate" not found in file HOT 6
- Bug report: preserveParameters gives unexpected results when translating to French HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-translate-php.