Answered by:
How can I use google translate api (Nuget package) in my .net core project

Question
-
User283528319 posted
Hi all,
I want my website to be international, therefore want to implement google translate api in it and with a language combobox II want my site to be shown in any language the user wants.
Is it possible to do it in easy way?
thanks.
Tuesday, July 16, 2019 8:51 AM
Answers
-
User-1764593085 posted
Hi fatihbarut,
IMO, google translate api is used to translate text/paragraph or article.If it is used to translate the whole site, it will have bad performance and high cost which is not necessary at all.
https://cloud.google.com/translate/docs/quickstart-client-libraries
Since asp.net core globalization and localization could achieve it too and it is recommended to use built-in localization for static text.
Best Regards,
Xing
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, July 17, 2019 6:37 AM
All replies
-
User-1038772411 posted
Hello Fatihbarut
yes, you can.
Please use below code and package you can easily add in your projec
Install the NuGet package Google.Cloud.Translation.V2 (.NETStandard 1.3) Use the TranslationClient
Please Refer Below Code for more and complete implementd code :Thanks.Tuesday, July 16, 2019 12:55 PM -
User-1764593085 posted
Hi fatihbarut,
IMO, google translate api is used to translate text/paragraph or article.If it is used to translate the whole site, it will have bad performance and high cost which is not necessary at all.
https://cloud.google.com/translate/docs/quickstart-client-libraries
Since asp.net core globalization and localization could achieve it too and it is recommended to use built-in localization for static text.
Best Regards,
Xing
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, July 17, 2019 6:37 AM -
User283528319 posted
thanks a lot
could you explain it in details?
Wednesday, July 17, 2019 7:10 AM -
User-1764593085 posted
Hi fatihbarut,
What I think is that if you use google translate api for the site, it will send large quantities of request to api when the page refreshes which will cause low performance.You need to use asp.net core globalization and localization with resource files , refer to the tutorial in details
Wednesday, July 17, 2019 7:20 AM