Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add translate text function #43

Merged
merged 4 commits into from Dec 20, 2022

Conversation

aknsal
Copy link
Contributor

@aknsal aknsal commented Oct 5, 2022

This PR should close appwrite/appwrite#4142

Description

Implemented translate text function using different providers.
Currently the supoorted providers are :

  • Google
  • AWS
  • Azure

Screenshots

Translation using Google

google_proof

Translation using Azure

azure_proof

Translation using AWS

aws_proof

@stnguyen90 stnguyen90 self-requested a review October 26, 2022 23:50
Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR! 🤯 We left some comments during the review, please check them out.

Comment on lines 11 to 12
"source": "en",
"target": "es"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename this to:

Suggested change
"source": "en",
"target": "es"
"from": "en",
"to": "es"

This is important so that we're consistent between our different languages.

Comment on lines 19 to 22
{
"text": "Hello from Open Runtimes 👋",
"translation": "Saludos desde Open Runtime 👋"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure to follow the requirements for the response.

}
```

## 📝 Environment Variables
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's name these Variables instead of Environment Variables.

Comment on lines 61 to 62
- This function is designed for use with Appwrite Cloud Functions. You can learn more about it in [Appwrite docs](https://appwrite.io/docs/functions).
- This example is compatible with NodeJS 17.0. Other versions may work but are not guarenteed to work as they haven't been tested.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for leading space.

Pleas also update the Node version.

node/translate_text/README.md Outdated Show resolved Hide resolved
let translatedText = "";

if(provider==='google'){
translatedText = await googleProvider(req.payload).catch((e)=>console.log(e));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On error, please makes sure to return an error response as detailed in the issue.

@Meldiron
Copy link
Contributor

Thank you so much for the PR 🤩. We're adding the hacktoberfest-accepted label to ensure this PR counts towards your Hacktoberfest contributions count. With that said, please stay active on this PR to address any comments once you receive a review. Happy Hacktoberfest! 🎃

@aknsal aknsal marked this pull request as draft November 5, 2022 09:17
@aknsal
Copy link
Contributor Author

aknsal commented Nov 5, 2022

I have made the requsted changes. Please tell if any changes required.

@aknsal aknsal marked this pull request as ready for review November 5, 2022 09:25
@stnguyen90 stnguyen90 self-requested a review November 7, 2022 20:38
Copy link
Contributor

@stnguyen90 stnguyen90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey 👋 awesome work on your PR! We've approved your work and it'll be merged soon!

@christyjacob4 christyjacob4 merged commit 7a9d318 into open-runtimes:main Dec 20, 2022
@christyjacob4
Copy link
Contributor

THANK YOU! All changes merged 🥳

Please reach out to me on our Discord server if you would like to claim your Appwrite swags! As a way of saying thank you, we would also love to invite you to join the Appwrite organization on GitHub. Please share your GitHub username with us on Discord.  

You can accept the invite by visiting https://github.com/orgs/appwrite/invitation. By joining our team, you will officially be an Appwrite maintainer on GitHub.

You can change your membership visibility settings, so your new Appwrite team membership badge will show up on your personal GitHub profile.

Please feel free to look for more PRs you might be interested in helping with on our long list of Hacktoberfest friendly issues and help make Appwrite better :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

⚡ Write a translateText() Function using Node
4 participants