ref: a7081490dbeda19788e6374a080ee38606aa3cd3
dir: /sys/man/4/ktrans/
.TH KTRANS 4 .SH NAME ktrans \- language transliterator .SH SYNOPSIS .B ktrans [ .B -K ] [ .B -k .I kbd ] [ .B -l .I lang ] [ .B -m .I mnt ] .nf .IB /mnt/ktrans/kbd .IB /mnt/ktrans/kbdin .IB /mnt/ktrans/lang .fi .SH DESCRIPTION .I ktrans is a fileserver that provides a transliteration overlay to .IR kbdfs (8). When run, .I ktrans mounts itself to .B /mnt/ktrans and binds its own .B kbd and .B kbdin files over those present in .BR /dev . .PP By default, .I ktrans also forks and reads input from the existing .BR /dev/kbd . The .B -k flag changes which file is read. The .B -K flag disables this process all together, limiting input to only the .B kbdin file. .SH CONVERSION Conversion is done in two steps: An implicit layer that is used for direct mappings between latin characters and an explicit multi rune conversion used for compound mappings. .I Ktrans does implicit conversion by passing through characters as they are input. Then when a sequence of input is matched, backspaces are emitted to clear the input sequence and the matched rune sequence is emitted. The last 'word' of input may be then additionaly transliterated by typing ctrl-\\. A newline character also performs this lookup, but additional newline characters will not cycle through alternatives. .SH CONTROL The language is selected by typing a control character: .TP .B ctl-t Passthrough mode .TP .B ctl-n Japanese mode. Implicit layer converts hepburn sequences to hiragana. Explicit layer converts sequences of hiragana with optional trailing particle or okurigana. .TP .B ctl-k Implicit only Japanese Katakana layer. .TP .B ctrl-c Chinese Wubi mode. No implicit conversion is done. Explicit layer converts sequences of latin characters to hanzi. .TP .B ctl-l Clear the explicit layer's current input sequence. .TP .B ctl-r Russian mode. Implicit layer converts latin to Cyrillic; the transliteration is mostly phonetic, with .B ' for .IR myagkij-znak (ь), .B '' for .I tverdyj-znak (ъ) .I yo for ё, .B j for .IR i-kratkaya (й). .TP .B ctl-o Greek mode. .TP .B ctl-s Korean mode. Implicit layer converts latin to Korean Hangul. .SH SOURCE .B /sys/src/cmd/ktrans .SH SEE ALSO .IR rio (1) .IR kbdfs (8) .br .IR /sys/src/cmd/ktrans/README.kenji .br .IR /sys/src/cmd/ktrans/READMEJ.kenji .SH EXAMPLES To type the following Japanese text: .ft Jp 私は毎日35分以上歩いて、 更に10分電車に乗って学校に通います。 健康の維持にも役だっていますが、 なかなかたのしいものです。 .ft your keyboard typing stream should be: watashiHA[^\\]mainichi[^\\]35[^l]fun[^\\]ijou[^\\]aruIte,[^\\] saraNI[^\\]10[^l]fun[^\\]denshaNI[^\\]noTte[^\\]gakkouNI[^\\] kayoImasu.[\\n]kenkouNO[^\\]ijiNImo[^\\]yakuDAtteimasuga,[^\\] nakanakatanoshiImonodesu.[\\n] where [^\\] and [^l] indicate 'ctl-\\' and 'ctl-l', respectively. See README.kenji for the details of this Japanese input method. .SH BUGS .PP There is no way to generate the control characters literally. .SH HISTORY Ktrans was originally written by Kenji Okamoto in August of 2000 for the 2nd edition of Plan 9. It was imported in to 9front in July of 2022, with patches by several contributors.