Comments (7)
Can you explain what exactly does not work? What errors do you get and what have you tried?
Opening an unconstructive issue shouting "It doesn't work!!!!11!" is not a good idea.
from google-translate-php.
Thank you for responding!
It's not a shout, it's a whisper... Sorry!
Just does nothing... It stays a blank page:
http://dlc.pt/equipa_dlc/lucinda/tradutor/
This is my code...
The file included is on the right path....
<?php
include ("Stichoza/Google/GoogleTranslate.php");
$tr = new GoogleTranslate("en", "ka");
//echo GoogleTranslate::staticTranslate("Hello again", "en", "ka");
echo $tr->translate("Hello World!");
?>
from google-translate-php.
As of v2.0.0
this library is namespaced as PSR-4 standards require (See the readme.md for more information). In your code the object isn't actually instantiating. You should get an error about it if you haven't turned off error_reporting
in your PHP configuration.
So you are using namespaces incorrectly.
You should either add use Stichoza\Google\GoogleTranslate;
before instantiating an object, or just use full namespace in classname.
With use
keyword
use Stichoza\Google\GoogleTranslate;
$tr = new GoogleTranslate('en', 'pt');
Or with full namespace
$tr = Stichoza\Google\GoogleTranslate('en', 'pt');
from google-translate-php.
I put the class in the same dir...
And the code is this:
<?php
include ("GoogleTranslate.php");//in same dir
use Stichoza\Google\GoogleTranslate;//namespace in class
$tr = new GoogleTranslate("en", "ka");
echo $tr->translate("Hello World!");
?>
Nothing again: http://www.dlc.pt/equipa_dlc/lucinda/tradutor/
Could you please help me ?
What I'm doing wrong?
from google-translate-php.
I think it's not a problem of this library. I copied the exact code you wrote and it works for me. You can see output in the attached image below.
Consider enabling error_reporting
on your server to see what's wrong.
from google-translate-php.
You are great!!! Realy works!!! It was an issue in the server...
Thank you so much!
from google-translate-php.
You're welcome! 😄
from google-translate-php.
Related Issues (20)
- 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
- cURL error 60: SSL certificate problem HOT 1
- Please assist me HOT 3
- How can I translate my page web HTML into your library? HOT 2
- PHP - extract the children from this <div id="page-container"> then translate it and put them back into this same <div id="page-container">
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.