Rainbow - Main Window

From Okapi Framework
Jump to: navigation, search

Input List Tabs

Root

Each input list is associated with a root. Each list can have a different root. This root is displayed above the tabs, allowing you to see it even when another type of tab is selected.

To change a root:

  • Select Edit Root in the Input menu (or the context menu),
  • or press F2,
  • or click on the browse button near the root.

To use for root the directory where the project is saved leaves the root field empty. If the project is not saved yet, the root will point to your home directory.

When a new project has not been saved yet, the default root is the user's home directory. The first time you add a document to one of the input lists, Rainbow will automatically change the root of that list as well as the Filter Parameters option to the directory where the added document is located.

If there is already an input document in the list and you add one that cannot use root currently defined, the tool will try to adjust the root automatically (and all the relative path of the document already in the list. If the documents are on different shares or drives you may not be able to adjust the root.

Expansion of system environment variables such as ${HOME}, as well as the Okapi-specific ${rootDir} (the location of the .rnb file when saved; the user's home directory when unsaved), is supported.

Input Documents

To add a document in a list:

  • Select the Add Documents in the Input menu (or the context menu),
  • or press Ctrl+Insert,
  • or drag the documents and drop them on the list.

You can move the documents up and down in the list (for example to align them with another list) by using the commands Move Up and Move Down in the Input menu (or the context menu), or press Alt+Up and Alt+Down.

To select all documents in the list press Ctrl+A.

To remove documents from a list: Select the documents you want to remove and select Remove Documents in the Input menu (or the context menu), or press Delete. You will be prompted to confirm the removal. Removing a document from the list does not affect the real document in any way.

To associate a document with a specific filter configuration: Select the document and select Edit Document Properties in the Input menu (or context menu), or press Alt+Enter, or double-click on the Filter Configuration column. This will open the Input Document Properties dialog box where you can make changes.

Languages and Encodings Tab

Source

Language — Enter or select the code of the source language.

The language codes can be any type of BCP-47 code, or POSIX locales.

Note: Locale and Languages. Nowadays there is not many difference between a language code and a locale code, as the new language tags of the BCP-47 includes sub-tags that represent various regional or special variants, as well as script difference. For example, ES-005 stands for Latin-America Spanish, zh-Hant-tw for Traditional Chinese used in Taiwan, etc. For more information about BCP-47 see http://tools.ietf.org/html/rfc4647, and this overview: http://www.w3.org/International/articles/language-tags/. See also the "How to Add Languages to Rainbow" article.

The terms locale and language used interchangeably in Rainbow's interface.

Encoding — Enter or select the name of the encoding for the source language. This is the default source encoding. You can overwrite this value for each input document in the Input Document Properties dialog.

You can obtain a list of all encodings supported by your system with the Tools > List Available Encodings command.

When used as an input encoding, the encoding defined here and in the Input Document Properties dialog, may be superseded by the encoding automatically detected in the input file.

Target

Language — Enter or select the code of the target language.

Encoding — Enter or select the name of the encoding for the target language. This is the default target encoding. You can overwrite this value for each input document in the Input Document Properties dialog.

Other Settings Tab

Output

Some utilities generate one output document for each input document (e.g. Encoding Conversion). You can choose the location and the name of these output files here.

Use this root — Set this option to replace the input root by the root entered in this field.

Custom sub-folder — Set this option to add an extra sub-directory between the root and the relative path of the output file. For example:

Original input root = C:\myProject
Relative input path = mySubDir\myFile.ext
      Use this root = D:\myOutput
  Custom sub-folder = ExtraSubDir

Before = C:\myProject\mySubDir\myFile.ext
 After = D:\myOutput\ExtrasubDir\\mySubDir\myFile.ext

Use an extension — Set this option to use a specific extension in the output file. Enter the extension (with its period) in the field.

Replace — Set this option to replace the extension of the input filename by the one defined here. (For example: "file.old" becomes "file.new"). The old extension is the last part of the text preceded by a period. (For example: "file.old1.old2" becomes "file.old1.new").

Append — Set this option to add the extension defined here at the end of the existing one. (For example: "file.old" becomes "file.old.new").

Prepend — Set this option to place the extension defined here just before the existing one. (For example: "file.old" becomes "file.new.old").

Add the following prefix — Set this option to add a specific prefix text at the beginning of the filename. Enter the prefix string.

Add the following suffix — Set the option to add a specific suffix at the end of the filename (before any '.' character).

Replace this text — Set this option to replace the text given in this field by the one given in the By this text field.

By this text — Enter the text to replace the one provided in the Replace this text field.

Note that replacements are done on the full path (i.e. in the directory part as well as the filename part).

Anywhere in the output fields you can use a set of variables based on the source and target locales. They will be replaced by their corresponding runtime equivalents:

  • ${srcLang} = Source language code as defined in the source Language field. For example: en-US.
  • ${srcLangU} = Source language code in uppercase. For example: EN-US.
  • ${srcLangL} = Source language code in lowercase. For example: en-us.
  • ${srcLoc} = Source locale code (language in lowercase, region in uppercase, with a _ separator). For example: en_US.
  • ${srcLocLang} = The language part of the source locale (in lowercase). For example: en.
  • ${srcLocReg} = The region part of the source locale (in uppercase). For example: US. Or empty if no region is specified.
  • ${trgLang} = Target language code as defined in the target Language field. For example: fr-CA.
  • ${trgLangU} = Target language code in uppercase. For example: FR-CA.
  • ${trgLangL} = Target language code in lowercase. For example: fr-ca.
  • ${trgLoc} = Target locale code (language in lowercase, region in uppercase, with a _ separator). For example: fr_CA.
  • ${trgLocLang} = The language part of the target locale (in lowercase). For example: fr.
  • ${trgLocReg} = The region part of the target locale (in uppercase). For example: CA. Or empty if no region is specified.

The names of the variables are case-sensitive. However, for backward compatibility, the first letter can be in uppercase (e.g. ${SrcLang}).

Any locale-related variable (i.e. has "Loc" in the variable name), has no predictable behaviour if the corresponding language code declared in the Languages and Encodings tab is not compatible with a locale notation.

Filter Parameters

Use custom parameters folder — Set this option to define an absolute location for the directory where the filter parameters files reside. If this option is not set, the filter parameters files are expected to be in the project directory