<xliff version='1.0'>
<file original='somefile.exe' source-language='en-US' datatype='Win32 Resource'>
- The Win32 resource types that will be discussed here are menu, dialog,
string, accelerator, and message. These are the resources that commonly contain
localizable data.
- The Win32 resources are grouped by type. Thus, a group will be created for
each resource type implemented.
<xliff version='1.0'>
<file original='somefile.exe' source-language='en-US' datatype='Win32 Resource'>
<header></header>
<body>
<group restype='type'>
</group>
</body>
</file>
</xliff>
1.1. Menu resources
- Menu resources will be grouped in the <group restype='menu'> group.
- Each menu is assigned an ID in the resource file and is grouped under that
ID.
- The id attribute value of the menu container group is given the menu id,
which is the parent id when retreiving the menu from an executable.
- A trans-unit is created for each menu-item.
- A serial value corresponding to the absolute retreival order of the
resource is assigned for the id attribute value of the trans-unit. This is
applied consistently throughout the menu and all subsequent resources. This
allows us to assign a unique id to each resource within the resource file. It
also is necessary because there is no name identifier associated with the
parent menu-item of apop-up menu. For menus the retrieval order is the first
menu-item followed by any pop-up menu-items followed by the next menu-item.
- The menu-option attribute value of the menu-item indicates that menu-item's
location in the menu and provides the structure of the menu. These menu-options
are additive so that a menu-option of 145 is a grayed (1) parent of a pop-up
menu (16) and the last menu-item (128) in the current menu (145 = 1 + 16 +
128).
- The name of the menu-item becomes the resname attribute value of the
trans-unit.
- Separators have a name value of 0, a menu-option of 0, and a null caption.
The translate attribute value of these trans-units is 'no'.
- Following a trans-unit with a menu-option attribute value of 16 is a group
containing the pop-up menu menu-items.
- The pop-up menu group will have a restype of 'popup-menu'.
- The caption of the menu-item becomes the content of the source element.
<group restype='menu'>
<group id='menu-id'>
<trans-unit id='absolute retreival order' menu-option='menu-option' resname='name'>
<source>caption</source>
</trans-unit>
<trans-unit id='absolute retreival order' menu-option='menu-option' resname='name'>
<source>caption</source>
</trans-unit>
<group restype='popup-menu'>
<trans-unit id='absolute retreival order' menu-option='menu-option' resname='name'>
<source>caption</source>
</trans-unit>
</group>
</group>
</group>
Example: Novell Red Menu 7519
The main menu of Novell Red will be used as an example. The following is the
main menu as displayed by Microsoft DevStudio.
In this example, the menu identifier is '7519'. This menu consists of
a menu-bar with three menu-items: &File, &Tools, and &Help. The
'&' indicates the accelerator key to use in accessing the menu-item, thus
the underlined character.
Each of the menu-bar menu-items is followed by a pop-up menu. These pop-up
menus are grouped together following the menu-item that is their parent.
The resources of Novell Red's main menu are extracted in the following
order.
Example: Novell Red Menu ID 7519 Resources
Id |
Parent |
Name |
Menu-option |
Caption |
1 |
7519 |
0 |
16 |
&File |
2 |
7519 |
7528 |
0 |
&Open...\tCtrl+O |
3 |
7519 |
7002 |
0 |
&Close\tCtrl+F4 |
4 |
7519 |
7003 |
0 |
&Save\tCtrl+S |
5 |
7519 |
0 |
0 |
|
6 |
7519 |
7004 |
0 |
&Login to NILE... |
7 |
7519 |
65535 |
1 |
&Transfer |
8 |
7519 |
0 |
0 |
|
9 |
7519 |
7005 |
0 |
&Preferences... |
10 |
7519 |
0 |
0 |
|
11 |
7519 |
7006 |
0 |
Loa&d Custom DLL... |
12 |
7519 |
7007 |
0 |
&Remove Custom DLL... |
13 |
7519 |
0 |
0 |
|
14 |
7519 |
7008 |
128 |
E&xit\tAlt+F4 |
15 |
7519 |
0 |
16 |
&Tools |
16 |
7519 |
7134 |
0 |
&Word Count... |
17 |
7519 |
7534 |
0 |
&Near Match Lookup... |
18 |
7519 |
7136 |
0 |
&Terminology Manager...\tAlt+F1
|
19 |
7519 |
0 |
0 |
|
20 |
7519 |
0 |
145 |
&Macro |
21 |
7519 |
7137 |
0 |
&Play...\tAlt+F10 |
22 |
7519 |
7138 |
128 |
&Edit...\tCtrl+F10 |
23 |
7519 |
0 |
144 |
&Help |
24 |
7519 |
7160 |
0 |
&Help Topics |
25 |
7519 |
7161 |
0 |
&Tip of the Day... |
26 |
7519 |
0 |
0 |
|
27 |
7519 |
7162 |
128 |
&About... |
Example: Novell Red Menu 7519 in XLIFF
<group restype='menu'>
<group id='7519'>
<trans-unit id='1' resname='0' menu-option='16'>
<source>&File</source>
</trans-unit>
<group restype='popup-menu'>
<trans-unit id='2' resname='7528' menu-option='0'>
<source>&Open...\tCtrl+O</source>
</trans-unit>
<trans-unit id='3' resname='7002' menu-option='0'>
<source>-&Close\tCtrl+F4</source>
</trans-unit>
<trans-unit id='4' resname='7003' menu-option='0'>
<source>&Save\tCtrl+S</source>
</trans-unit>
<trans-unit id='5' resname='0' menu-option='0' translate='no'>
<source></source>
</trans-unit>
<trans-unit id='6' resname='7004' menu-option='0'>
<source>&Login to NILE... </source>
</trans-unit>
<trans-unit id='7' resname='65535' menu-option='1'>
<source>&Transfer</source>
</trans-unit>
<trans-unit id='8' resname='0' menu-option='0' translate='no'>
<source></source>
</trans-unit>
<trans-unit id='9' resname='7005' menu-option='0' >
<source>&Preferences... </source>
</trans-unit>
<trans-unit id='10' resname='0' menu-option='0' translate='no'>
<source></source>
</trans-unit>
<trans-unit id='11' resname='7006' menu-option='0'>
<source>Loa&d Custom DLL... </source>
</trans-unit>
<trans-unit id='12' resname='7007' menu-option='0'>
<source>&Remove Custom DLL... </source>
</trans-unit>
<trans-unit id='13' resname='0' menu-option='0' translate='no'>
<source></source>
</trans-unit>
<trans-unit id='14' resname='7008' menu-option='128'>
<source>E&xit\tAlt+F4</source>
</trans-unit>
</group>
<trans-unit id='15' resname='0' menu-option='16'>
<source>&Tools</source>
</trans-unit>
<group restype='popup-menu'>
<trans-unit id='16' resname='7134' menu-option='0'>
<source>&Word Count... </source>
</trans-unit>
<trans-unit id='17' resname='7534' menu-option='0'>
<source>&Near Match Lookup... </source>
</trans-unit>
<trans-unit id='18' resname='7136' menu-option='0'>
<source>&Terminology Manager...\tAlt+F1</source>
</trans-unit>
<trans-unit id='19' resname='0' menu-option='0' translate='no'>
<source></source>
</trans-unit>
<trans-unit id='20' resname='0' menu-option='145'>
<source>&Macro</source>
</trans-unit>
<group restype='popup-menu'>
<trans-unit id='21' resname='7137' menu-option='0'>
<source>&Play...\tAlt+F10</source>
</trans-unit>
<trans-unit id='22' resname='7138' menu-option='128'>
<source>&Edit...\tCtrl+F10</source>
</trans-unit>
</group>
</group>
<trans-unit id='23' resname='0' menu-option='144'>
<source>&Help</source>
</trans-unit>
<group restype='popup-menu'>
<trans-unit id='24' resname='7160' menu-option='0'>
<source>&Help Topics</source>
</trans-unit>
<trans-unit id='25' resname='7161' menu-option='0'>
<source>&Tip of the Day... </source>
</trans-unit>
<trans-unit id='26' resname='0' menu-option='0' translate='no'>
<source></source>
</trans-unit>
<trans-unit id='27' resname='7162' menu-option='128'>
<source>&About...</source>
</trans-unit>
</group>
</group>
</group>
1.2. Dialog Resources
- All dialogs are grouped together in a <group restype='dialog'> group.
- Each dialog is placed in a separate <group> as a child of the
<group restype='dialog'> group.
- The name of the parent control becomes the id attribute value of the
container group.
- The count of controls of the parent control becomes the numchildren
attribute value of the container group.
- The font of the parent control becomes the font attribute value of the
container group.
- The help_id of the parent control becomes the help-id attribute value of
the container group.
- The version of the parent control becomes the version attribute value of
the container group.
- The menu of the parent control becomes the menu attribute value of the
container group.
- Each control is placed in a separate <trans-unit>
- The id attribute value of the control <trans-unit> is serially
assigned, the same as is done for menu-items.
- The name of the control becomes the resname attribute value of the
control's <trans-unit>.
- The class of the control becomes the restype attribute value of the
control's <trans-unit>.
- The style of the control becomes the style attribute value of the control's
<trans-unit>.
- The coord of the control becomes the coord attribute value of the control's
<trans-unit>.
- Edit controls are given a translate attribute value of 'no'.
- SysTabControl32 is a tab control class; its translate attribute value is
'no'.
<group restype='dialog'>
<group id='resname of dialog' numchildren='count of controls' font='font of dialog'>
<trans-unit id='absolute retreival order' resname='control name' restype='class of control'
style='window style value' coord='window coord'>
<source>caption</source>
</trans-unit>
</group>
</group>
Example: Novell Red Dialog 2200
Example: Novell Red Dialog 2200 Resources
# |
Name |
Class |
Style |
Font |
Dimension |
Text |
433 |
2200 |
-1 |
#x90C800C0 |
Helv,8,0,0 |
0,0,332,230 |
Control Properties |
434 |
65535 |
button |
#x50000007 |
|
8,4,265,125 |
Settings |
435 |
65535 |
static |
#x50020000 |
|
18,57,40,10 |
&Translation: |
436 |
2202 |
edit |
#x50A10004 |
|
64,55,199,35 |
|
437 |
65535 |
button |
#x50020000 |
|
18,96,26,10 |
&X Pos.: |
438 |
2203 |
edit |
#x50810000 |
|
64,94,25,13 |
|
439 |
65535 |
button |
#x50020000 |
|
106,96,28,10 |
&Y Pos.: |
440 |
2204 |
edit |
#x50810000 |
|
147,94,25,13 |
|
441 |
65535 |
static |
#x50020000 |
|
18,113,21,10 |
&Width: |
442 |
2205 |
edit |
#x50810000 |
|
64,111,25,13 |
|
443 |
65535 |
button |
#x50020000 |
|
106,113,24,10 |
H&eight: |
444 |
2206 |
edit |
#x50810000 |
|
147,111,25,13 |
|
445 |
2214 |
button |
#x50030000 |
|
205,94,58,14 |
&Copy English |
446 |
2207 |
button |
#x50030003 |
|
13,143,59,10 |
Review si&zing |
447 |
2213 |
button |
#x50010003 |
|
13,154,67,10 |
&Do not auto-size |
448 |
2208 |
button |
#x50010003 |
|
90,143,74,10 |
Re&view translation |
449 |
2209 |
button |
#x50010003 |
|
90,154,66,10 |
Do not tr&anslate |
450 |
4701 |
button |
#x58000003 |
|
244,143,69,10 |
Vendor chan&ged |
451 |
4766 |
SysTabControl32 |
#x50030000 |
|
17,171,297,48 |
Tab1 |
452 |
4749 |
edit |
#x50010844 |
|
18,185,295,33 |
|
453 |
2210 |
edit |
#x50010044 |
|
18,185,295,33 |
|
454 |
2215 |
edit |
#x50810044 |
|
18,185,295,33 |
|
455 |
1 |
button |
#x50030001 |
|
281,8,43,14 |
OK |
456 |
2 |
button |
#x50010000 |
|
281,25,43,14 |
Cancel |
457 |
9 |
button |
#x50030000 |
|
281,47,43,14 |
&Help |
458 |
2211 |
button |
#x50030000 |
|
281,69,43,14 |
&Next |
459 |
2212 |
button |
#x50010000 |
|
281,86,43,14 |
&Previous |
460 |
65535 |
button |
#x50020000 |
|
18,18,28,10 |
Engli&sh: |
461 |
2201 |
edit |
#x50A10804 |
|
64,16,199,35 |
|
462 |
65535 |
button |
#x50000007 |
|
8,133,317,92 |
Notes |
463 |
4702 |
button |
#x50010003 |
|
167,154,73,10 |
Mnemonic conflict |
464 |
4703 |
button |
#x50010003 |
|
167,143,55,10 |
Fuzzy match |
465 |
4704 |
button |
#x50010003 |
|
244,154,26,10 |
QA |
Example: Novell Red Dialog 2200 in XLIFF
<group restype='dialog'>
<group id=2200 numchildren='32' font='Helv,8,0,0'>
<trans-unit id='433' resname='2200' restype='dialog' style='#x90C800C0' coord='0,0,332,230'>
<source>Control Properties</source>
</trans-unit>
<trans-unit id='434' resname='65535 ' restype='button ' style='#x50000007' coord='8,4,265,125'>
<source>Settings</source>
</trans-unit>
<trans-unit id='435' resname='65535' restype='static ' style='#x50020000' coord='18,57,40,10'>
<source>&Translation:</source>
</trans-unit>
<trans-unit id='436' resname='2202' restype='edit' translate='no' style='#x50A10004' coord='64,55,199,35'>
<source></source>
</trans-unit>
<trans-unit id='437' resname='65535' restype='button' style='#x50020000' coord='18,96,26,10'>
<source>&X Pos.:</source>
</trans-unit>
<trans-unit id='438' resname='2203' restype='edit' translate='no' style='#x50810000' coord='64,94,25,13'>
<source></source>
</trans-unit>
<trans-unit id='439' resname='65535' restype='button' style='#x50020000' coord='106,96,28,10'>
<source>&Y Pos.:</source>
</trans-unit>
<trans-unit id='440' resname='2204' restype='edit' translate='no' style='#x50810000' coord='147,94,25,13'>
<source></source>
</trans-unit>
<trans-unit id='441' resname='65535' restype='static' style='#x50020000' coord='18,113,21,10'>
<source>&Width:</source>
</trans-unit>
<trans-unit id='442' resname='2205' restype='edit' translate='no' style='#x50810000' coord='64,111,25,13'>
<source></source>
</trans-unit>
<trans-unit id='443' resname='65535' restype='button' style='#x50020000' coord='106,113,24,10'>
<source>H&eight:</source>
</trans-unit>
<trans-unit id='444' resname='2206' restype='edit' translate='no' style='#x50810000' coord='147,111,25,13'>
<source></source>
</trans-unit>
<trans-unit id='445' resname='2214' restype='button' style='#x50030000' coord='205,94,58,14'>
<source>&Copy English</source>
</trans-unit>
<trans-unit id='446' resname='2207' restype='button' style='#x50030003' coord='13,143,59,10'>
<source>Review si&zing</source>
</trans-unit>
<trans-unit id='447' resname='2213 ' restype='button' style='#x50010003' coord='13,154,67,10'>
<source>&Do not auto-size</source>
</trans-unit>
<trans-unit id='448' resname='2208 ' restype='button' style='#x50010003' coord='90,143,74,10'>
<source>Re&view translation</source>
</trans-unit>
<trans-unit id='449' resname='2209 ' restype='button' style='#x50010003' coord='90,154,66,10'>
<source>Do not tr&anslate</source>
</trans-unit>
<trans-unit id='450' resname='4701 ' restype='button' style='#x58000003' coord='244,143,69,10'>
<source>Vendor chan&ged</source>
</trans-unit>
<trans-unit id='451' resname='4766 ' restype='SysTabControl32' style='#x50030000' coord='17,171,297,48'>
<source>Tab1</source>
</trans-unit>
<trans-unit id='452' resname='4749 ' restype='edit' translate='no' style='#x50010844' coord='18,185,295,33'>
<source></source>
</trans-unit>
<trans-unit id='453' resname='2210 ' restype='edit' translate='no' style='#x50010044' coord='18,185,295,33'>
<source></source>
</trans-unit>
<trans-unit id='454' resname='2215 ' restype='edit' translate='no' style='#x50810044' coord='18,185,295,33'>
<source></source>
</trans-unit>
<trans-unit id='455' resname='1 ' restype='button' style='#x50030001' coord='281,8,43,14'>
<source>OK</source>
</trans-unit>
<trans-unit id='456' resname='2 ' restype='button' style='#x50010000' coord='281,25,43,14'>
<source>Cancel</source>
</trans-unit>
<trans-unit id='457' resname='9 ' restype='button' style='#x50030000' coord='281,47,43,14'>
<source>&Help</source>
</trans-unit>
<trans-unit id='458' resname='2211 ' restype='button' style='#x50030000' coord='281,69,43,14'>
<source>&Next</source>
</trans-unit>
<trans-unit id='459' resname='2212 ' restype='button' style='#x50010000' coord='281,86,43,14'>
<source>&Previous</source>
</trans-unit>
<trans-unit id='460' resname='65535 ' restype='button' style='#x50020000' coord='18,18,28,10'>
<source>Engli&sh:</source>
</trans-unit>
<trans-unit id='461' resname='2201 ' restype='edit' translate='no' style='#x50A10804' coord='64,16,199,35'>
<source></source>
</trans-unit>
<trans-unit id='462' resname='65535 ' restype='button' style='#x50000007' coord='8,133,317,92'>
<source>Notes</source>
</trans-unit>
<trans-unit id='463' resname='4702 ' restype='button' style='#x50010003' coord='167,154,73,10'>
<source>Mnemonic conflict</source>
</trans-unit>
<trans-unit id='464' resname='4703 ' restype='button' style='#x50010003' coord='167,143,55,10'>
<source>Fuzzy match</source>
</trans-unit>
<trans-unit id='465' resname='4704 ' restype='button' style='#x50010003' coord='244,154,26,10'>
<source>QA</source>
</trans-unit>
</group>
</group>
1.3. String Resources
- String table strings are grouped into a group with the restype attribute
value of 'string'.
- A trans-unit is created for each string.
- The trans-unit id attribute value is serially assigned according the
retreival order to maintain consistency and uniqueness of the trans-unit id
attribute value.
- The name id of the string becomes the resname attribute value of the
trans-unit.
- The translate attribute value of null strings is 'no'.
- The string becomes the content of the child source element.
<group restype='string'>
<group id='resname of dialog' numchildren='count of controls' font='font of dialog'>
<trans-unit id='absolute retreival order' resname='control name' restype='class of control'
style='window style value' coord='window coord'>
<source>caption</source>
</trans-unit>
</group>
</group>
Example: Novell Red string table (partial)
Example: Novell Red string table (partial) Resources
STR_ID |
Name |
ENG_STR |
744 |
0 |
|
745 |
1 |
Tab %d |
746 |
2 |
Edit |
747 |
3 |
Edit Resource Project |
748 |
4 |
Red did not exit normally during its
last use. Click OK to cleanup temporary files. |
749 |
5 |
Copyright © 1994-2000 Novell,
Inc.\nAll rights reserved.\nPortions Copyright © Microsoft, Corp. |
750 |
6 |
IDOK |
751 |
7 |
IDCANCEL |
752 |
8 |
Out of memory. |
753 |
9 |
Cannot create file %s. The file could
be in use by another application, the device may be full or file access was
denied. |
754 |
10 |
Save changes to resource file %s?
|
755 |
11 |
Save changes to project file %s?
|
756 |
12 |
%s is an invalid project file or a
version that is unsupported. |
757 |
13 |
Cannot open project file %s. |
758 |
14 |
A symbol must start with an
alphabetic character or '_', and the ID must be an integer. |
759 |
15 |
You must make a selection before this
operation. |
760 |
16 |
%s is not a valid custom control DLL.
|
761 |
17 |
Defines |
762 |
18 |
Include |
763 |
19 |
redproj.ini |
764 |
20 |
%s value must be greater than zero.
|
765 |
21 |
Could not create control of class %s
with the specified styles. |
766 |
22 |
Cannot open resource file %s. |
767 |
23 |
Discard changes? |
768 |
24 |
%s value must be a positive number.
|
769 |
25 |
Memory error! Save files and exit as
soon as possible. |
770 |
26 |
%s cannot be loaded. |
771 |
27 |
Discard changes to this dialog? |
772 |
28 |
A non-zero point size must be entered
when specifying a font. |
773 |
29 |
The maximum spacing must be greater
than or equal to the minimum spacing. |
Example: Novell Red Stringtable (partial) in XLIFF
<group restype='dialog'>
<trans-unit id='744' resname='0' translate='no'>
<source></source>
</trans-unit>
<trans-unit id='745' resname='1'>
<source>Tab %d</source>
</trans-unit>
<trans-unit id='746' resname='2'>
<source>Edit</source>
</trans-unit>
<trans-unit id='747' resname='3'>
<source>Edit Resource Project</source>
</trans-unit>
<trans-unit id='748' resname='4'>
<source>Red did not exit normally during its last use. Click OK to cleanup temporary files. </source>
</trans-unit>
<trans-unit id='749' resname='5'>
<source>Copyright © 1994-2000 Novell, Inc.\nAll rights reserved.\nPortions Copyright © Microsoft, Corp. </source>
</trans-unit>
<trans-unit id='750' resname='6'>
<source>IDOK</source>
</trans-unit>
<trans-unit id='751' resname='7'>
<source>IDCANCEL</source>
</trans-unit>
<trans-unit id='752' resname='8'>
<source>Out of memory. </source>
</trans-unit>
<trans-unit id='753' resname='9'>
<source>Cannot create file %s. The file could be in use by another application, the device may be full or file access was denied. </source>
</trans-unit>
<trans-unit id='754' resname='10'>
<source>Save changes to resource file %s? </source>
</trans-unit>
<trans-unit id='755' resname='11'>
<source>Save changes to project file %s? </source>
</trans-unit>
<trans-unit id='756' resname='12'>
<source>%s is an invalid project file or a version that is unsupported. </source>
</trans-unit>
<trans-unit id='757' resname='13'>
<source>Cannot open project file %s. </source>
</trans-unit>
<trans-unit id='758' resname='14'>
<source>A symbol must start with an alphabetic character or '_', and the ID must be an integer. </source>
</trans-unit>
<trans-unit id='759' resname='15'>
<source>You must make a selection before this operation.</source>
</trans-unit>
<trans-unit id='760' resname='16'>
<source>%s is not a valid custom control DLL. </source>
</trans-unit>
<trans-unit id='761' resname='17'>
<source>Defines</source>
</trans-unit>
<trans-unit id='762' resname='18'>
<source>Include</source>
</trans-unit>
<trans-unit id='763' resname='19'>
<source>redproj.ini</source>
</trans-unit>
<trans-unit id='764' resname='20'>
<source>%s value must be greater than zero. </source>
</trans-unit>
<trans-unit id='765' resname='21'>
<source>Could not create control of class %s with the specified styles. </source>
</trans-unit>
<trans-unit id='766' resname='22'>
<source>Cannot open resource file %s. </source>
</trans-unit>
<trans-unit id='767' resname='23'>
<source>Discard changes? </source>
</trans-unit>
<trans-unit id='768' resname='24'>
<source>%s value must be a positive number. </source>
</trans-unit>
<trans-unit id='769' resname='25'>
<source>Memory error! Save files and exit as soon as possible. </source>
</trans-unit>
<trans-unit id='770' resname='26'>
<source>%s cannot be loaded. </source>
</trans-unit>
<trans-unit id='771' resname='27'>
<source>Discard changes to this dialog? </source>
</trans-unit>
<trans-unit id='772' resname='28'>
<source>A non-zero point size must be entered when specifying a font. </source>
</trans-unit>
<trans-unit id='773' resname='29'>
<source>The maximum spacing must be greater than or equal to the minimum spacing. </source>
</trans-unit>
<trans-unit id='774' resname='30'>
<source>Custom control class %s is already loaded. </source>
</trans-unit>
</group>
1.4. Accelerator Resources
{undone}
1.5. Message Resources
{see String Resources}