Back to Online itrans

Spreadsheet customization for the online itrans page

The online itrans page uses a spreadsheet for converting input text to Unicode characters. Users can make a copy of the spreadsheet, modify it, and upload it to the online itrans page, to have the conversion use the modified mappings.

The Online Itrans URL accepts a bunch of parameters which allow customization. It offers a way to automatically load customized conversion tables. It also offers a way to start with a specified number of textareas and scripts.


URL parameter s= to load specified scripts

The output boxes each show the input text in a specific script.
Use URL parameter s. For example: s=script-name[,script-name,...] to load specific scripts in each output box.

The script-name should match the name in the spreadsheet for itrans conversion without the leading # character.

Examples:
Load hindi only: www.aczoom.com/itrans/online/?s=hindi
Load hindi and sanskrit: www.aczoom.com/itrans/online/?s=hindi,sanskrit

The index.html file defines the maximum output boxes. Five is the maximum number in the current file, but it can be increased if making a local copy of this whole package and by updating index.html and adding more output boxes.

Using your own character mapping

This is a customizable application. The goal is to allow users to provide their own input to output mapping, by using their own version of the spreadsheet shown above. While itrans is used for Indic script output, the spreadsheet can be used to for any Unicode conversion of input text, based on one-to-one mapping of each input code to any string of Unicode characters.

There is no support available for this tool, other than this document. Knowledge of web tools and editors is required to modify the default behavior. In addition to the steps below, the code can also be copied by looking at the source of this web page, and a local web page created with input and output text boxes as desired.

  1. First, make a copy of the default spreadsheet. Either make an online copy, or download the spreadsheet if you wish to edit it using Excel or LibreOffice or other desktop application.
  2. To make a copy: Use the File → Make a copy ... command.
  3. Or, download a copy: Use the File → Download As... command.
  4. Then, edit your copy of the spreadsheet. The most common changes are to edit the rows in the INPUT column so that it uses different input codes.
  5. The default spreadsheet for itrans conversion has many cells with notes that describe the rows and columns in more detail. In short: make sure each row of the INPUT has unique codes with no duplicates. If creating new rows, copy and existing row to make sure it has data in all the columns.
  6. Once you have the spreadsheet data as you need it, export or download the spreadsheet as a tab-separated file. Only tab-separated .tsv files can then be loaded on this web page.
  7. Every spreadsheet program has a way to save a spreadsheet in a Tab-Separated format. In the online Google Spreadsheets for example, use the File → Download As... command with the Tab-separated values (.tsv, current sheet). Destktop spreadsheet programs may have different ways to do this - for example, the Save As may offer a way to save it in a Tab-Separated format and use a .txt file extension.. Or there may be an Export command that offers that.
  8. The tab-separated text spreadsheet can be loaded using the Load tab-separated spreadsheet with itrans data input field on the Online Itrans page.
  9. If the spreadsheet has no errors, it will be loaded and a message printed in the section above. If there are errors, it will pop up a dialog box with the error message.

URL parameter tsv= to load custom TSV conversion spreadsheet

For easier use of customized itrans conversion spreadsheet tables in tab-separated values format, there is the tsv= URL parameter for the Online Itrans URL, to load any custom table on page startup. This avoids the need to click on the Load tab-separated spreadsheet with itrans data button.

Make sure to provide the URL of a tab-separated values spreadsheet text file. And it must be hosted at a site has a permissible CORS policy otherwise the file cannot be fetched by the itrans script.

Examples:
Load the data file from the aczoom.com site:
aczoom.com/itrans/online/?tsv=data/DEFAULT.tsv
Or the Google Docs spreadsheet can also be loaded by using this URL:
aczoom.com/itrans/online/?tsv=https://docs.google.com/spreadsheets/d/14wZl8zCa4khZV3El2VGoqurKBLGx21mbS-yORi4w7Qo/export?format%3Dtsv%26gid%3D0
The default table from the source code Github site cannot be loaded since Github CORS setting rejects this request:
aczoom.com/itrans/online/?tsv=https://raw.githubusercontent.com/avinash311/itrans/master/js/data/DEFAULT.tsv [will fail]

The tsv= string should be URL encoded. At a minimum, encode = (%3D) and & (%26) in the tsv= value, as shown. The Google Docs Spreadsheet used for the default spreadsheet for itrans conversion can be downloaded as a TSV text file using the URL docs.google.com/spreadsheets/d/14wZl8zCa4khZV3El2VGoqurKBLGx21mbS-yORi4w7Qo/export?format=tsv&gid=0
and that URL string should be provided as a parameter to tsv=, after encoding it as a string by replacing the = and & characters as shown above.
There is no requirement to use Google Docs. Any URL that shows a tab-seprated text file with the itrans conversion tables can be given as the tsv= parameter.
The Online Itrans page section in the middle Customize the character mapping will show the tsv= parameter if that file was correctly loaded.

URL parameter tsv= to start with built-in ISO based input table

aczoom.com/itrans/online/?s=sanskrit,tamil,unicode-names,telugu,iso&tsv=iso
will load the built-in ISO based transliteration table. That also makes available the #iso output script. The built-in version is usually the same as the latest online version of the iso based itrans encoding.

Both URL parameters = and tsv=

To use multiple URL parameters, separate them by & character. Example:
aczoom.com/itrans/online/?s=sanskrit,tamil,unicode-names,hindi,telugu&tsv=data/DEFAULT.tsv
will use 5 output boxes with the listed scripts and use the conversion data as per the tsv= argument.


Modifications to the spreadsheet

  1. The above section outlines the steps to upload a modified spreadsheet. This section desribes the kinds of changes that can be done. New rows can be added (for new characters), new columns can be added (for new languages).
  2. If a new column is added, it will be automatically added to the Default output drop-down list. Alternately, use #language your-text to enter that text in the Enter itrans input: box. See the Examples present on the online itrans page. The name of the column for a language name must be of the form #name And if the custom spreadsheet has language columns deleted, that will remove those languages from the drop-down list.
  3. If a new row is added, make sure the INPUT column entry does not conflict with any other row. Additionally, if one of the two rows starts with the same character or sequence of characters as the other, then the longest sequence will be matched. So if rows k and h and kh exist, then input text kh will always match the longer kh sequence row. Use k_h in the input to have it match the k row and then the h row instead.

Note: itrans uses a precise mapping of input codes to output code. It is not a phonetic conversion system, nor is it meant to be. (There are many other systems that do that.) Itrans is a table-driven, customizable mapping of input words to any Unicode character sequence.


The source code for this client-side application is available at GitHub itrans link. It has the Javascript files, as well as this HTML web page and CSS files.

Please note that no technical support is available for this web page or for the tools on this web page.
If you do find a bug (note that mapping issues may not be bugs, you can modify the mapping and use a customized spreadsheet as described above), feel free to file it at the GitHub itrans issues page.


Back to Online itrans