1

I'm working on a fantasy story that has a Language of Power (TVTROPES) in it and I was trying to look around online to find an automatic translator for the language I came up with but can't find any.

So is there an automatic translator out there for custom made languages that I'm not seeing?

  • No, but read this question and the answers instead: writers.stackexchange.com/questions/4368/… – Lauren-Clear-Monica-Ipsum Sep 21 '14 at 16:35
  • 1
    To clarify: You are looking for a tool where you enter your dictionary and grammar rules in some way and then get a translator which can translate between English and your language? – Philipp Sep 23 '14 at 12:02
  • Sorry, I guess I should have mentioned this earlier. I have an English to my language cipher set up and I was wondering if there was a program that I could use to translate paragraphs from one to the other. (Note: I use ' and double letters to substitute some of the English letters) – Cyberson Sep 23 '14 at 20:54
  • Ah, so it's just a cypher -- what operating system do you use (windows osx linux)? Standard *nix tools should be able to do this pretty easily, I think. – evilsoup Sep 25 '14 at 22:46
  • @evilsoup Sad face, I'm running Win8.1 – Cyberson Sep 26 '14 at 0:04
2

I suspect that the best answer for what I imagine is your use-case would be for someone to write a Word or LibreOffice macro, but I wouldn't even know where to begin with that.

However, you could use Vim for this -- specifically gVim, which has a Windows version. This takes a little bit of setting up, but I think the results are worth it.

Note: While it's nowhere near as mind-bending as its critics would have you think, learning Vim is non-trivial, and beyond the scope of this answer. If you want, once you've installed gVim, you can use the Start menu to search for 'Vim Tutor' (without the quotes) to get an interactive tutorial of the basics. It's well worth learning, if you can get your head around it.

Setting up

First of all, download & install gVim from here.

You'll also need the abolish.vim plugin for its :Subvert command. Quick installation instructions for this (once you've already got gVim installed):

  1. Create the directory C:\Users\YOURUSERNAME\vimfiles, and then the directories C:\Users\YOURUSERNAME\vimfiles\autoload and C:\Users\YOURUSERNAME\vimfiles\bundle
  2. Download Pathogen, which is a plugin manager for Vim -- it's easiest to just grab the zip file and unpack it in C:\Users\YOURUSERNAME\vimfiles\autoload
  3. Download the abolish zip and extract it to the bundle directory
  4. Create a text file called _vimrc in C:\Users\YOURUSERNAME, and put the following lines within it:

.

execute pathogen#infect()
set encoding=utf-8

Now you need to create your cypher file. This will actually be a plain text file with commands for Vim. It should look something like this:

"paste from the clipboard into vim:
0put * 

"The substitute commands
"Make sure you use %S rather than %s
"The 'silent!' prevents error messages
silent! %S/quick/varryn/g
silent! %S/fox/drugar/g
silent! %S/dog/foob/g

"delete the blank line which vim will have added:
$delete
"cut the text into the clipboard:
%delete *

The Magic

Let's say you have the following paragraphs:

The quick, brown fox jumps over the lazy dog. The quick, brown fox jumps over the lazy dog.

'Quick!' shouted the dog, uncharacteristically, to the fox: 'Jump over me!'

...and you want to run your cypher over it, so that every instance of 'quick' will be replaced with 'varryn' and so on. First, copy the text from your word document (or whatever). Then, open gVim and type the following (pressing enter at the end):

:source C:\path\to\cypher.txt

After this, you can just paste the paragraph back into your word document, et voilà:

The varryn, brown drugar jumps over the lazy foob. The varryn, brown drugar jumps over the lazy foob.

'Varryn!' shouted the foob, uncharacteristically, to the drugar: 'Jump over me!'

You might not want to have to type out the full path to your cypher file; you could put the following line at the bottom of your _vimrc:

command Cypher :source C:\path\to\cypher.txt

With this, you can simply type :Cypher (and press enter) without having to remember where the file is each time.

Additionally, if you type @: within Vim, the previous command-line mode command (those starting with a :) will be repeated; so if you were translating multiple paragraphs, you would only need to type :Cypher the first time, and for all additional occasions (for as long as you leave Vim open) you could just use @:.

Note on the Cypher File

You stated in one of the comments that you already have a cypher set up. You can use gVim to transform this into the syntax needed here, rather than typing it all up again.

I'm assuming your cypher is set up in a way similar to this -- if it's not, you can drop a comment & I'll modify this accordingly:

quick varryn 
fox drugar 
dog foob 

Copy the lines from whatever file they're currently stored in, and open gVim. Type the following: "*p -- this will paste from your system's clipboard (rather than one of Vim's many internal clipboards -- called 'registers' by Vim).

(If you're using non-English letters, some of them might not show up properly, because the default typeface is not very good. On Windows, you should have access to the excellent Consolas; type :set guifont=Consolas:h10 (you can put this command in your _vimrc, or alternatively in a _gvimrc file, if you like).)

Then type the following command (and press enter at the end):

:%s/\([^ ]*\) \(.*\)/silent! %S\/\1\/\2\/g

It's quite a long one, so if you're afraid of mistyping it, you can copy it from this answer, and then type into Vim q: (which should bring up a little frame at the bottom of you gVim window), followed by "*p to paste the command in, and then press enter.

You should now have lines like this:

silent! %S/quick/varryn/g
silent! %S/fox/drugar/g
silent! %S/dog/foob/g

Next you need to insert the other commands needed to run the cypher. Type the following commands (pressing enter at the end of each one):

:0s/^/0put *\r/
:$s/$\r$delete\r%delete */

After these, you should have a file that looks something like this:

0put *
silent! %S/quick/varryn/g
silent! %S/fox/drugar/g
silent! %S/dog/foob/g
$delete
%delete *

Now you just need to save it:

:w C:\path\to\cypher.txt

And exit gVim with :q.

Limitations

  • Vim is a plain text editor -- it has no idea what 'italics' or 'bold' mean, so running rich text through it will strip away that stuff. There might be a way around this, if it really matters to you, but it will involve installing additional programs. (Or you could write your novel in markdown, like all the cool kids :V )
  • There's no problem with single-quotes ('), but if you want to include the double-quote anywhere in your cypher text you'll have to precede it with a backslash (because " is used for comments in Vim command files)
| improve this answer | |
0

Well if you don't have *nix, and you're not familiar with programming, then there is one way to do it, though it might be a little slow. Word does provide a find/replace where you can quickly just replace all words in a document/selection with a word you give it. It's quick to replace, the slow part is that if you are trying to replace a whole variety of words it may take a while.

On the other hand, if you don't mind learning to program, this is a something you could learn to code in probably a few hours if you're committed. Perhaps Java would suit your needs? http://www.tutorialspoint.com/java/

| improve this answer | |
  • And C++ could help you with the same too. Both the languages are easy to get into. – Sampark Sharma Aug 11 '15 at 13:06
  • Python would still be the easiest language to get into: learnpythonthehardway.org – Rex Feral Aug 26 '15 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.