Difference between revisions of "Pootle User Guide/Translation AOO User Interface"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (spelling)
(Accelerator keys (mnemonics))
Line 15: Line 15:
  
 
==Accelerator keys (mnemonics)==
 
==Accelerator keys (mnemonics)==
'''ToDo'''
+
Some strings contain a "~", like "All ~Pages"; these are meant for keyboard
 +
accelerators or mnemonics (i.e., the letters that appear underlined in menus
 +
and that can be used, for example, to invoke File - Open with ALT+F, then O).
  
<''see mail from Andrea; explain difference with shortcuts like CTRL-O''>
+
You can ignore the "~" in newly translated strings: OpenOffice
 +
will automatically assign an accelerator to commands, except for
 +
a dozen strings that are used in the main menu and that can be found
 +
at
 +
(if in doubt, ask on the l10n mailing list).
 +
 
 +
You can leave existing mnemonics in place: it won't harm.
 +
 
 +
Note that the automatic assignment will only work for the standard Latin
 +
character set (a-z); if your language uses an extended scripts, you will
 +
still need to assign mnemonics manually.
  
 
==How to find a string in my OpenOffice-Installation==
 
==How to find a string in my OpenOffice-Installation==

Revision as of 14:30, 12 October 2013

[[{{{PrevPage}}}|< Previous Page

]]

[[{{{NextPage}}}|Next Page
>]]




Accelerator keys (mnemonics)

Some strings contain a "~", like "All ~Pages"; these are meant for keyboard accelerators or mnemonics (i.e., the letters that appear underlined in menus and that can be used, for example, to invoke File - Open with ALT+F, then O).

You can ignore the "~" in newly translated strings: OpenOffice will automatically assign an accelerator to commands, except for a dozen strings that are used in the main menu and that can be found at (if in doubt, ask on the l10n mailing list).

You can leave existing mnemonics in place: it won't harm.

Note that the automatic assignment will only work for the standard Latin character set (a-z); if your language uses an extended scripts, you will still need to assign mnemonics manually.

How to find a string in my OpenOffice-Installation

ToDo

<Problem description by example>

<get the application module, link to the section "What File Name and Location Can Tell You" on this page>

<Search identifier in source to get other texts from the same dialog or menu.>

<Verify a candidate by the identifier>

How to find an UI string in Pootle

ToDo

<Problem description by example> <Using the information from the extended tip>

Using a KeyID

Get a keyID-Build as described in section Getting a KeyID-Build.

Use a keyID-Build to find a string from the UI in Pootle this way:

  1. Lunch the keyID-build and look up the keyID of the string.
  2. Get the file localize.sdf in folder /trunk/extras/l10n/source/kid/. Download the file and open it in an editor, or open it directly in your browser. The file large, so it takes a while till your browser shows it. To get the file you can use OpenGrok or ViewVC as well, see section Search in the Source_Code.
  3. Use the search feature of your editor or browser respectively to find the row, which contains the keyID.
  4. The fifth column from left contains the identifier of the string, as it is used in source code. Copy it.
  5. Enter this identifier in the search field in Pootle and check location in the search check boxes. Start search.

What File Name and Location Can Tell You

You will see in the following examples, that the filename and location can tell you a lot. Imagine you need to work on the string "line spacing". A search will give you numerous results. Here are some of them, try to find the part in the UI ;)

1

Example unit=12961852

File:cui/source/tabpages.po

The file name tells you from which source directory the strings are collected. Sadly the total overview of the directories at Source_code_directories is not updated to AOO4. <A new version for AOO4 is needed.>

cui derives from common user interface and contains parts that are used by several modules.

tabpages are pages in a dialog.

Location: paragrph.src#RID_SVXPAGE_STD_PARAGRAPH.FL_LINEDIST.fixedline.text

  • paragrph.src The file, which contains the string. Most strings from the UI are defined in .src files. Looking into the source you will see, that this file contains the structure of the dialog. The name "paragrph" sounds like "paragraph", a strong indicator, that this "line spacing" belongs to text formatting. *RID_SVXPAGE_STD_PARAGRAPH The string belongs to a dialog page about paragraphs. The letters RID are an acronym for resource identifier.
  • FL_LINEDIST FL might derive from fixed line and LINEDIST from line distance.
  • fixedline Now your are sure, it is a fixed line. The string is used to group the dialog page.

