WANT is a demo solution to translate news from English to Portuguese using IBM Watson Translation.
The iOS app connects to backend application that was built with Node.js and is hosted on Bluemix and rely on:
- Watson Translation services for translation;
- Cloudant NoSQL DB services for caching;
- The Guardian APIs for news content.
GET /api/news
{
"success": true,
"result": [
{
"type": "article",
"sectionId": "football",
"webTitle": "Joel Matip’s signing has saved Liverpool millions, claims Jürgen Klopp",
"webPublicationDate": "2016-02-16T22:30:04Z",
"id": "football/2016/feb/16/liverpool-joel-matip-jurgen-klopp",
"webUrl": "http://www.theguardian.com/football/2016/feb/16/liverpool-joel-matip-jurgen-klopp",
"apiUrl": "http://content.guardianapis.com/football/2016/feb/16/liverpool-joel-matip-jurgen-klopp",
"sectionName": "Football"
},
{
"type": "liveblog",
"sectionId": "us-news",
"webTitle": "Trump gives voice to 'Scalia-was-murdered' conspiracy – campaign live",
"webPublicationDate": "2016-02-16T22:27:13Z",
"id": "uk-news/2016/feb/16/tim-newton-rachel-slater-climbers-missing-ben-nevis-mountain",
"webUrl": "http://www.theguardian.com/us-news/live/2016/feb/16/us-presidential-election-campaign-live-coverage-trump-cruz-clinton-sharpton-george-jeb-bush-south-carolina-primary-nevada-caucus",
"apiUrl": "http://content.guardianapis.com/us-news/live/2016/feb/16/us-presidential-election-campaign-live-coverage-trump-cruz-clinton-sharpton-george-jeb-bush-south-carolina-primary-nevada-caucus",
"sectionName": "US news"
}
]
}
GET /api/news/:articleID
{
"success": true,
"result": {
"originalText": "Apple rejects order to unlock gunman's phone..."
}
}
GET /api/translate/:articleID
{
"success": true,
"result": {
"translatedText": "Apple rejeita pedido para desbloquear o telefone do atirador..."
}
}
- Run the app;
- Select an article;
- read the original article;
- select translated and voilà!;
- select original to go back to original text.
Simple as that! Do you not believe? See bellow!
- It was written in Objective C;
- It uses MVVM as a software architectural pattern;
- It uses AutoLayout for a responsive user interface;
- Unit Tests;
- UI Tests;.
The app was developed and tested with:
- XCode 7.1.1 and XCode 7.2.1;
- iOS 9 Simulator;
- OS X El Capitan 10.11.1;
- CocoaPods 0.39.0.
You can take a look at iOS app code here.
- Improve HTML to plain text parser;
- Support to other languages;
- Local caching.