T.O.C.

Intro

QuickStart

Basics

Databases

Glossaries

Advanced

Scripting


 

DATABASES

PowerGlot databases were shortly described in the previous (Basics) section. This chapter will teach you how to perform most common operations on databases. Once you get familiar with PowerGlot, you can read the Advanced file operations section, which shows you more complex things that can be done with PowerGlot.

 

CREATING DATABASES

Ways to create a database in PowerGlot

Drop files on the PowerGlot application

A new database is created, the files are added to it and PowerGlot fetches all the text from the files and displays a new window named Untitled database.

Start PowerGlot by double-clicking it

A new, empty database window named Untitled database is created and displayed

Select ÔNew databaseÕ from the ÔFileÕ menu in PowerGlot

A new, empty database window named Untitled database is created and displayed

 

Once you have created a database, you should immediately set the appropriate source and target languages from the Database Settings panel. This is especially important if you are translating across different script systems (for example, from English to Japanese), because PowerGlot relies on the selected languages and fonts to display and let you edit items with the correct font.

 

OPENING DATABASES

To open a database, double-click it from the Finder, or drop it on the PowerGlot icon. You can also select the Open... item from the File menu in PowerGlot.

 

ADDING WORK FILES TO DATABASES

 

To add work files to a database, you can:

Select 'Add work files...' from the 'Database' menu

A dialog box is displayed, allowing you to select one or more files to add to the database. Once you have chosen your files, click the Done button.

Drag a file from the Finder to the database window

The files are added to the database.

Use the Database Files window

See related information below.

Once you have added one or more work files to the database, PowerGlot immediately reads them, extracts the text and updates the database. It will most of the time reset the text containers pop-up menu to the first container.

 

THE WORK FILES WINDOW

Selecting the Work files... item from the Database menu opens the work files window. This window allows you to add or remove files from a database. You can also update a work file, which means Òswitch to another file then synchronizeÓ.

 

 

You can add files to the database by clicking the Add... button. This works the same way as selecting Add files... from the Database menu (see previous paragraph). You can also drag files from the Finder and drop them into the files list.

You can remove a file from the database by selecting it in the list, then click the Remove button.

You can update existing work files (switch to another version of the file) by clicking the Update button. When you do this, PowerGlot prompts you for the new file to use, then performs a synchronize operation to match the existing translations with the updated work file. This powerful feature allows you to work on version of software in development, then switch to new releases when developers give them to you for translation.

 

Removing a file from a database also definitively removes all the translations you have done for this file from the database. There is no way to cancel this operation after it has been done.

 

SAVING DATABASES

To save a database to disk, select the Save item from the File menu. You can also save your database under another name, using the Save as... item from the same menu. The next save operation will then be done to this new file.

When you close a database window, PowerGlot asks if you want to save it in the case you have modified something but not saved the database.

 

LOCALIZING ITEMS

Now that your database is all set, you want to start translating text. This is very easy: just click on an item in the list. The item edition zone (at the bottom of the database window) shows the original text, your translation and sometimes optional items (i.e. a command key for menu items, item bounds for Alert, Dialog and PowerPlant items).

Once you have clicked on an item, you can press the TAB key to go to the first text field (the original text field) which is not editable, but you can copy text from it. You can then press TAB again to go to the translation field, then type the translation.

To go to the next item, you donÕt need to click in the list again. Just press the ENTER key on the numerical keypad. PowerGlot brings the next untranslated item in the text item edition zone. If you were already in the translation field, you can immediately start to type your translation for this item.

TIP: Pressing the ENTER key does not bring you to the next item in the list but to the next untranslated item. This makes a big difference! It allows you to quickly browse all untranslated items in a list without having to look for it.

 

Double-clicking a text item reveals the item options window which allows you to lock/unlock it and add comments to it (up to 255 characters). Please refer to the Text item options in the Advanced topics section for more info on this.

 

SORTING TEXT ITEMS

Text items are sorted by resource type/resource id/item number by default, which provides for logical grouping of text items. By clicking in one of the column titles, you can select a different sorting order. If you press the alt key while clicking in the title, the sort order is reversed.

