| |||||||
|
|
|
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.
- Database tab
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).
- Consistency checks tab
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.
- Advanced tab
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.
- Match resources by name
This box should not be checked, except in very specific cases. Usually, when PowerGlot synchronizes a database or localizes the work files it contains, it matches resources by their type and ID. That is, to localize text in ÔSTR#Õ resource number 128, it will look in the file if the STR# 128 is here and, if so, localize it. The same thing is done when synchronizing resources.
But in the case of Apple Guide files, the problem is more complex. Apple Guide text is stored in ÔTEXTÕ resources which change IDs each time Guide Maker rebuilds the guide database. Thus, the only way to match resources if you want to synchronize the database after a rebuild is to check the Match resources by name box.
This case is very rare and wonÕt be of any use to most localizers.
- Preserve ÔextendedÕ bit
This box should be checked even more rarely than the previous one. There is a special bit in each resource, called the Extended bit, which tells the Resource Manager that a resource is compressed. This occurs only in the System file, and some other files from Apple Computer. Unfortunately, when an application accesses a resource through the Resource Manager, the resource is automatically uncompressed but there is no way to recompress it prior to writing it back to the disk.
So what happens is that PowerGlot always clears the ÔExtendedÕ bit prior to writing a resource that it has localized, to ensure that this bit wonÕt fool the Resource Manager.
Some people may give other meanings to the Extended bit, even if this way of doing things is not encouraged by Apple. Checking this box ensures that PowerGlot leaves the Extended bit unchanged when it localizes resources.
- Update item sizes when localizing
A common problem that localizers encounter is the resizing of items. Usually, when you translate text from English to another language, the text is bigger. For visual items like dialog boxes, this can be a problem because developers may not have made the item big enough for the text to be entirely visible on the screen. Localizers have to edit the localized files with ResEdit or Metrowerks Constructor (for PowerPlant windows) to resize the items.
But of course the next time the tool builds a localized version of the files, the changes are lost. This is why PowerGlot stores each itemÕs original size and the new required size for Alert, Dialog and PowerPlant items. The edition zone at the bottom of the database window shows the items bounds, so you can change them.
If you check the Update item sizes when localizing box, PowerGlot will change each itemÕs coordinates to the new ones (if youÕve changed them) when localizing.
While changing each itemÕs coordinates by hand is tedious, there is another way of doing things. It is described in the Advanced chapter of this manual.
|
|
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:
- PowerGlot first looks into the translated text field. If a match is found and if you are replacing, is replaces your match in this field.
- It then looks into the source text field. If a match is found and if you are replacing, and if the translated text is empty, it will first copy the full source text to the translated text field of the item, then perform the replacement, then continue the search. Otherwise if you are replacing but the translated text field is not empty, PowerGlot doesnÕt do anything and continues on.
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.
- Error messages are identified by a
icon. They actually report only one error, when items are not localized.
- Warning messages are identified by a
icon. They report potential problems, like when an item has localized text but the source text is empty.
- Informative messages are identified by a
icon. They give information about things you should check, for example if you have translated a ÔTEXTÕ resource having an associated ÔstylÕ resource. In this case, youÕll have to open this resource with ResEdit to check the text style.
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.