To convert the uploaded csv file from english to various languages using Google Translate API.
- Clone the repository using
git clone https://github.com/gupta-piyush19/wadhwani-assignment.git
- cd
wadhwani-assignment
. - install the dependencies using
pnpm install
. - create a
.env.local
file in the root and add the following variables:
GOOGLE_APPLICATION_CREDENTIALS=<YOUR_GOOGLE_TRANSLATE_CREDENTIALS_OBJECT>
API_SECRET_KEY=<YOUR_API_SECRET_KEY>
- Run the server using
pnpm run dev
. - Open
http://localhost:3000
in your browser. - Upload the csv file and select the language to which you want to translate the file.
- Click on the
Translate
button. - The translated file will be visible on the screen.
- Click on the
Download
button to download the translated file.
- Next.js
- Google Translate API
- TypeScript
- Tailwind CSS
- Vercel
- pnpm
- ESLint
- Prettier
-
/api/translate-csv
- POST request to translate the uploaded csv file.headers: { secret-key: string; } body: FormData<{ csv: File; convertTo: "hindi" | "punjabi" | "marathi" | "telugu"; }>;