Beware that sorting by Source & translated text (which in fact only sorts on source text) can be slow for big lists (more than 500 elements) and take up to a few seconds.

The figure below shows you the effect of clicking in the "Source & translated text" column title. After selecting a different sorting order, the chosen columnÕs text appears with a dark gray background (like the one of a pushed button).

 

 

When sorting by another column than Type/ID, PowerGlot performs a secondary sort by the Type/ID column to preserve logical grouping of items.
Also note that when changing to a different text container, the sorting order is reset to Type/ID.

 

GENERATING THE LOCALIZED FILES

Once you have translated everything in your database, or you have completed enough translations and want to see the result, you can build the localized files. This process is very easy, but requires you to understand how PowerGlot does this.

There are two ways to build the localized files: either by having PowerGlot work from the original files you added to the database, or by letting it work from files you already have modified. This latter technique is described in the Advanced topics chapter of this manual.

To build your localized files from the original files, go to the Database menu and select the From Original Files... item from the Generate Localized Files submenu. PowerGlot asks you into which folder it should put the resulting files. The localized files are named as the originals, but prefixed with the ISO language code for the target language in the database. For example, if you translate SimpleText to Finnish, the localized SimpleText is named FI-SimpleText.

 

 

 

We recommend that you always create a destination folder for the resulting files when you are setting up your database.

Once you have selected the destination folder, PowerGlot reads your files a first time to make sure that nothing was changed since you created the database. This operation is called Synchronize and is described in the Advanced topics chapter of this manual. In case something was changed, PowerGlot automatically notices the changes, updates your database accordingly (adding or removing items as needed) then proceeds with the localization operation: it updates all translated text items in your files.

When this process is finished, you can open the destination folder you selected and check the resulting files (if you were localizing an application file, you can probably launch it and see the result of your work).

 

DATABASE SETTINGS

You should check database settings once you have created a database, before starting to translate. PowerGlot relies on source and target languages, fonts and font sizes to display and let you edit text items.

To open the settings window, select Database settings... from the Edit menu. This item is enabled only when a database window is frontmost.

The first tab, named ÔDatabaseÕ, contains the version and comments fields which are free text fields you can use for general versioning and information about your database. Below are the source language pop-up menu, source font pop-up menu and source font size field. An identical group of items controls the target language.

The source and target languages control how PowerGlot lets you edit text items. It is very important that you set the correct source and target languages, because it allows PowerGlot to determine from and to which script systems you are translating. In the language pop-up menus, PowerGlot disables those languages for which the appropriate script system is not installed on your system. If, for example, you want to localize to Korean, you have to install the Korean language kit (which is available from Apple Computer). If you have done this, the ÒKoreanÓ item in the language pop-up menus is enabled, otherwise it is disabled.

The font and font size you select for source and target languages is the one that will be used to enter text in text fields. You can not directly change the font used for display in the lists, because it is controlled by PowerGlot (depending on the language you selected).

 

The second tab, when clicked, reveals the consistency checks panel. A consistency check is an operation that PowerGlot performs on each text item. During this check, PowerGlot can slightly modify the text to alleviate for possible errors in the translation. All consistency checks work with all languages in which they have a meaning. When checking, consistency checks take into account the script systems of the source and localized strings, and use the appropriate characters in each script system (for example, the ellipsis character is not the same in the Roman and Japanese script systems).

There are actually three basic consistency checks, documented in the table below:

 

Consistency checks in PowerGlot

Convert dots (...) to ellipses in menus

Apple UI Guidelines state that you should use the ellipsis (option-dot) symbol instead of three separated dots in your menus. PowerGlot can check if you have groups of three dots and replace them with a single ellipsis symbol.

Remove carriage returns in menus

Although PowerGlot prevents you from typing the return key in a menu item, it may happen that you left such a character with a resource editor. This option removes carriage returns from menus, and should always be checked as CRs are not allowed in menus.

Equalize trailing spaces

This option ensures that there are the same number of trailing white-spaces in the source and localized string by adding or removing the appropriate number of white-spaces in the localized string.

Convert multiple spaces to one space

If several consecutive spaces are embedded into the text, remove the superfluous spaces and only keep the first one. Does not apply to the trailing spaces.

 

