Skip to content

stackery/language-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Langugage Translator

This is a tool that will translate text into another language. It is recommended to use Stackery to get this setup.

Architecture

stack

Directions to Use

  1. Create an IAM user with s3:PutObject permission and enable programic access. Take note of the access key/secret access key.
  2. Add the accessKeyId and secret to your environment.
  3. Deploy the stack.
  4. Take note of the OriginalFiles bucket ARN and scope the permission for the IAM user you created in step 1 to s3:ObjectPut for just that bucket. The policy document should look something like this...be sure to replace the <> content with your own.
{
  "Version": "2012-10-17",
  "Statement": [
      {
          "Effect": "Allow",
          "Action": [
              "s3:PutObject"
          ],
          "Resource": [
              "arn:aws:s3:::language-translator-<YOUR STACKERY ENVIRONMENT NAME HERE>-originalf-<YOUR AWS ACCOUNT ID HERE>/*"
          ]
      }
  ]
}
  1. Upload a text file to the OriginalFiles s3 bucket in the AWS console. Should be in format SourceLanguageCode/TargetLanguageCode/filename.txt.
  2. The translated text will appear in the TranslatedFiles s3 bucket under the same file path SourceLanguageCode/TargetLanguageCode/filename.txt.
  3. Alternatively, you can head to the url for your frontend. It'll be something like http://<STACKERY STACK NAME>-<STACKERY ENVIRONMENT NAME>-frontend.s3-website-<AWS ACCOUNT REGION>.amazonaws.com/.

Running the Frontend Locally Against a Deployed Backend

  • Add a file src/PopulateFrontend/frontend-code/src/config.js with the following:
    export default {
      accessKeyId: '<YOUR-ACCESS-KEY-ID>',
      secret: '<YOUR-SECRET-ACCESS-KEY>',
      region: '<YOUR-REGION>',
      apiEndpoint: '<YOUR-API-ENDPOINT>',
      originalBucket: '<YOUR-ORIGINAL-BUCKET-NAME>'
    };
    

Notes

  • DynamoDB has an item size limit. GitHub issue with suggestions on how to fix this here.
  • Supported language codes and pairs can be found here

Outstanding TODO Items / Open Bugs

See open issues

Logging Issues

If you find a bug or have a question, feel free to open a new issue and our maintainers will reply as soon as they possibly can. Please describe the issue including steps to reproduce if there are any.

Pull Request Process

  1. Fork the respository
  2. Make any changes you'd like
  3. Open a new PR against master with a description of the proposed changes as well as any other information you find relevant.
  4. If your PR fixes an open issue be sure to write fixes #[ issue number here ]

Finding Help

Please send a direct message to @deeheber on Twitter or @FarrahC32 on Twitter if any of your questions have not been addressed by the documentation in this repository.