Text shortcuts

CafeTran offers two different means of typing assistance:

  1. Auto-completion (predictive typing)
  2. Text shortcuts

Text shortcuts

You can see text shortcuts as a kind of shorthand. When you frequently have to type a long (multi-word) term or for instance a difficult chemical formula, you can assign an abbreviation to quickly enter this long text into your Target language pane.

Creating a text shortcut

  • In the Target language pane you type the long string that you have to insert often.
  • Select the string.
  • From the Tools menu choose Text shortcuts and then Add selection to text shortcuts.

CafeTran will show a dialogue box that will display the long string and a suggested abbreviation that you can modify. Try not to choose ‘normal’ words for the abbreviation, in order to prevent unwanted expansion. Note that abbreviations shouldn't include each other. So if you have an abbreviation ‘pneu’ you cannot have a abbreviation ‘pneum’ too.

In case of multi-word strings, CafeTran will suggest an abbreviation consisting of the first letter of every word.

0.png

Saving your text shortcuts

Text shortcuts are only active in the session during which they were defined. If you want to save them permanently you will have to save them to disk:

  • From the Tools menu choose Text shortcuts and then List text shortcuts.
  • Delete any text shortcuts that you don't want to save permanently by clicking on the corresponding red circle with a white cross.
  • Once your satisfied with the result, click on the Save button:
save.png

When you are saving your text shortcuts for the very first time, CafeTran will ask you to enter a name for the file that will store all your text shortcuts.

  • Enter a name, e.g. textshortcuts.txt:
firstsaving.png

The file containing your text shortcuts is stored in the folder:

/Applications/CafeTran.app/Contents/Java/resources/shortcuts/ (Mac)

or

c:\Users\Igor\Documents\CafeTran Espresso\cafetran\resources\shortcuts\ (Windows)

You can switch between different files with text shortcuts via Edit > Options > General > Text shortcuts.

The structure of the textshortcuts.txt file is as follows:

shortcut equals sign text to expand

Example:

aamof=as a matter of fact
constipatic=[2-(14-hydroxypentadecyl)-4-methyl-5-oxo-2,5-dihydrofuran-3-carboxylic acid]
pneumon=Pneumonoultramicroscopicsilicovolcanoconiosis

Note that these text shortcuts are case sensitive. So if you want to be able to expand the shortcut above to ‘As a matter of fact’, you will have to add a second entry to the list:

aamof=as a matter of fact
Aamof=As a matter of fact

Please also note that the text shortcuts only expand in the Target segment pane and not in any dialogue boxes.

You can edit the shortcuts file with a text editor, e.g. to sort the lines alphabetically or to add lines from another source. Any modifications will be active the next time that you start CafeTran.

PLEASE NOTE: If you want to use text shortcuts in dialogue boxes, you can use a system-wide tool like AutoHotkey or Typinator.

Adding formatting commands to text shortcuts

You can add formatting tags to the expanding part of a text shortcut, e.g.

ch4=CH<sub>4</sub>

Whenever you type ‘ch4’ in the Target language pane, this will expand to:

ch4.png
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License