What are KeyPair files?
KeyPair files are text files (ANSI or UNICODE encoded) with a unique identifier per line. The file extension for a KeyPair file is not limited it can be chosen from the developers (e.g. *.txt, *.xyz)
Syntax for a KeyPair files:
[Unique ID] [Delimiter] [Phrase for translation]
For example:
1=Open
2=Close
3=Exit
...
or
ID1:Open
ID2:Error message
ID3:Close
...
or many more...
Click on the small browse button in the KeyPair Files grid (see above) to open the configuration Wizard:
Insert the path and the file name from your source file into the text field Filename or select the file by clicking on the browse button on the right side. A common file open dialog will be opened.
NOTE: Please be sure to select a file which is conform to the syntax of KeyPair files or is a JAVA resource file (*.java, *.properties)!
In case that you have selected a JAVA resource file, you will also have to check on the checkbox selected file is a JAVA file (*.java, *.properties).
All other configuration settings (step 2 to 7) will be disabled and you can continue with step 8.
In the group box Characters to define a comment line please define all characters which mark a comment line.
NOTE: A comment line will not be translated, but it will be imported to the corresponding source phrases to give some context for translation.
KeyPair sample structure:
// This phrase is used to open a dialog
1=Open
2=Next
// This phrase is used to end the application
3=Exit
In our sample the comment line can be recognized via the "//" character sting at the beginning of each line.
To configure this character string, please insert // into the text field Character. Then please click on the button . Your character string will be moved to the Used characters list.
Repeat this step for all (comment) lines within your file which are not conform with the syntax for KeyPair files (see above).
If you forget to configure a character string, Visual Localize will display an error message when the KeyPair file shall be imported.
To remove a character string which was defined to identify a comment line, please select the desired string in the Used characters list box. Then please click on the button .
In the group box Comment line(s) will be added you can choose the way how a comment is added to the phrases for translation:
Via the radio button only to the translation line below, all comment lines are added ONLY to the first translation line which is found directly below the comment.
In our sample above, the comment "This phrase is used to open a dialog" will be added only to the phrase "Open".
The comment "This phrase is used to end an application" will be added to the phrase "Exit".
Via the radio button to all translation lines below, the comment lines are added to all translation lines below until a new comment line is found.
In our sample above, the comment "This phrase is used to open a dialog" will be added to the phrases "Open" AND "Next".
The comment "This phrase is used to end an application" will be added to the phrase "Exit".
In the group box Delimiter, you will have to define the character or sting which is used to separate the unique identifier (on the left side of the delimiter) with the phrase for translation (on the right side of the delimiter). In our KeyPair sample structure the used delimiter is the Equal sign (=).
In case that your KeyPair file has a header which is not for translation, you can configure Visual Localize to start parsing the KeyPair file from a defined line via Start import at row.
With the combo box File origin please select the encoding format for your source KeyPair file (Windows ANSI, UNICODE or UTF-8).
In the combo box Saving please select the encoding format for your translated target KeyPair file (Windows ANSI, UNICODE or UTF-8)
Confirm all your settings by clicking on the OK button. Visual Localize will store these configuration settings for the selected file.
In case that an error message is displayed please check if you have configured all comment lines correctly and the syntax for KeyPair files is also correct.
Further Information