{"id":5187,"date":"2021-11-08T06:33:49","date_gmt":"2021-11-08T06:33:49","guid":{"rendered":"https:\/\/www.aiproblog.com\/index.php\/2021\/11\/08\/why-translating-with-google-sheets\/"},"modified":"2021-11-08T06:33:49","modified_gmt":"2021-11-08T06:33:49","slug":"why-translating-with-google-sheets","status":"publish","type":"post","link":"https:\/\/www.aiproblog.com\/index.php\/2021\/11\/08\/why-translating-with-google-sheets\/","title":{"rendered":"Why translating with Google Sheets"},"content":{"rendered":"<p>Author: Zoran Bogdan<\/p>\n<div>\n<p><a href=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/9777895272?profile=original\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/9777895272?profile=RESIZE_710x\" width=\"720\" class=\"align-full\"><\/a><\/p>\n<p>Google Translate is an amazing feat of engineering, which uses artificial intelligence to translate speech and text from a chosen language into another. In most cases, Google Translate\u2019s own interface embedded in Google Search or on\u00a0<a href=\"https:\/\/translate.google.com\/\" target=\"_blank\" rel=\"nofollow noopener\">translate.google.com<\/a>\u00a0suffices to get some ad-hoc thing translated quickly.<\/p>\n<div class=\"ica-wrapper\">\n<div class=\"ica-text\">\u00a0<\/div>\n<div class=\"ica-button\">But in some cases, you want something more powerful and scalable to be able to translate in bulk. For coders, there\u2019s the Translation API for instance. But what if you\u2019re less technical, and still want to use Google Translate in a structured, more scalable environment?<\/div>\n<div class=\"ica-button\">\u00a0<\/div>\n<\/div>\n<p>Again, as in other Case Studies presented here, <strong>Google Sheets comes to the rescue!<\/strong><\/p>\n<\/p>\n<p><a href=\"https:\/\/zoran.cloud\/wp-content\/uploads\/2021\/04\/CS-2-Translate-with-Google-Sheets.jpg\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/zoran.cloud\/wp-content\/uploads\/2021\/04\/CS-2-Translate-with-Google-Sheets.jpg?profile=RESIZE_710x\" width=\"640\" class=\"align-full\"><\/a><\/p>\n<h1>Main formula:<\/h1>\n<p><strong>=GOOGLETRANSLATE(<span>B16<\/span>,<span>\u00a0<\/span><span>\u201cen\u201d<\/span>,<span>\u00a0<\/span><span>\u201cfr\u201d<\/span>)<\/strong><\/p>\n<ul>\n<li>Here, the \u2018B16\u2019 part concerns the reference to the cell containing the text you want to translate.<\/li>\n<li>After that, you add the<span>\u00a0<\/span><b>source language<\/b><span>\u00a0<\/span>\u2014 the language in which the original text is written \u2014 using the language\u2019s abbreviation.<\/li>\n<li>After that, you declare the<span>\u00a0<\/span><b>target language<\/b><span>\u00a0<\/span>\u2014 the language to which the source text has to be translated \u2014 again using that language\u2019s abbreviation.<\/li>\n<\/ul>\n<h1>How to make this even better?<\/h1>\n<p><span style=\"font-size: 12pt;\"><strong>1. Drop-down lists for the languages<\/strong><\/span><\/p>\n<p>Other than formatting the file to your liking, you can create some drop-down lists for the Source and Target languages.<\/p>\n<p>This will help you being more productive as you do not need to search for the language codes every time you want to change them.\u00a0<\/p>\n<p>In my case, I used the\u00a0<b>Data Validation<\/b>\u00a0feature using as a criterion a List from a Range. First, I created a new sheet with all the Languages and their codes. Then, I used the column with the language names as my List for data validation.<\/p>\n<p>Advantages of the drop-down list:<\/p>\n<ul>\n<li>It can be sorted (in my case, I used the alphabetical sort in the Language Codes Sheet).<\/li>\n<li>It is searchable.<\/li>\n<li>Can auto-update if your data changes &#8211; see the TIP below<\/li>\n<\/ul>\n<p>For your drop-down list to auto-update when you are adding new data on the criterion Range, use a formula like:\u00a0<strong><em>=&#8217;Language Codes&#8217;!$A$2:$A\u00a0<\/em><\/strong><\/p>\n<p>Note that on the range defining the data that will be used for the drop-down list, I specify the beginning of the selection ($A$2: row 2 of column A) but I do not specify any row at the end of the selection (:$A).<\/p>\n<p>I could have written the formula like this\u00a0<strong><em>=&#8217;Language Codes&#8217;!$A$2:$A65<\/em><\/strong>\u00a0but then, every time I am adding new languages to the list I will need to update the Data Validation formula.<\/p>\n<h4><span style=\"font-size: 12pt;\">\u00a02.\u00a0<strong>VLOOKUP function to pick the language code<\/strong><\/span><\/h4>\n<p>I have now the Language selected from the drop-down list but in the formula I need to have the Language Code and not the language name. Therefore, I am using the VLOOKUP function that is searching the Language Name in the Language Code Sheet and returns the Language Code corresponding to the selection.<\/p>\n<p><strong><em>VLOOKUP($B$11,&#8217;Language Codes&#8217;!A:B,2,FALSE) &#8211; Source Language<\/em><\/strong><\/p>\n<p>So it looks for the value in cell B11 (the source language) in the Sheet &#8220;Language Codes&#8221; on column A. Once it finds the Language, it will return the information on the next column on that specific row. The Language Code. If the language is set to English, this function will return &#8220;en&#8221;.\u00a0<\/p>\n<p><strong><em><span dir=\"auto\">VLOOKUP<\/span><span dir=\"auto\">(<\/span><span dir=\"auto\">$B$15<\/span><span dir=\"auto\">,<\/span><span dir=\"auto\">&#8216;Language Codes&#8217;!$A:$B<\/span><span dir=\"auto\">,<\/span><span dir=\"auto\">2<\/span><span dir=\"auto\">,<\/span><span dir=\"auto\">FALSE<\/span><span dir=\"auto\">) &#8211; Target Language<\/span><\/em><\/strong><\/p>\n<p>It looks for the value in cell B15 (the target language) in the Sheet &#8220;Language Codes&#8221; on column A. Once it finds the Language, it will return the information on the next column on that specific row. The Language Code. If the language is set to French, this function will return &#8220;fr&#8221;.\u00a0<\/p>\n<p>So, starting from the formula definition on the yellow area, our complete formula will look like this now (check the color code on the formula definition to spot every part):<\/p>\n<p><span class=\" default-formula-text-color\" dir=\"auto\">=<\/span><span class=\" default-formula-text-color\" dir=\"auto\">GOOGLETRANSLATE<\/span><span class=\" default-formula-text-color\" dir=\"auto\">(<\/span><span dir=\"auto\">A16<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\" default-formula-text-color\" dir=\"auto\">VLOOKUP<\/span><span class=\" default-formula-text-color\" dir=\"auto\">(<\/span><span dir=\"auto\">$B$11<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span dir=\"auto\">&#8216;Language Codes&#8217;!A:B<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\"number\" dir=\"auto\">2<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\"boolean\" dir=\"auto\">FALSE<\/span><span class=\" default-formula-text-color\" dir=\"auto\">)<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\" default-formula-text-color\" dir=\"auto\">VLOOKUP<\/span><span class=\" default-formula-text-color\" dir=\"auto\">(<\/span><span dir=\"auto\">$C$15<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span dir=\"auto\">&#8216;Language Codes&#8217;!$A:$B<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\"number\" dir=\"auto\">2<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\"boolean\" dir=\"auto\">FALSE<\/span><span class=\" default-formula-text-color\" dir=\"auto\">)<\/span><span class=\" default-formula-text-color\" dir=\"auto\">)<\/span><\/p>\n<h4><span style=\"font-size: 12pt;\"><strong>3. CLEAN ERRORS PROACTIVELY<\/strong><\/span><\/h4>\n<p>Since we pre-populated the entire table with formulas, the rows where we do not have a text to be translated will bring an error message #VALUE! It is not an error per se but it will make our file look ugly. Therefore, we can use the =IFERROR function and instruct Google Sheets to discard all the errors and show instead of an empty cell.\u00a0<\/p>\n<p>Since the function definition is =<em><b class=\"ocpLegacyBold\">IFERROR(value,<\/b><\/em><b class=\"ocpLegacyBold\">\u00a0[value_if_error]),\u00a0<\/b><em>we will have to<\/em><\/p>\n<ul>\n<li><em>replace the value part with out formula defined above\u00a0<\/em><\/li>\n<li><em>replace the value_if_error part with\u00a0<b>&#8220;&#8221;\u00a0<\/b>&#8211; this is a way to writing an empty text &#8230; nothing between the quotation marks<\/em><\/li>\n<\/ul>\n<h1>Final formula:<\/h1>\n<p><em><strong><span class=\" default-formula-text-color\" dir=\"auto\">=<\/span><span class=\" default-formula-text-color\" dir=\"auto\">iferror<\/span><span class=\" default-formula-text-color\" dir=\"auto\">(<\/span><span class=\" default-formula-text-color\" dir=\"auto\">GOOGLETRANSLATE<\/span><span class=\" default-formula-text-color\" dir=\"auto\">(<\/span><span dir=\"auto\">A16<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\" default-formula-text-color\" dir=\"auto\">VLOOKUP<\/span><span class=\" default-formula-text-color\" dir=\"auto\">(<\/span><span dir=\"auto\">$B$11<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span dir=\"auto\">&#8216;Language Codes&#8217;!A:B<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\"number\" dir=\"auto\">2<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\"boolean\" dir=\"auto\">FALSE<\/span><span class=\" default-formula-text-color\" dir=\"auto\">)<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\" default-formula-text-color\" dir=\"auto\">VLOOKUP<\/span><span class=\" default-formula-text-color\" dir=\"auto\">(<\/span><span dir=\"auto\">$B$15<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span dir=\"auto\">&#8216;Language Codes&#8217;!$A:$B<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\"number\" dir=\"auto\">2<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\"boolean\" dir=\"auto\">FALSE<\/span><span class=\" default-formula-text-color\" dir=\"auto\">)<\/span><span class=\" default-formula-text-color\" dir=\"auto\">)<\/span><span class=\" default-formula-text-color\" dir=\"auto\">,<\/span><span class=\" string\" dir=\"auto\">&#8220;&#8221;<\/span><span class=\" default-formula-text-color\" dir=\"auto\">)<\/span><\/strong><\/em><\/p>\n<\/p>\n<p>Yes, we are done. We will not complicate the formula more than that.<\/p>\n<p>\u00a0<\/p>\n<p>Register for FREE on <a href=\"https:\/\/zoran.cloud\/\" target=\"_blank\" rel=\"noopener\">https:\/\/zoran.cloud<\/a> to use the Google Sheet file. If you want to make any changes or have it on your own Google Drive account, make a copy, use it and abuse it :-).<\/p>\n<p>Zoran<\/p>\n<\/div>\n<p><a href=\"https:\/\/www.datasciencecentral.com\/xn\/detail\/6448529:BlogPost:1075521\">Go to Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Author: Zoran Bogdan Google Translate is an amazing feat of engineering, which uses artificial intelligence to translate speech and text from a chosen language into [&hellip;] <span class=\"read-more-link\"><a class=\"read-more\" href=\"https:\/\/www.aiproblog.com\/index.php\/2021\/11\/08\/why-translating-with-google-sheets\/\">Read More<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":472,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[26],"tags":[],"_links":{"self":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/posts\/5187"}],"collection":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=5187"}],"version-history":[{"count":0,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/posts\/5187\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/media\/466"}],"wp:attachment":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=5187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=5187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=5187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}