// Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \previouspage external-tool-spec.html \page qtcreator-ui-text.html \nextpage coding-style.html \title User Interface Text Guidelines Follow the guidelines in this section to make sure that your extensions are consistent with the \QC UI and that they can be easily localized into different languages. When you write UI text, make sure that it is: \list \li Consistent with existing \QC UI terms \li Short and concise \li Neutral, descriptive, and factually correct \li Unambigious \li Translatable into different languages \endlist \section1 Grammar and Style All UI text must be grammatically correct English and use the standard form of written language. Do not use dialect or slang words. Use idiomatic language, that is, expressions that are characteristic for English. If possible, ask a native English speaker for a review. UI text should be concise and economically formulated. Avoid unnecessary content words and phrases. However, it is more important that the text is useful and easy to understand. Avoid addressing the user in the second person. Use a neutral tone or passive voice but use a formal address when necessary. Avoid using the word \e Please when addressing the user. Exceptions to this are some copyright text and short imperative sentences that might otherwise sound abrupt. For example, \e {Please wait.} Avoid abbreviations in the menu names and items. If there is no room for the full spelling or hyphenation of a word, abbreviate the text according to the English abbreviation rules. Avoid contractions. For example, write \e cannot instead of \e can't. \section1 Punctuation Avoid using punctuation marks or special characters in menu names and items. Use punctuation marks as follows: \list \li Use full stops in messages. \li Never use full stops (.) at the end of menu item names. \li Place three full stops (...) at the end of menu item names that open a dialog requiring user action. \li Use exclamation marks (!) only in text that demands extra attention from the user or carries special weight. \li Use quotation marks ("") around variable values. For example, \uicontrol {Close Project "qtcreator"}. For consistency, use double quotes to emphasize or set apart file names, directory names, URLs, and so on, in user visible strings. \li Do not use leading, trailing, or multiple spaces to align text in messages, as translation tools might not handle them correctly. \endlist \section2 Writing Tooltips Tooltips contain useful information about icons, menu items, or other UI elements. They appear when users place the mouse pointer over an UI element. You can also add descriptive text to the UI that is always visible. Consider adding tooltips for all UI elements that are not obvious from the context. The tooltips should help users understand what the UI controls do, so try to make them as clear as possible, even if they get a bit long. \section3 Tooltips for Icons For an icon, you can use the command name as a tool tip. In that case, use book style capitalization and do not add a period after the tool tip. \image qtcreator-tooltip.png {Tooltip} \section3 Other Tooltips Tooltips can also contain full sentences. \image qtcreator-tooltip-long.png {Sentence as a tooltip} Follow these guidelines: \list \li Write useful tooltips, but keep them as short and concise as possible. \li To help people who localize and people for whom English is a second language, make tooltips as grammatically clear as possible. Use the articles a, an, and the, prepositions, such as of, and demonstrative pronouns, such as this and that, wherever possible. \li Use sentence style capitalization and punctuation as you would for any sentence. \li For input fields, describe the value of the field. Tell users what they can enter in the field, such as a name or a path, unless it is obvious from the context. Use a noun phrase, such as \e {The name of the user account.} Describe limitations and special requirements. \li For actions, such as most checkboxes, radio buttons, push buttons, and menu items, describe what happens when users select them. Use a verb phrase, such as \e {Removes trailing whitespace upon saving.} \li For combo boxes, describe when to pick each option. \li Describe what the UI control does, not how to use it. If the control does not work as users would expect it to, check your design, as you most likely chose the wrong type of control. \li Do not describe the default value or the minimum and maximum values, as users can see them in the field. \endlist \section3 Examples \table \header \li Control \li Do \li Don't \row \li Button - \uicontrol {Download Definitions} \li Download missing and update existing syntax definition files. \li You can select this button to download syntax definition files. \row \li Check box - \uicontrol {Clean whitespace} \li Removes trailing whitespace upon saving. \li Select this checkbox to remove trailing whitespace upon saving. \row \li Combo box - \uicontrol Size \li The font size used in the terminal (in points). \li Use the up and down arrows to set the font size between 1 and 100. \row \li Field - \uicontrol {Shell arguments} \li The arguments to be passed to the shell. \li Sets the arguments to be passed to the shell. \endtable \section3 Writing Tooltips in Design Mode In \QD, use plain text for tooltips. For extra formatting, write short, canonical HTML in the source tab of the rich text editor: \c {
Note: text.} \QD has a feature that simplifies the rich text (on by default), but still, you should verify by looking at the \uicontrol Source tab. \section2 Writing Messages Check that messages are concise and economically formulated. However, it is more important that the messages are useful and easy to understand. Keep the use of many new and different sentence structures to a minimum. Reuse sentence structures that have been used in similar situations. For example: \list \li Cannot send log as selected message type. Text is too long. \li Cannot receive image. \li Cannot insert picture. Maximum text length is 120 characters. \li Image name already in use. \li Folder name already in use. \endlist \section1 UI Text Capitalization Two styles are used, book title and sentence style: \list \li Example of Book Title Capitalization \li Example of sentence style capitalization \endlist \section2 Using Book Style Capitalization When using book style capitalization, capitalize all words, except prepositions that are shorter than five letters (for example, 'with' but 'Without'), conjunctions (for example, and, or, but), and articles (a, an, the). However, always capitalize the first and last word. Use book style capitalization for: \list \li Titles (window, dialog, group box, tab, list view columns, and so on) \li Functions (menu items, buttons) \li Selectable items (combobox items, listbox items, tree list items, and so on) \endlist \section3 Checking Book Style Capitalization If necessary, use an online \l{Title Case Converter} to check book style capitalization of UI text or headings in documentation. Or, use the to-title-case.js script in the \c{\doc\titlecase} folder: \list 1 \li Open to-title-case.html in a browser. \li Enter the UI text in the field. \li Select \uicontrol Convert. \endlist The UI text with suggested book style capitalization is displayed in the field to the right. \note The script is based on word lists; it does not perform grammatical analysis. Therefore, it might get the capitalization wrong if you use a rare meaning of a word. For example, should you mean feathers and not direction when you write \e down. However, you should be able to trust it in most cases in the context of writing UI text and technical documentation. \section2 Using Sentence Style Capitalization When using sentence style capitalization, capitalize only the first letter, except proper names. Use sentence style capitalization for: \list \li Labels \li Tool tips \li Descriptive text \li Other non-heading or title text \endlist \section1 Preparing for Localization \QC is localized into several languages. Consistency and conciseness make UI text easier to translate. \section2 Marking UI Text for Translation \section3 Translation Context Avoid creating many different translation contexts. By default, \c tr() uses the context of the class, which means that translations break when code is refactored and UI text is moved to a different class. Create a single translation context for each plugin instead. Create a header \c myplugintr.h \code #pragma once #include