If you check the Automatic check while editing box, PowerGlot applies the consistency checks to an item when you modify it. Thus, it can happen that it modifies text you just translated to fix some mistake youÕve done.

The Advanced tab groups some settings you can change to customize PowerGlot for specific uses.

The Read/Write options box contains settings related to the way PowerGlot reads resources and localizes items in theses resources.

 

WORD COUNT

You can get statistics about your complete database by selecting the Word count... item from the Tools menu. The word count window shows up, then PowerGlot start counting text items, words and symbols in your database. As this can be a lengthy process for a big database, counting is done in the background so you can continue working. During this phase, the status label says Counting... and then says Done when counting is finished.

 

 

The first entry in the list (Total) appears only when counting is finished. There is a detailed count for each text container in your database, that displays the number of symbols, words and text items in the container. The first line of each container shows the original count, the second line shows the count for translated text. In the example above, we have just created a fresh database from SimpleText and did not do any translation, so each second line has a zero count.

You can leave this window open once the count is finished, do some work then click the Count again button to see the changes.

The definition of word counting is not as obvious as it seems, because everyone does not understand it the same way. Should hyphen-separated words be counted as one word? Should numbers be counted?

To solve the problem, PowerGlot uses a slow but reliable method. It basically calls the MacOS toolbox to find word breaks and relies on the internal system word-break tables. There will probably later be optional custom word-break tables, but actually thatÕs it.

 

FINDING AND REPLACING TEXT

PowerGlot comes with powerful find/replace tools. You can search items containing specific text either in the source text, translated text of comments fields, and you can replace text in the translated text field. You can even have PowerGlot search an item containing text in either the source and translated text, and if it finds what you want in the source text, and the translated text is empty, and you are replacing, it will copy the source text to the translated text the replace the term in the translated text.

To perform a find or replace operation, click the Find item in the Tools menu.

 

 

The Replace and Replace all buttons are disabled as long as the Ôreplace:Õ field is empty. They are also disabled if you choose to find in comments.

If you want to find text, you must type it in the ÔFind:Õ text field. If you want to replace this text with another text, type the replacement text in the ÔReplace:Õ text field. Then you can select the desired options:

 

Find/Replace options

Ignore case

If you check this option, PowerGlot performs a case-insensitive search. For example, if you look for ÔCancelÕ and a text item contains ÔCANCELÕ, a match will be found. This box is checked by default.

Continue from beginning

All find/replace operations are performed from the currently selected text item to the last item in the list. If you check this option, PowerGlot goes back to the beginning of the list, up to the currently selected item, if a match is not found. This option is checked by default.

Entire word

If you check this option, PowerGlot considers a successful match only if the term found in a text item is an entire word. For this option to work, you must only type one word (it wonÕt work with two distinct words - for example, if you look for ÔDo itÕ and PowerGlot finds a text item containing ÔDo itÕ, the match wonÕt be taken because ÔDo itÕ is two words).

Entire text

If you check this option, a text item must contain exactly the text you typed in to be considered a sucessfull match. If there are extra characters in the text item, it wonÕt be taken as a match.

Keep case on first word

This option is used only when replacing, and only for languages in the Roman script system. If you check this box, PowerGlot looks if the first letter of the text to be replaced in an item is upper- or lower-cased, and appropriately capitalizes the first letter of the replacement text. This allows you to perform replacements while keeping the correct case for the first letter of the first word of a sentence. This option is checked by default.

Find in:

The selected item in this pop-up menu determines where PowerGlot searches text. The various options are described below. By default, this menu is on the ÔSource textÕ item.

The Find in: pop-up menu lets you choose where in a text item PowerGlot will search. By default, this menu is set to ÔSource textÕ. This means that PowerGlot only looks in the source (original) text field of each text item. If you select ÔLocalized textÕ, PowerGlot looks only in the translated text field of each text item. If you select ÔBothÕ, the following rules apply:

