⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linguist-translator.leaf

📁 Linux下的基于X11的图形开发环境。
💻 LEAF
📖 第 1 页 / 共 2 页
字号:
\chapter Translators\img linguist.png\caption Linguist Main Window\section1 The One Minute Guide to Using Qt Linguist\index Linguist\index Qt Linguist\index Contexts!for Translation\e {Qt Linguist} is a tool for adding translations to Qtapplications. It introduces the concept of a translation "context"which means a group of phrases that appear together on the screene.g. in the same menu or dialog.To start, run \e {Qt Linguist}, either from the taskbar menu, or bydouble clicking the desktop icon, or type \c {linguist} (followed by\Key Enter) at the command line. Once \e {Qt Linguist} has startedchoose \Menu File|Open from the menu bar and select a \c .tstranslation source file to work on.\e {Qt Linguist}'s main window is divided into four main areas. Theleft hand side contains the Context list, the top right is the Sourcetext area, the middle right is the translation area and the bottomright is the phrases and guesses area. We'll describe them in detaillater.Click on one of the contexts in the context list (left hand side) andthen click on one of the phrases that appears in the Source text area(top right). The phrase will be copied into the translation area(middle right). Click under the word 'Translation' and type in thetranslation. Click \Key Ctrl+Enter (Done \& Next) to confirm that youhave completed the translation and to move on to the next phrase thatrequires translation.The cycle of entering a translation then pressing \Key Ctrl+Enter canbe repeated until all the translations are done or until you finishthe session. Linguist will attempt to fill the "phrases and guesses"area with possible translations from any open phrase books and anyprevious translations. Each has a keyboard shortcut, e.g.\Key Ctrl+1, \Key Ctrl+2, etc., which you can use to copy theguess into the Translation area. (Mouse users can double click aphrase or guess to move it into the Translation area.) At the end ofthe session choose \Menu File|Save from the menu bar and then\Menu File|Exit to quit.\section1 Qt Linguist's Main Window\section2 Context List\index Contexts!for TranslationThis appears at the left hand side of the main window by default. Thefirst column, 'Done', identifies whether or not the translations for thecontext have been done. A tick indicates that all the translations havebeen done and are valid. A question mark indicates that one or moretranslations have not been done or have failed validation. The secondcolumn, 'Context' is the name of the context in which the translationphrases appear. The third column, 'Items' shows two numbers, the firstis the number of translations that have been done, and the second is thenumber of phrases that are in the context; if the numbers are equal thenall the translations have been done. Note that a greyed out tickindicates an obsolete translation, i.e. a phrase that was translated ina previous version of the application but which does not occur in thenew version.The contexts are ordered alphabetically. The phrases within each contextare in the order in which they appear in the source program and this maynot be the order in which they are shown on screen.The Context List is a dockable window so it can be dragged to anotherposition in the main window, or dragged out of the main window to be awindow in its own right. If you move the Context List, \e {QtLinguist} will remember its position and restore it whenever youstart the program.\section2 Source Text AreaThis appears at the top right of the main window by default. The firstcolumn, 'Done', signifies the status of the translation. A tickindicates that the phrase has been translated and passed validation. Aquestion mark indicates that the translation has not been done. Anexclamation mark indicates that the translation has failed validation.The second column 'Source text' shows the text that must be translated.The third column shows the translation.\e{Qt Linguist} provides three kinds of validation: accelerator,punctuation and phrase. If the source text contains an acceleratori.e. an ampersand, '\&' and the translated text does not contain anampersand the translation will fail the accelerator validation.Similarly, if the source text ends with a particular punctuationmark, e.g. '?', '!' or '.' and the translation ends with a differentpunctuation mark the translation will fail the punctuationvalidation. If the source text has a translation in one of the openphrase books that differs from the translation used the translationwill fail phrase validation. (See \l Validation.)The Source Text Area is a dockable window.\section2 Translation AreaThis area appears at the middle right of the main window by default. Itis comprised of three vertical sections. The first section is labelled'Source text' below which the source text appears. The second sectioncontains contextual information on a light blue background that theprogrammer has added to assist the translator. If no contextualinformation has been given this section does not appear. The thirdsection is labelled 'Translation' and this is where you enter thetranslation of the source text.\section2 Phrases and Guesses Area\index Phrases!in Qt Linguist\index Guesses!in Qt LinguistThis area appears at the bottom right of the main window by default.When you move to a new phrase if the phrase is in one of the phrasebooks that has been loaded the phrase will appear in this area with itstranslation. If the phrase is the same or similar to another phrase thathas already been translated the phrase and translation will be shown inthis area. To copy a translation from the phrases and guesses area press\Key F6 to move to the phrases and guesses area, use the up and down arrowkeys to move to the phrase you want to use and press Enter to copy it.If you decide that you don't want to copy a phrase after all, press Esc.In both cases the focus will return to the Translation area.Alternatively, double click the translation you want to use and it willbe copied into the translation area.The Phrases and Guesses Area is a dockable window.\section1 Common Tasks\section2 Leaving a Translation for LaterIf you wish to leave a translation press \Key Ctrl+L (Next Unfinished) tomove to the next unfinished translation. An unfinished translation isone that either has not been translated at all or one which failsvalidation. To move to the next phrase press \Key Shift+Ctrl+L. You can alsonavigate using the Translation menu. If you want to go to a differentcontext entirely, click the context you want to work on in the Contextlist, then click the source text in the Source Text area.\section2 Phrases That Require Multiple Translations Depending on Context\index Contexts!for Translation\index Comments!for TranslatorsThe same phrase may occur in two or more contexts without conflict. Oncea phrase has been translated in one context, \e {Qt Linguist} notesthat the translation has been made and when the translator reaches alater occurrence of the same phrase \e {Qt Linguist} will providethe previous translation as a possible translation candidate in thephrases and guesses area. If theprevious translation is acceptable just click the \e {Done \& Next}button (press \Key Alt+Enter) to move on to the next unfinished phrase.If a phrase occurs more than once in a particular context it will onlybe shown once in \e {Qt Linguist}'s context list andthe translation will be applied to every occurrence within the context.If the same phrase needs to be translated differently within the samecontext the programmer must provide a distinguishing comment for each ofthe phrases concerned. If such comments are used the duplicate phraseswill appear in the context list. The programmers comments will appear inthe translation area on a light blue background.\section2 Changing Keyboard Accelerators\index Accelerators\index Keyboard AcceleratorsA keyboard accelerator is a key combination that when pressed willcause an application to perform an action. Keyboard acceleratorsnormally come in two forms: Alt key and Ctrl key accelerators.\index Alt KeyAlt key accelerators are used for menus and buttons.  The underliningsignifies that pressing the Alt key with the underlined letter is thesame as clicking the menu item with the mouse.  For example, mostapplications have a \e File menu with the "F" in the word "file"underlined. In these applications the file menu can be invoked either byclicking the word "File" on the menu bar or by pressing Alt+F. Theaccelerator key which is underlined is signified by preceeding it withan ampersand, e.g. \e \&File. If a source phrase appears with anampersand in it then the translation should also contain an ampersand,preferably in front of the same letter. The meaning of Alt keyaccelerators can be determined from the phrase in which the ampersand isembedded. The translator may need to change the letter used with the Altkey, e.g. if the translated phrase does not contain the originalaccelerator letter. Conflicts with other keys, i.e. having two Alt keyaccelerators using the same letter in the same context, must be avoided.Note that some Alt key accelerators, usually those on the menu bar, mayapply in other contexts.\index Ctrl KeyCtrl key accelerators can exist independently of any visual control.They are often used to invoke actions in menus that would otherwisetake several keystrokes or mouse clicks. They may also be used toperform actions that do not appear in any menu or on any button. Forexample, most applications that have a \e File menu have a submenuitem called \e New. In many applications this will appear as "\NEWCtrl+N". This menu option could be invoked by clicking \e File thenclicking \e New with the mouse. Or you could press Alt+F then press Nsince these letters are underlined. But the same thing can beachieved simply by pressing \Key Ctrl+Enter. Accelerators that usethe Ctrl key are shown literally in the source text, e.g. \KeyCtrl+Enter. Ctrl key accelerators have no phrase so the translator\index Comments!for Translatorsmust rely on the programmer to add a "comment" which appears in thetop right hand pane. This comment should explain what action the Ctrlkey accelerator performs. Ideally Ctrl key accelerators aretranslated simply by copying them by clicking the \e {Begin fromSource} button. However in some cases the letter will not make sensein the target language and must be changed. Whatever letter (ordigit) is chosen, the translation should always be in the form"Ctrl+" followed by the letter or digit in upper case. As with Altkey accelerators, if the translator changes the key it must notconflict with any other Ctrl key accelerator.Later versions of \e {Qt Linguist} are expected to help thetranslator avoid accelerator conflicts.\section2 Dealing with Phrases that Contain VariablesSome phrases contain variables. Variables are placeholders for items oftext that are filled in at runtime. They are signified in the sourcetext with a percent sign followed by a digit, e.g. \e {After processingfile %1, file %2 is next in line}. In this example, \c %1 will bereplaced at runtime with the name of the first file to be processed and\c %2 with the name of the next file to be processed. In the translatedversion the variables must still appear. For example a Germantranslation might reverse the phrases, e.g. \e {Datei %2 wirdbearbeitet, wenn. Datei %1 fertig ist}. Note that both variablesare still used but their order has changed. The order in which variablesappear does not matter; \c %1 will always be replaced by the same textat runtime no matter where it appears in the source text or translationand similarly \c %2, etc.\section2 Reusing TranslationsIf the translated text is similar to the source text, click the\e {Begin from Source} button (press \Key Alt+T) which will copy thesource text into the translation area.\e {Qt Linguist} automatically lists phrases from the open phrasebooks and similar or identical phrases that have already been translatedin the Phrases and guesses area.\section1 Creating and Using Phrase Books\index Phrases!in Qt Linguist\index Phrase Books\img phrasebookdialog.png\caption Phrase Book DialogA \e {Qt Linguist} phrase book is a set of source phrases, target(translated) phrases, and optional definitions. Phrase Books are createdindependently of any application, although typically one phrase bookwill be created per application or family of applications.If the translator reaches an untranslated phrase that is the same as asource phrase in the phrase book, \e {Qt Linguist} will show thephrase book entry in the \e {Relevant phrases} panel at the bottomright of the main window. Phrases which have translations that conflictwith those given in the phrase book are marked with a question mark inthe source text pane. Phrase Books are used to provide a common set oftranslations to help ensure consistency. They can also be used to avoidduplication of effort since the translations for a family ofapplications can be produced once in the phrase book and the phrase bookused for the majority of translations in each application.Before a phrase book can be edited it must be created or if it alreadyexists, opened. Create a new phrase book by selecting\Menu {Phrase|New Phrase Book} from the menu bar. You must enter afilename and may change the location of the file if you wish. A newlycreated phrase book is automatically opened. Open an existing phrasebook by choosing \Menu {Phrase|Open Phrase Book} from the menu bar.To add a new phrase click the \Button {New Phrase} button (or pressAlt+N) and type in a new source phrase. Press Tab and type in thetranslation. Optionally press Tab and enter a definition -- this isuseful to distinguish different translations of the same source phrase.This process may be repeated as often as necessary.You can delete a phrase by selecting it in the phrases list and clickingRemove Phrase.Click the \e Save button (press Alt+S) and then click the \e Closebutton (press Esc) once you've finished adding (and removing) phrases.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -