Pseudo Localization Tool
Why?
Software that supports multiple languages is often designed first in English. Later translations can be longer or shorter than the source text, and that can break layouts or leave too much empty space.
depslo helps catch these issues early by pseudo-localizing English strings into readable transformed text with realistic length changes.
What is possible today?
- API endpoints to pseudo-localize JSON string maps.
- CLI utility to pseudo-localize an entire JSON file.
API routes
The server listens on localhost:1234 and currently exposes these routes:
-
POST /translate- Purpose: basic pseudo localization using default behavior.
- Request body:
{ "HELLO": "Hello, this is Rakshith", "TITLE": "The coolest developer tool" }- Example:
curl http://localhost:1234/translate \ --include \ --header "Content-Type: application/json" \ --data '{"HELLO":"Hello, this is Rakshith","TITLE":"The coolest developer tool"}'
-
POST /localize- Purpose: advanced pseudo localization with language and content type tuning.
- Request body:
{ "strings": { "HELLO": "Hello, this is Rakshith", "TITLE": "The coolest developer tool" }, "language": "es", "content_type": "ui" }languagesupports:es,de,fr,zh(default:es)content_typesupports:ui,technical,marketing,legal(default:ui)- Example:
curl http://localhost:1234/localize \ --include \ --header "Content-Type: application/json" \ --data '{"strings":{"HELLO":"Hello, this is Rakshith","TITLE":"The coolest developer tool"},"language":"es","content_type":"ui"}'
To try the server
- Clone the repo and navigate to the
depslodirectory. - Run
./scripts/serve.sh. - Call either
POST /translateorPOST /localizeusing the examples above.
To try the CLI
- Clone the repo and navigate to the
depslodirectory. - Run:
cd cmd go run depslo.go ../test/cli/test.json - The command outputs:
The psuedo local converted JSON file is at depslo.json - Open
cmd/depslo.jsonto inspect the pseudo-localized content.