The Replace button lets PowerGlot look for the next match (from the currently selected item in the list). If it finds a matching text item, if performs the replacement then stops. The Replace all button lets PowerGlot replace all occurences of the seach string in the current item list (from the currently selected item to the end of the list, then from the beginning if you checked the Continue from beginning box.

There are also a few issues you should be aware of if you are translating text across two different script systems (for example from English to Japanese). You cannot search a term in ÔbothÕ (source and translated text) because the scripts are not the same. If you select Ôsource textÕ, the script used to enter the text in the text fields is the source script of the database (the one of the source language), and if you select Ôlocalized textÕ, itÕs the target script. Moreover, if source and target scripts are different, Replace and Replace all buttons are disabled if you have selected ÔFind in: Source textÕ because PowerGlot wonÕt be able to copy the text from the source text field to the translated text field, as the scripts differ.

We know that these issues are pretty complex, but you have to understand that translating from one script to another is a complex task that makes some automatizations impossible.

 

PRINTING DATABASES

At any point in your work, you may need to print the database to have a better idea of what has been done and what remains to be done. With PowerGlot, you can print the current container only or the whole database. Choose the Print item from the File menu, then the print job dialog box shows up with additional items at bottom which are added by PowerGlot (see picture below).

 

The two radio-buttons pictured above determine whether you want to print the current text container only (current list of text items), or all the containers. If you click the All containers radio-button, PowerGlot prints all the text containers in the order they appear in the Text Containers pop-up menu, in the database window.

Note that PowerGlot preserves the selected sorting order while printing.

We recommend that you set Page Setup information to ÔHorizontalÕ, so that you get wider text lines and see more text on each itemÕs line.

 

AUTOMATIC TRANSLATION WITH GLOSSARIES

You can use a previously created and saved glossary to automatically translate terms in your database. This is very simple and can save you hours of work by translating the most common terms in your databases. To do this, select the Translate using glossary item in the Database menu. PowerGlot show you a file selector dialog box. Select a glossary file, then click the Open button. PowerGlot shows a progress box while doing the automatic translation, and thatÕs all!

Once the translation has been completed, you can browse your database to see what has been translated. Remember that you can check the counter that appears on the right of the list title line.

 

BUILDING A GLOSSARY FROM A DATABASE

Once you have translated some or all terms in a database, you may want to build a glossary. This automatically generated glossary takes all the translated terms in the database, along with the translation.

To build a glossary, select Build glossary... from the Database menu. The following options window appears:

 

 

The Options for each term box allows you to choose the options that will appear on each item in the glossary. For a description of these options, please refer to the glossary Term options chapter of this manual.

The Remove multiple translations of same term check-box is checked by default. When checked, PowerGlot only keeps the first translation it finds for a given term (for example, if the word ÔFileÕ is translated several times, only one term for ÔFileÕ is added to the glossary, with the first translation PowerGlot encountered for this term.

The Containers to build from box lists all the text containers in your database. You can decide to build a glossary only from some containers by clicking in the containersÕ name in the list. If the container is checked, PowerGlot scans it to find terms to add to the glossary.

Once your options are properly set, click the Build glossary button. PowerGlot displays a status window while building the glossary, then opens the newly created glossary.

 

You should take great care of the options you set for all items in your glossary, as this affects the way PowerGlot uses this glossary to auto-translate databases. One good thing to do is to review the glossary after PowerGlot creates it, and set different options for specific items (for example, ÔEntire wordÕ for words alone).

 

LOCALIZATION REPORT

Once you have completed a sufficient amount of work on a localization project, you can ask PowerGlot to build a localization report. It then checks the whole database and tells you what remains to be done, and possible errors.

To build the report, select Build localization report from the Database menu. PowerGlot then opens the localization report window, checks the database and issues messages for each problem it sees.

There are three kinds of messages: errors, warnings and informative messages.

You can double-click on an item on the list to directly access it in the database window.

You can print the localization report, or save it to the disk (using Save or Save as... from the File menu). The localization report is written in text format so you can open it with any text editor (SimpleText) or word processor.

An example of a localization report window is reproduced below. The icons at the top of the window are followed with counters indicating how many errors, warning and informative messages there are in the report. By default, all messages are displayed. You can selectively hide errors, warnings or informative messages by clicking in the appropriate icon near the counter, and show them by re-clicking the icon.