PRBEditor makes it easy to manage properties files, those used by the Java language class java.util.PropertyResourceBundle.
The program may show more than one language in a table, where there is a row per key and a column per language.
A properties' file name is made of a base prefix, a language code and the fixed suffix ".properties"
<base-prefix>[ _languageCode].properties
The language code is optional. It is recommended that a properties file
without a language code exists, as
this is the file where the program will look for untranslated strings.
Therefore, this base file should contain default values for every
internationalized string.
PRBEditor will perform much better if the base file exists. It is advisable, when openning a resource file within PRBEditor, to choose a base properties file.
In this case, the program will automatically find and open all the available translations.
Features
Allows the modification of multiple language files at the
same time. These laguages are shown in a table with keys as row headers
and languages as columns.
Filtering of keys according to a regular expression. The filters can be stored for later use
Line coloring according to user-defined patterns
Simple embedded translator for simple common words like File, Copy or Cancel. The default included languages are English, Catalan and Spanish
Spell checker, which can be enabled/disabled and configured to check only those rows that match user defined patterns.
The
user can create special tools, InsChar tools, which have a string
attached. Everytime the user activates one of those tools, the string
attached is inserted into the cell currently being edited. Very useful
when your keyboard does not accomodate to the languages you are
translating to.
Multiple views, each one with its own filter
Can be easily configured to automatically convert html special characters to the corresponding html code
Estatistics: number of empty cells and number of keys matching user-defined patterns
Conversion of HTML special chars into HTML codes
Shows internationalized text as it would be seen in the program
Supports comments.
Supports Copy/Cut-Paste operations of multiple lines.
Supports Undo/Redo.
Supports Find and Replace.
Sorting of keys
System files tree view
Starting in version 0.9.6 a left-sided pane has been added. This pane
shows in a tree the system folders and the properties files available
in them.
Right clicking on a file or folder will pop up a context menu. This
menu has the options to open a properties file or create a new one. It
also offers the possibility to select a folder as the root of the view.
If this option is selected, then the pane will only show the files and
subfolders of the selected folder.
Once this option is set, the first folder shown in the pane will
represent the parent folder of the current folder. Double-clicking on
this folder will set as root folder the parent file of the current root
folder.
The last option, named Select Opened, searches, makes visible and selects in the tree the properties file currently opened.
Double-clicking on a properties file will also open that file.
Installation
To run the application, you'll need a Java Virtual Machine version 1.4 or 5 (1.5) already
installed in your computer. If you don't have one, you can download it from www.java.com
The application doesn't have any installer to run. Once it has been downloaded, unzip it
in your desired folder. The executable file is prbeditor-xxxx.jar, where xxxx is the version of the
applicacion you downloaded. In MS Windows OS it should be enough to double click this file to run the application,
but sometimes this system doesn't work. In this case and for other operating systems, the application can
be started from the command line with the following command:
<Java VM install directory>/bin/java -jar prbeditor-xxxx.jar [file-to-open]
The aplication saves its configuration files in the working folder,
and that usually is the folder from where you started the application. You can have multiple configurations
if you run the application from different folders.
To uninstall the application, just remove the downloaded and unzipped files along with the configuration files.
More on Filters
Filters are a tool provided to restrict the lines/rows the application shows to
the user. Its usage is specially useful when dealing with big files and
when strict naming rules are applied to organize the keys in our resource files.
For example, let's say we always use the prefix menu for all keys related to
resources used in the application menu, and the suffix icon for all those keys
whose value is a link to an image. We could force the application to only show menu
keys by creating and applying the filter menu.*. Alternatively, we could force
the application to only show image links by creating and applying the filter .*icon
Filters are regular expressions. The syntax is the same used by Java's regular
expression engine. Limited information about the syntax can be found
here.
Filters might be given a name so they can be stored and reused later on.
More on Views
A view is a Tab Panel that shows the contents of the opened resource files. Each view:
can have different locales opened;
can have a different filter applied, showing only a portion of the whole resource file;
Let's say we use some naming rules to organize the keys in our resource files.
For example, we always use the prefix menu for all keys related to
resources used in the application menu, and the suffix icon for all those keys
whose value is a link to an image. In this scenario we could create two
views: the first would show the menu related data (with the filter menu.*);
the second would show all image links (with the filter .*icon). Those images
used in the menu would have both, the menu prefix and the icon suffix,
and thus would appear in both views.
Note: a line/row inserted in any view will appear in all other views regardless
of the filter each view has applied. So, the views might need to be refreshed in
other to show only what the filter defines.
More on Translator
This version of PRBEditor includes a simple translator between English, Catalan and
Spanish languages. It is only useful for simple common words like File,
Copy or Cancel. When the user starts editing a cell, the application
tries to infern the proper value by looking at the values of other languages for
the same key. If any option is found, a popup with a list containing all possible
values is opened. The user can change the selection in the popup list by using the
up and down arrow keys or the mouse. To use one of the proposed values, it is as
simple as hitting the Enter key. To accept the current contents of the cell
without using any of the values in the popup, just hit the Tab of F2 keys.
The application suposes that the language of the default resource file (that
without locale suffix) in English. If that's not the case, this default language can
be changed by modifying the file conf.properties, located in the application
working directory, and created automatically if it can not be found when the
application is run. This file is a common properties file, and the line to change
looks like defaultLanguage=en.
More on Spell Checker
This feature is by default disabled, since the application is distributed without
dictionaries, due to their size. A dictionary is simply a text file containing a list
of valid words in lower case. Dictionaries for some languages have already been
compiled and are available for download from the application web site.
To enable the spell checker, just open the Preferences form and select the list
item named Spell Checker. The panel on the right will show all the
configuration options. In addition to the enable/disable check box, the panel accepts
a list of patterns the keys of the rows must match so its cells may be spell
checked. It is alo possible to specify a list of patterns the keys of the rows
can not match to be spell checked. Thanks to this mechanism the user can control
which rows may be checked, saving those cells that don't hold regular text,
like references to resources like images for instance. The rows whose cells are eligible for conversion will show this icon in the key cell.
Finally, the Dictionaries tab shows a list of all locales for which a list of valid
words exist. The two buttons allow to index new dictionaries and remove
existing ones. It is possible to index more than one dictionary for a given
locale, in which case a union will be made.
Once the spell checker is enabled, the engine will mark those words not recognised
with a wavy red underline, and only for those languages with an indexed dictionary.
Right-clicking on one word, and when the cell is in edition mode, will popup a list
of suggested similar words. Any word selected from this list will replace the
original word. Note that it doesn't matter whether the word is marked as wrong or not.
It is always possible to trigger the popup of similar words as long as a dictionary
for the language of the column has been indexed.
Spell Check Dialog
The Spell Check Dialog can be used to traverse the whole properties file to find
and correct spell mistakes. For each mistake found a list of alternate words
is shown. The user can choose one of these words to replace the mistaken one.
The user can also rewrite the word or ignore it. The ignore option may be valid
only for the current operation or the word may be added to a list of words to
be ignored always. This list of words is stored in a file called
wordsToIgnore.xml, which is created on the application's first run. The
file may contain several lists of words, each one applying to one locale or to
all locales.
The HTML special characters Converter
The HTML converter can automatically substitute html special characters
into html codes.
It can also show the special characters instead of HTML codes to easy
the reading of cell values.
The HTML converter is disabled by default. It can be enabled from the
preferences form. The converter
can be configured to only monitor those cells whose key matches or not
user defined regular expressions. The rows whose cells are eligible for
conversion will show this icon
in the key cell.
The converter only works at the time of cell edition. When the user
edits a cell (using the default editor or the pane editor) that is
selected as being monitored by the HTML converter,
all the typed special characters will be converted to HTML codes once
the edition stops. The converter will not convert special chars when a
file is opened or closed, only when a cell is edited.
Not all special characters are translated. The following ones still
need to be coded manually: &, ", <, > The full list of converted characters can be seen in the Preferences Form, HTML Converter option, Conversion Table tab.
The option of showing special characters instead of codes works independently of whether the converter is enabled or not.
Those characters affected by this option will be marked with a green line above them.
Application Menu
File Menu
New: Creates a new base file at the location specified by the user. Once created, the user can add languages.
Open:
The user specifies a base properties file and the application opens it
along with all the language files located in the same folder.
Save: Saves the contents of the opened files.
Save As: Saves the files with a new name.
Reload: Reloads the files to synchronize them with their state on disk, in case they have been modified by another application.
Exit: Closes the program.
Edit Menu
Undo:
Undoes the last modification performed. The size of the list containing
the undoable modifications limited only by the available memory.
Redo: Redoes the last undone modification. The list of redoable modifications is cleared each time the user modifies a value.
Insert: Inserts a new line above the selected one. If no line is selected then a new line is added to the files.
Delete: If a key is selected, removes the complete line. If values are selected, those values are set to blank.
Copy: Puts the contents of the selected keys/lines or values in the system clipboard.
Cut: Same as copy but it also deletes the selected cells.
Paste: Pastes the contents of the clipboard over the selected cells.
Views Menu
Create View: Creates a new view.
Close View: Closes the currently selected view.
Rename View: Renames the currently selected view.
Tools Menu
Find:
Looks for a string in all the table cells, starting from the selected
one or the begining of the table if no cell is selected. It can also
replace the strings found by another string specified by the user.
Go to line: Shows and select the line/row entered by the user.
Filter: Given a regular expression, hides the lines whose key doesn't match that regular expression. As an example, the filter action.* would show only those lines/rows whose keys start with action
Filter management: Allows the user to create and modify filters to be stored for later use.
I.C.Man:
Allows the user to manage InsChar tools. This tools have a string
attached and, when activated, that string is inserted in the cell being
edited. Really useful when your computer keyboard does not support all
the languages you are managing.
Sort keys: Sorts the keys grouping them according to the key-word separator character.
Statistics:
Computes the number of keys that conform to user-defined patterns for
each language. For example, you can use it to know how many empty cells
each language has.
Preferences: Changes application configuration:
General: Configuration of the locale assigned to the default resources file and the encoding used to load/save the resources.
Fonts & Colors:
Allows the user to change the working font and color for regular and
comment lines. It also allows to define regular expressions and specify
font and color for those lines whose keys match the regular expressions.
Spell checker:
Configures the spell/checker tool: enable/disable the spell checking
engine; define the patterns of the keys of the rows that may and may
not be checked; index/unindex the dictionaries to be used.
Editors: Binds key patterns to value editors. There are three editors available:
Default: Default table cell editor, with spell-checking and translator.
Pane:
Opens a small window, giving more space to edit the value. Better used
for long texts. Includes syntax coloring for html text. It can be
opened explicitly from the default editor by pressing F2.
Accelerator: A table cell editor designed to edit action accelerators and KeyStrokes.
HTML Converter:
Configures the HTML Converter tool: enable/disable the conversion
engine; define the patterns of the keys of the rows that may and may
not be converted; view the character conversion table.
Locale Menu
New Locale: Creates a new language file.
Set Visible Locales: Allows the user to show/hide the desired language files.
Delete Locales: Deletes the language files the user specifies.
Help Menu
Contents: Shows this help.
Check for updates:
Connects to the home web site and downloads version information of the
latests update, to compare it with the installed version. No local
information is send to the server.
About: Shows application information.
Web home page: Opens PRBEditor's home page in your web browser.
Table header pop-up menu
Delete language: Deletes the language represented by the column that activated the pop-up menu.
Hide language: Hides the language represented by the column that activated the pop-up menu.
Resize to fit: Resizes the column so the contents of all its cells are fully visible.
Integration with Eclipse 3.1
There are two ways to integrate prbeditor with eclipse 3.1, as an external
editor or as an external tool. The later is easier to do, but the former provides
better integration and comfortability. Below you'll find detailed instructions
for both ways. Both have been done in the windows version of eclipse 3.1
Integration as an external tool
Open the External Tools management window, under the menu Run/External Tools/External Tools
Create a new Program configuration
Configure the new program as in the picture below
Location: path to the java VM launcher Working Directory: where the program will store the configuration files Arguments: replace <prbeditor-install-dir> for the folder where you unzipped prbeditor
To edit a resource using prbeditor, from the view Package Explorer or
Navigator select the master resource to edit and run the external tool
just created
Integration as an external editor
Create a DOS bat file with the following commands:
cd <folder-where-to-store-config-files>
<java-install-dir>\bin\java -jar "<prbeditor-install-dir>\prbeditor-0.9.5_7.jar" %1
For linux, just create the equivalent commands in a sh file (sorry, I don't know them)
Open the eclipse's Preferences Window and, inside it, select the General/Editors/File Associations editor
In the File Types list, select *.properties. You may have to add it if it is not already there
In the Associated Editors list, add the bat file just created
Accept the changes
From now on, you should be able to edit your resource files with prbeditor.
The name of the bat file you created should appear in the file context sub-menu Open With.
From the view Package Explorer or Navigator, right-click on a
resources file to be edited and select the sub-menu Open With
Integration with NetBeans 5.0
To be able to launch prbeditor from NetBeans 5.0, just download and install the Netbeans module from prbeditor's web site.
The module, once installed, adds an option to .properties files context menu that opens the file in prbeditor.
The application must be downloaded and installed separately.
To configure the module, go to Tools/Options/Miscellaneus/Prbeditor.
Once there you must specify the installation folder of prbeditor application,
the java VM home folder and, optionally, the folder where to load/store
prbeditor's configuration files