Skip to content

davidgs/Translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hugo Page Translator

This is a go program that will take your Hugo blog post entries and translate them to whatever languages you want.

You will need a Google account, with a project, and Google Trnaslate API enabled.

Google setup

Start with the Google Documentation to get your system setup for using the API. you will need to make sure that the api json file is stored locally, in the same directory as this program.

Using this program

Once you have google translate set up and working, using this program consists of:

% go get
% go build translate.go
% ./translate <full path to the file to be translated.md>

Right now, it is hard-coded to translate whatever file you tell it to French, German and Spanish. I am working on making this more robust so you can list languages, list files, or just give it a directory to scan and find all the underlying index.en.md files in it.

Note: You should have all of your blog posts in index.en.md files, not just index.md files or this program won't find them.

Caveats

This was written specifically for me, and my Hugo setup using the Toha theme. It may or may not work for your Hugo theme.

PRs etc. always welcomed!

About

A translator for Hugo blog posts.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages