Skip to content

Conversation

penandlim
Copy link

@penandlim penandlim commented Apr 4, 2023

  • Add pRetry library for retrying before giving up
  • Move utils functions in fastTranslate and translate to utils file
  • Refactor fastTranslate to detect large jsons and split it to chunks limited by char size of 2000 characters. (Using char size as limiter here but feel free to change. Need a better token estimation for non-english langauges that don't use spaces.)
  • Create couple utils function for parsing purposes.

Missing from the PR: applying this change to translate and exportLocalFiles

Tested with below json

{
    "hello" : "Hello!",
    "welcome": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! ",
    "welcome2": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 2",
    "welcome3": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 3",
    "welcome4": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 4",
    "welcome5": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 5",
    "welcome6": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 6",
    "welcome7": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 7",
    "welcome8": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 8",
    "welcome9": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 9",
    "welcome10": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 10",
    "welcome11": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 11",
    "welcome12": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 12",
    "welcome13": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 13",
    "welcome14": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 14",
    "welcome15": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 15",
    "welcome16": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 16",
    "welcome17": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 17",
    "welcome18": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 18",
    "welcome19": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 19",
    "welcome20": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 20",
    "welcome21": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 21",
    "welcome22": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 22",
    "welcome23": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 23",
    "welcome24": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 24",
    "welcome25": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 25",
    "welcome26": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 26",
    "welcome27": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 27",
    "welcome28": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 28",
    "welcome29": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 29",
    "welcome30": "Welcome to my app! This is a test sentance to test the limits lets try to break chat gpt! 30"
}

Takes 2 translates to complete

@vercel
Copy link

vercel bot commented Apr 4, 2023

@penandlim is attempting to deploy a commit to the kanaries Team on Vercel.

A member of the Team first needs to authorize it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant