Skip to content

Kilros0817/VFTranslator

Repository files navigation

VF Translator

A minimal Next.js app to translate Voiceflow .vf files. Upload a .vf file, choose a target language, and download the translated file. Uses the public Google Translate API.

What it does

  • Upload a .vf file (browse or drag and drop).
  • Translate text fields inside the .vf JSON (e.g. name, title, value, text, variables) to the chosen language.
  • Download the translated .vf file.

Run locally

npm install
npm run dev

Open http://localhost:3000.

How to use

  1. Upload a .vf file (browse or drag and drop).
  2. Choose a Target language from the dropdown.
  3. Click Translate (source language is auto-detected).
  4. Click Download .vf to save the translated file.

No API key is required for the public Google Translate endpoint used here.

Usage example

1. Try with the included example file

# Start the app
npm run dev

Then in the browser:

  1. Go to http://localhost:3000.
  2. Drag and drop example/sample.vf onto the upload area (or click to browse and select it).
  3. Choose a target language (e.g. Spanish).
  4. Click Translate and wait for the run to finish.
  5. Click Download .vf to get e.g. sample - Spanish.vf.

2. Translate via API (programmatic)

# Translate a single string
curl -X POST http://localhost:3000/api/translate \
  -H "Content-Type: application/json" \
  -d '{"langFrom":"auto","langTo":"es","text":"Hello, world!"}'
# Response: {"res":"¡Hola, mundo!"}

Example file

The repo includes a minimal .vf file you can use to test the app:

File Description
example/sample.vf Minimal Voiceflow-style JSON with name, title, text, and variables.

Use it to verify upload → translate → download without a real project export.

Tech

  • Next.js 14 (App Router)
  • Tailwind CSS
  • Translate API: POST /api/translate with body { langFrom, langTo, text }; returns { res: "translated text" }.

Project structure

app/
  page.js          # Single page: upload .vf, translate, download
  layout.js
  api/translate/
    route.js       # POST handler – calls Google Translate
lib/
  utils.js         # Language list for the dropdown
example/
  sample.vf        # Minimal example .vf file

Build

npm run build
npm start

License

See LICENSE.

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors