![]() ![]() Get to know more about their most common fruits in Tagalog language in today’s post so that you can impress your Filipino friends and colleagues in no time! To ensure translation quality, the script could also send the source text for translation rather than the browser text, as the browser text can be translated back and forth between different languages and get a bit jumbled along the way.The Philippines is not only home to some of the best beaches in the world, but it is actually also boasting a number of unique fruits you can only find in this Tropical country. A more complete script would scan the DOM for text objects, make one API call containing all text to be translated, and replace all text objects. This demo is a minimal proof-of-concept for web-based translation. Of course, there’s plenty of room for improvement. I relied heavily on Tania Rascia’s excellent API tutorial in developing this part of the script.ĪPI_KEY = " your-api-key " // replace with google api key, available from google console project // when the translate button is clicked, pull text from objects with ID "translateText" // and replace with a translated version. Accessing the data in those requests is a bit more complex. Opening and sending requests with XMLHttpRequest() is relatively straightforward. This script makes a POST to the the translate endpoint of the v2 translate API.Īs a newcomer to Javascript and XMLHttpRequest(), I found it easier to construct a URL manually than to add parameters with Javascript syntax.Īfter concatenating the base URL and the API key parameter, the target language is included with $("#targetLanguage").val() įinally, the text to be translated, identified by the ID #translateText, is encoded and included. text ()) // encodeURI converts strings to url-safe text val () // url += " &q= " + encodeURI ( $ ( " #translateText " ). construct url to translate content in #translateText to the language selected by #targetLanguage var url = " " url += " /?key= " + API_KEY url += " &target= " + $ ( " #targetLanguage " ). If you’re a developer interested in using the Google Translate API for your own web content, this part is for you. In this section I will break down the javascript behind this demo and discuss the limitations of this script. Human translators can help proofread NMTS translation to ensure high quality and readability in other languages. When content is written with metaphors or idioms, a NMTS may misrepresent the meaning. To remedy this, human translators can create dictionaries of these special cases and help to train the NMTS to improve future translation. Some phrases that are common on Chicago websites, like acronyms or department names, may be mistranslated by an out-of-the-box NMTS. Translating web content isn’t as easy as flipping a switch – while new neural machine translation services (NMTS) can translate text quickly with some accuracy, there are certain caveats. The City of Chicago has an enormous amount of digital content across a number of different websites. However, there is a trade-off between quality and speed: machine translation services like Google Translate provide translation nearly instantaneously, while human translation takes longer. A high quality of translation requires human translation or human proofreading of computer translation. The City of Chicago has a number of translation options available, ranging in quality, speed, and price. As a result, the City of Chicago is developing a web content translation strategy for the six most commonly spoken languages in Chicago: English, Spanish, Polish, Arabic, Mandarin, and Tagalog. The new administration is pushing for better compliance with a 2015 language access ordinance. ![]() One of the chief roles of the Design Office is improving the accessibility and inclusion of government services. After a bit of research and a bit of code, we have successfully shown how Google can be used to translate a static webpage into the six most commonly spoken languages in Chicago. This demo was developed to test the viability of computer translation, specifically neural machine translation services (NMTS) we’ve chosen to use Google Translate because it was the only out-of-the-box translation service to support Tagalog. ![]() The City of Chicago is exploring different strategies for web translation of City content. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |