prine / rogoogletranslate Goto Github PK
View Code? Open in Web Editor NEWSimplifies the usage of the Google Translate API via Swift
License: MIT License
Simplifies the usage of the Google Translate API via Swift
License: MIT License
I'm not sure if this an issue with my API key or the formatting of the URL. Here is what my url request looks like:
https://www.googleapis.com/language/translate/v2?key=MYKEYISHERE&q=Here's%20what%20I'm&source=en&target=ja&format=text
Then this is the 400 response that I'm getting:
{ Status Code: 400, Headers {
"Cache-Control" = (
private
);
"Content-Encoding" = (
gzip
);
"Content-Length" = (
181
);
"Content-Type" = (
"application/json; charset=UTF-8"
);
Date = (
"Fri, 16 Feb 2018 23:38:01 GMT"
);
Server = (
ESF
);
Vary = (
Origin,
"X-Origin",
Referer
);
"alt-svc" = (
"hq=\":443\"; ma=2592000; quic=51303431; quic=51303339; quic=51303338; quic=51303337; quic=51303335,quic=\":443\"; ma=2592000; v=\"41,39,38,37,35\""
);
"x-content-type-options" = (
nosniff
);
"x-frame-options" = (
SAMEORIGIN
);
"x-xss-protection" = (
"1; mode=block"
);
}
Maybe I have my API key wrong? I'm using the value of private_key_id
after creating a new project on Google Cloud Platform API.
Any help would be much appreciated!
Seems like osx
is not supported
[!] The platform of the target `App` (OS X 10.12) is not compatible with `ROGoogleTranslate (0.0.5)`, which does not support `osx`.
Hi i downloaded the project and followed the instructions provided. My understanding of the instructions was to just insert my own api key and then compile the app and then insert the text that is to be translated into the textfield and the app should work, so i went into google translate console and obtained the google translate api and had enabled the api. I inserted the api within the code. When i run the app and type in the text to translate and then press the 'translate' button. I get the following output.
"2017-02-25 22:38:40.667724 ROGoogleTranslate[18027:1355532] [] nw_host_stats_add_src recv too small, received 24, expected 28
2017-02-25 22:38:40.675490 ROGoogleTranslate[18027:1355532] [] ____nwlog_simulate_crash_inner_block_invoke dlopen CrashReporterSupport failed
2017-02-25 22:38:40.676338 ROGoogleTranslate[18027:1355532] [] __nwlog_err_simulate_crash simulate crash failed "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"
2017-02-25 22:38:40.678888 ROGoogleTranslate[18027:1355532] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace"
I also get the following error each time i click the translate button
'Response [403] - 230 bytes'
I tried googling the errors but got no luck!
I have posted the issue on stack overflow http://stackoverflow.com/questions/42449468/implementing-google-translation-api-in-swift-3-ios
Is this an error with the code or is it with it my api key, or do i need to alter the code more in order for the app to work.
ThankYou
I keep getting this error, when trying to translate from en to ja.
What am I doing wrong?
HI
When i giving same language for translation for source and target it is not doing translation
params.source = fromLanguage.text ?? "fr"
params.target = toLanguage.text ?? "fr"
Can you please advise on this
THanks
I do have an active API key. My API access is upgraded and current (credit card on file).
Any other reasons for the 403 response?
Many thanks
When I trying to translate I am getting Bad Request error. However Previously I was able to used it perfectly.
url URL "https://www.googleapis.com/language/translate/v2?key=AIzaSyBvEjbxQuIShydRYJczmXLkil1XeavFRC4&q=hello&source=en-US&target=zh-CN&format=text"
Please let me know if any one also facing this or having any solution for this.
I'm new to swift, I'm always getting that error which is Something went wrong: Optional(889 bytes). Would you please help me about that ? Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.