Find Show|Hide and More|Less links directly above and below the active translation record. In this light green area, you see strings, which are near to the current one in the source code. They likely belong to the same dialog page.

2

Example unit=12977489

File: starmath/source.po

The string belongs to the formula editor MATH.

Location: smres.src#RID_DISTANCEDIALOG.7.2.string.text

  • smres.src: "smres" perhaps stands for "star math resource".
  • RID_DISTANCEDIALOG The string belongs to a 'distance dialog'.
  • .7.2 It is a multi-part dialog. On the first part choose the 7th string and in the next part the 2nd string.
  • string "string" is rather generic, here it is an item in a drop-down list.

3

Example unit=12980475

File: svx/source/sidebar/paragraph.po

The string belongs to something with paragraphs and is part of the sidebar.

Location:ParaPropertyPanel.src#RID_SIDEBAR_PARA_PANEL.TBX_LINESP.BT_BTX_LINESP.toolboxitem.text

  • ParaPropertyPanel.src The string is in the paragraph panel of the Properties deck.
  • RID_SIDEBAR_PARA_PANEL A resource identifier for the paragraph panel of the sidebar.
  • TBX_LINESP It belongs to the toolbox line spacing. The property panel has several toolboxes, in most cases drawn in a little bit lighter color with a hairline border. Such toolbox has an internal titel text, but that text is not localized and does not show up on Pootle.
  • BT_BTX_LINESP There exist no general rule how to design identifiers. The position in the string shows you, that it is a toolbox item. A toolbox item can be a simple button, but may contain more controls including metric fields.
  • toolboxitem The string is a kind of title for the toolboxitem, but it is only visible as simple tooltip. You need to hover with the mouse over the icon to see the string.

4

Example unit 12981827

File: sw/source/ui/app.po

In this case you not really lucky. "app" indicates, that it is a collection of strings which belong to more or less independent items. At least you know from the part sw, that it belongs to Writer.

Loation: mn.src#MN_TEXT_ATTR.MN_FORMAT_LINESPACE.menuitem.text

  • mn.src "mn" derives from menu.
  • MN_TEXT_ATTR It is a menu for text attributes
  • MN_FORMAT_LINESPACE A submenu for line spacing
  • menuitem It is a text, that is shown in a menu. If you looked into the source file, you would guess that it is the context menu of text in Writer.

5

Example unit 12969066

File:officecfg/registry/data/org/openoffice/Office/UI.po

This belongs to the Configuration data. They will be stored in the installation directory in share/registry. The user configurations extend these settings.

Location:GenericCommands.xcu#..GenericCommands.UserInterface.Commands..uno_SpacePara1.Label.value.text

  • GenericCommands.xcu This file contains those commands, which are available in more than one module. For example "save the document" is available in all modules. The file format is XML.
  • .GenericCommands.UserInterface.Commands. The elements in the xml format are nested nodes. Compare it with the source extract shown below.
  • uno_SpacePara1 This is the inner node. It is the name of the command. The underscore stands in place of a colon.
  • Label and value correspond directly to the notation of the xml file.
<oor:component-data oor:name="GenericCommands" ...>
    <node oor:name="UserInterface">
        <node oor:name="Commands">
            <node oor:name=".uno:AVMediaPlayer" oor:op="replace">
                <prop oor:name="Label" oor:type="xs:string">
                    <value xml:lang="en-US">Media Pla~yer</value>
                </prop>
                <prop oor:name="Properties" oor:type="xs:int">
                    <value>9</value>
                </prop>
            </node>
          ...
            <node oor:name=".uno:SpacePara1" oor:op="replace">
                <prop oor:name="Label" oor:type="xs:string">
                    <value xml:lang="en-US">Line Spacing: 1</value>
                </prop>
                ...
            </node>

The part xml:lang="en-US" causes, that the string Line Spacing: 1 is localized and shows up in Pootle.

The command name is used to reference the command. Such .uno commands are used in several places in the application.

  • As Button in a toolbar. The string is shown as simple tooltip and as default text. It is always the same string used, regardless of the toolbar.
  • As menu item. The string is used as menu item text. Consider this when translating the term, so that it does not become to wide.
  • When you record a macro, the dispatcher uses the command name. Programmer uses it when writing extensions using the API.
  • As reference for the extended tips in the built-in help.
  • When you customize a toolbar, you see the command name in the lower part of the description.
Personal tools