Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions apiconcepts/terminology/adding_terms.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
Adding Terms
=====
You can configure your custom terminology provider to support adding and editing of terminology entries. Learn how to implement some simplified functionality for adding source and target terms to your delimited text list.
# Adding Terms
Configure your custom terminology provider to support adding and editing terminology entries. This article explains simplified functionality for adding source and target terms to a delimited text list.

In Var:ProductName, you can add source and target terms on the fly by marking them in the Editor and by then clicking either the **Add New Term** button, or the **Quick Add New Term** button.
In **Var:ProductName**, you can add source and target terms on the fly by marking them in the Editor and then clicking either **Add New Term** or **Quick Add New Term**.

<img style="display:block; " src="images/add_terms_buttons.jpg" />

The difference between these two buttons in the standard, MultiTerm-based implementation of Var:ProductName is that **Add New Term** does not immediately save the term pair to the termbase, but opens up an editor control in the **Termbase Viewer** window that allows you to make changes to the terms before saving them. **Quick Add New Term** adds the term pair directly to the terminology source and displays the newly-created entry in the **Termbase Viewer** window. Our simplified implementation will not offer any editing function. This means that the same thing will happen in our implementation, regardless of whether you click Add New Term or Quick Add New Term.
In the standard, MultiTerm-based implementation of **Var:ProductName**:

Open the **MyTerminologyProviderViewerWinFormsUI.cs** class and go to the **AddTerm()** function. Var:ProductName passes the currently selected source and target term to this function through the **source** and **target** string parameters. We then implement the following functionality, which works like this:
* **Add New Term** opens an editor control in the **Termbase Viewer** window so you can modify terms before saving.
* **Quick Add New Term** adds the term pair directly to the terminology source and displays the newly created entry in the **Termbase Viewer** window.

* Open the glossary text file.
* Loop to the end of the text file, while counting the lines to determine the next entry id.
* Insert the new source and target term (with empty definition).
* Display the newly-created entry in the Internet Explorer control of the **Termbase Viewer** window.
In this simplified implementation, no editing function is provided, so both buttons perform the same action.

To implement this behavior:

1. Open the **MyTerminologyProviderViewerWinFormsUI.cs** class and go to the **AddTerm()** function.
2. **Var:ProductName** passes the selected source and target terms through the **source** and **target** string parameters.
3. Implement the following steps:
* Open the glossary text file.
* Loop to the end of the text file while counting lines to determine the next entry ID.
* Insert the new source and target terms (with an empty definition).
* Display the newly created entry in the Internet Explorer control of the **Termbase Viewer** window.

# [Adding Terms Functionality](#tab/tabid-1)
[!code-csharp[MyTerminologyProvider](code_samples/MyTerminologyProviderViewerWinFormsUI.cs#L66-L102)]
***

When a new source/target term pair has been added, the following will, for example, be displayed in the **Termbase Viewer** window:
When a new source/target term pair is added, the following appears in the **Termbase Viewer** window:

<img style="display:block; " src="images/entry_added.jpg" />

You can also implement your terminology provider to support editing. However, in this simplified example, we will not actually add any editing functionality. This would require us to implement an editing control in the **Termbase Viewer** window. All we are doing for the moment is to output a message in the **AddAndEditTerm()** function of the **MyTerminologyProviderViewerWinFormsUI.cs** class:
You can also implement your terminology provider to support editing. However, this simplified example does not add editing functionality. Supporting editing would require an editing control in the **Termbase Viewer** window. For now, the **AddAndEditTerm()** function in the **MyTerminologyProviderViewerWinFormsUI.cs** class outputs a message:


# [Adding and Editing Terms](#tab/tabid-2)
[!code-csharp[MyTerminologyProviderViewerWinFormsUI](code_samples/MyTerminologyProviderViewerWinFormsUI.cs#L59-L64)]
***

When you try to add a term that has already been added, Var:ProductName throws the following message that prompts you to:
If you try to add a term that already exists, **Var:ProductName** displays a message that prompts you to:

* Edit the entry by clicking **Yes**.
* Add the term again, thus risking creating a duplicate entry by clicking **No**.
* Abort the entire term add operation with **Cancel**.
* Add the term again, risking a duplicate entry, by clicking **No**.
* Cancel the entire add operation by clicking **Cancel**.

<img style="display:block; " src="images/term_exists.jpg" />

If you click **Yes** to edit the entry, the following message box will be displayed in our implementation and the **Termbase Viewer** window remains empty. In a 'real' implementation, the entry content will be shown in an edit control where you can still edit it.
If you click **Yes** to edit the entry, the following message box is displayed in this implementation and the **Termbase Viewer** window remains empty. In a real implementation, the entry content is shown in an edit control where you can still modify it.

<img style="display:block; " src="images/editing_not_implemented.jpg" />
23 changes: 13 additions & 10 deletions apiconcepts/terminology/displaying_entry_content.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
Displaying Entry Content
====
The full content of an entry can be displayed in the **Termbase Viewer** window. Learn how to show the content of a line of your glossary file in Var:ProductName.
# Displaying Entry Content

When you right-click a term in the **Term Recognition** or in the **Termbase Search** window, you can use the command **View term details** to show the full entry content in the **Termbase Viewer** window.
Display the full content of an entry in the **Termbase Viewer** window. This guide explains how to show the content of a glossary file line in **Var:ProductName**.

We need to add an Internet Explorer control in which we can display the entry content in HTML format. To do this, add a user control to your project and call it **TermProviderControl.cs**, for example. Add an Internet Explorer control to it:
Right-click a term in the **Term Recognition** or **Termbase Search** window and select **View term details** to display the full entry content in the **Termbase Viewer** window.

1. Add an Internet Explorer control to display entry content in HTML format:
- Create a user control in your project named **TermProviderControl.cs**.
- Add an Internet Explorer control to the user control.

<img style="display:block; " src="images/Control.jpg">


Go to the **MyTerminologyProviderViewerWinFormsUI.cs** class and declare the following term controller object:
2. Open the **MyTerminologyProviderViewerWinFormsUI.cs** class.
3. Declare the following term controller object:
# [The Term Controller Object](#tab/tabid-1)
[!code-csharp[MyTerminologyProvider](code_samples/MyTerminologyProvider.cs#L18-L19)]
***

Modify the following **TermProviderControl** property (which is implemented by the **ITerminologyProviderViewerWinFormsUI** interface) as shown below to create and return the control element:
4. Modify the **TermProviderControl** property (implemented by the **ITerminologyProviderViewerWinFormsUI** interface) as shown below to create and return the control element:

# [Returning the Controller Element](#tab/tabid-2)
[!code-csharp[MyTerminologyProvider](code_samples/MyTerminologyProvider.cs#L21-L30)]
***

When the you right-click a term and call up the command **View term details**, the corresponding entry content should be shown in the newly-created control.
5. When you right-click a term and select **View term details**, the corresponding entry content should appear in the newly created control.

You need to modify the **JumpToTerm()** method as shown below. Var:ProductName passes the ID of the selected entry, which you can use to:
6. Modify the **JumpToTerm()** method as shown below. **Var:ProductName** passes the ID of the selected entry, which you can use to:

* Retrieve the corresponding line from the glossary text file.
* Parse the line and generate the HTML output for the Internet Explorer controller object.
* Parse the line and generate HTML output for the Internet Explorer control.

# [Jumping to a Term](#tab/tabid-3)
[!code-csharp[MyTerminologyProvider](code_samples/MyTerminologyProviderViewerWinFormsUI.cs#L123-L161)]
Expand Down
Binary file modified apiconcepts/terminology/images/general_01_add_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apiconcepts/terminology/images/general_02_add_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apiconcepts/terminology/images/general_03_add_tb.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apiconcepts/terminology/images/general_05_term_rec.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apiconcepts/terminology/images/general_06_term_rec.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apiconcepts/terminology/images/general_07_search.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apiconcepts/terminology/images/general_08_search.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apiconcepts/terminology/images/general_10_tb_viewer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apiconcepts/terminology/images/general_11_add_term.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apiconcepts/terminology/images/search_settings.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 13 additions & 22 deletions apiconcepts/terminology/overview.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
Terminology Overview
=========
# Terminology Overview

This section gives an overview of what terminology providers in Var:ProductName are and how they are used.
This section provides an overview of terminology providers in Var:ProductName and their usage.

What is a Terminology Provider?
-------
## What is a Terminology Provider?

A terminology provider plug-in enables Var:ProductName to smoothly integrate terminology sources, such as termbases and glossaries. These terminology sources can then be used to:
A terminology provider plug-in allows Var:ProductName to integrate terminology sources, such as termbases and glossaries. These sources can be used to:

* look up terminology by searching for a specific string that the user enters, similar to an electronic dictionary lookup
* search a sentence for any known terminology
* add term entries to the terminology source
* edit terminology in the terminology source

Selecting the Terminology Provider
-------
## Selecting the Terminology Provider
When you implement a custom terminology provider, you need to consider a number of features that such plug-ins typically have. First, you select the terminology provider in Var:ProductName. By default, Var:ProductName features two standard terminology providers for connecting to MultiTerm termbase files or MultiTerm server termbases:

<img style="display:block; " src="images/general_01_add_tb.jpg" />


The name of your plug-in will have to feature in the list of terminology providers. Your implementation would then have to call up a user interface in which the terminology source (e.g. a glossary text file) can be selected. In case of a file-based resource, it would be an **Open File** dialogue box, e.g.:
Your plug-in name must appear in the list of terminology providers. The implementation should display a user interface where the terminology source (e.g. a glossary text file) can be selected. For file-based resources, this would typically be an **Open File** dialogue box, e.g.:

<img style="display:block; " src="images/general_02_add_tb.jpg" />

Selecting the Terminology Resource languages
-------
## Selecting the Terminology Resource Languages
A terminology resource typically has terms in several languages. These languages can be named in various ways. For example, the language &apos;English&apos; might be called &apos;ENG&apos;, &apos;Anglais&apos;, &apos;Englisch&apos;, &apos;Inglés&apos;, etc. When selecting a terminology resource, Var:ProductName assigns the languages of the terminology resource to the corresponding project language in Var:ProductName. This is done in the background using locales, e.g. &apos;en-US&apos; for US English, as the language labels used in the terminology resource cannot always be predicted. If Var:ProductName fails to assign the correct languages, you can manually assign the correct language using a dropdown list in Var:ProductName, which shows all the languages offered by the terminology resource, e.g.:

<img style="display:block; " src="images/general_03_add_tb.jpg" />

This is also why, after selecting a terminology resource, Var:ProductName prompts you to make sure that the correct languages of the terminology resource have been picked, i.e.:
After selecting a terminology resource, Var:ProductName prompts you to confirm that the correct languages have been picked, i.e.:

<img style="display:block; " src="images/general_04_add_tb.jpg" />

Active Terminology Recognition
-------
## Active Terminology Recognition
When the terminology provider is selected, it will search search the segments in Var:ProductName for any
known terminology. It will mark the recognized term (e.g. *photo printer*) with a red line, and display the term and its translation in the **Term Recognition** window, e.g.:

Expand All @@ -47,8 +42,7 @@ You can insert the target term into the target segment by typing the first lette

By default, terms in the source segment should only be recognized when there is a target equivalent, as a source term without a translation is normally of no use during translation.

Search Settings
-------
## Search Settings
Users can switch to the **Termbase Search** window and enter search terms manually. The window will then display any hits with source and target terms.

<img style="display:block; " src="images/general_07_search.jpg" />
Expand All @@ -57,22 +51,19 @@ You can also activate the **Fuzzy Search** option to make the search tolerant, s

<img style="display:block; " src="images/general_08_search.jpg" />

The Termbase Viewer
-------
## The Termbase Viewer
A terminology entry can have more than just the source and the target term. It can have additional information, such as definitions, notes, remarks, etc. As the **Term Recognition** and **Termbase Search** window by default only show the source and target terms, you can view any further information in the **Termbase Viewer** window, which you can call up through the **View term details** command:

<img style="display:block; " src="images/general_10_tb_viewer.jpg" />

Depending on the nature and content of the terminology resources supported by your custom implementation, this window can show different things. For a MultiTerm termbase, it shows a MultiTerm entry (see screenshot above), for an MS Excel glossary, it can show, for example, the terminology in a tabular format. The display control used here will be part of your custom implementation. In this window, you can also implement editing functionality, so that users can modify the content of the terminology resource. Your custom plug-in can feature editing functionality or not.

Adding Terminology
------
## Adding Terminology
The implementation can also be made to support adding term pairs. In this case, you select the source and target term, and use the corresponding command in Var:ProductName to add the term pair to the terminology resource. You can programmatically retrieve the source and target string, and then add term pair to the terminology resource.

<img style="display:block; " src="images/general_11_add_term.jpg" />

Term Search Settings
------
## Term Search Settings
Var:ProductName features a page through which you can configure various search settings. For example, you can decide whether or not source terms without any target term will be shown to the users. These settings are passed through the terminology provider interface and can be used in your custom term provider implementation.

<img style="display:block; " src="images/search_settings.jpg" />
Loading
Loading