Rating the Translation

If we made the previous steps, the unofficial translation we got from the server has just been enabled in our demo application.

Let us now look at the situation as developers of this demo app. How do we know what the quality of this unofficial translation is? To check this, the library provides the dialog window in which, before the user closes our application after the first enabling of the new unofficial translation, they will be asked whether the translation is good enough to keep it, or whether they would like or switch back to the default (English) language.

Thus, should we close Sample Program now, we will see the window with the text in Russian, since we have specified that this a system language in our demonstration:



Thus, the program asks whether to keep the new unofficial translation or return to the English interface. Depending on the user’s choice, the translation will get either a positive or negative rating. The rating of each translation can be viewed in your LangsHelper account in the form like this:



You may see this by logging into the demo application’s LangsHelper account.

The translation quality dialog window is shown using the below code:

bool UserChoosedToCancel = false;
if (TranslationsSiteInteraction->ActiveTranslationQualityDialog(Strings,
    &UserChoosedToCancel) == false)	{
  // The user has discarded the current translation. The active translation
  // has changed and we need to highlight it.
  ...
  }
					
var
  Strings: TActiveTranslationQualityDialogStrings;
  UserChoosedToCancel: Boolean;
...
UserChoosedToCancel := false;
if (TranslationsSiteInteraction.ActiveTranslationQualityDialog(Strings,
    UserChoosedToCancel) = false) then
  begin
  // The user has discarded the current translation. The active translation
  // has changed and we need to highlight it.
  ...
  end;
					

The ActiveTranslationQualityDialog function automatically sends the rating (positive or negative) to the server depending on the user’s choice in the above window. If the user just closed the window by clicking the cross or selecting Cancel, nothing will be sent, and the window will be shown again next time the ActiveTranslationQualityDialog function is called. So in your code it must be called every time the application is about to be closed. The dialog window will be shown only if it is necessary; that is, if the new unofficial translation has just been enabled.

The text strings passed to ActiveTranslationQualityDialog are provided by your application itself via the parameter to this function. This means that they should be included in the translation, because the quality dialog window is shown in the translation’s language. That is, you must include the below strings in your file (with the untranslated strings) which is sent out to the translators:

"Are you satisfied with the program's translation quality?"
"Yes, continue to use the current language in the program."
"No, switch to the English language."
"The language may be changed at any time in the program's settings."

The strings itself is passed to ActiveTranslationQualityDialog via the TActiveTranslationQualityDialogStrings structure.


Next step: Replaying the Demonstration Scenario