Consultor Eletrônico



Kbase 20542: How to handle leading and trailing space issues in Translation Manager
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Verified

GOAL:

How to handle leading and trailing space issues in Translation Manager

FACT(s) (Environment):

Progress 9.1A
Progress 9.1B

FIX:

This solution applies to Progress Version 9.1A18 and later. It discusses changes in the Progress Translation Manager. Specifically:


- It describes behavioral changes regarding leading and trailing spaces.

- It documents the versions in which the changes took place.

- It describes how the changes might have affected the Translation Manager project database.

- It describes what steps to take at each stage to restore correct behavior and data.

Starting in Progress 9.1A18, a series of changes took place regarding leading and trailing spaces in strings to be translated. Under certain conditions, behavioral changes might produce incorrect data in the Translation Manager project database.

Some of the incorrect data can be fixed with use of the Translation Manager utilities that are described in Progress Solution 20544, "How to Troubleshoot Translation Manager Issues". Please read that solution in full before you use the utilities or take any steps to fix any leading/trailing space problems.

The following procedures (s1.p and s2.p) are used in the following portion of this solution to explain how Translation Manager behavior changed:


Procedure s1.p:
===================
MESSAGE "hello".
MESSAGE "hello ".
MESSAGE " hello".

Procedure s2.p:
===================
MESSAGE " hello".
MESSAGE "hello ".
MESSAGE "hello".

Original behavior:

Prior to Progress 9.1A18, the Translation Manager load ignores trailing spaces in the original string. A search for "hello" or "hello " finds the same translation record and therefore both have the same translation.

For example, there is one translation for "hello" and "hello ", and another for " hello". The load produces the following strings (XL_String_info) and instances (XL_Instance):


XL_String_Info               XL_instance
KeyOfString/Original_string  Length       Procedure String
===========================  ===========  ========= ======
hello/hello*                  5           S1.p   "hello"
                              5           S2.p   "hello"
                              6           S1.p   "hello "
                              6           S2.p   "hello "
_hello/_hello                 6           S1.p   " hello"
                              6           S2.p   " hello"

*can be hello_/hello_ (Note: the underscore (_) denotes a space).

NOTE: This is the correct behavior. If you use a version earlier than 9.1A18, you are not affected by the following changes. If you want to upgrade to a newer version of Translation Manager, upgrade to Version 9.1B06 or later in order to avoid any of the problems described here.

KeyOfString/Original_String

Two fields in XL_string_info that are used by Translation Manager code to determine if a string is present in a project.

Length

A field in the XL_Instance table that shows the maximum length of a string.

Procedure

A field in the XL_Instance table that points to the origin of the string.

String

Actual strings from procedures / xref file.

Problem 1 (change in BEGINS behavior):

In Progress 9.1A18, the following behavior is introduced where there are 3 distinct translations for each of the 3 strings. Trailing spaces are considered significant. In this version, there is an extra translation as follows:


XL_String_Info                XL_instance
KeyOfString/Original_string   Length         Procedure  String
===========================   ===========    =========  ======
hello/hello                    5             S1.p    "hello"
                               5             S2.p    "hello"
hello_/hello_                  6             S1.p    "hello "
                         .      6             S2.p    "hello "
_hello/_hello                  6             S1.p     " hello"
                               6             S2.p     " hello"

This caused problems if you expected "hello " and "hello" to both be translated. In this version, "hello " is not translated.

Solution:

To fix this problem, you can use the provided utility that reports and deletes the extra strings. This utility is described in the previously mentioned KBase 20544.

The Progress version should also be upgraded to Progress 9.1B06 for all further use of Translation Manager.


Problem 2 TRIM() instead of RIGHT-TRIM():

In Progress 9.1B04, Translation Manager was changed to fix problem 1. The fix caused the load to ignore the presence of leading spaces as well as trailing spaces. The result was that truly distinct strings are merged into one string. If you load procedures with this version, you are missing unique strings from your project database for strings with leading spaces as follows:


XL_String_Info                XL_instance
KeyOfString/Original_string   Length         Procedure  String
===========================   ===========    =========  ======
hello/hello                5             S1.p       "hello"
                           5             S2.p       "hello"
                              6             S1.p       "hello "
                              6             S2.p       "hello "
                              6             S1.p       " hello"
                              6             S2.p       " hello"

Solution:

If you loaded procedure strings with this version, you should obtain Progress 9.1B06 and reload the procedures (before) you do any translating or procedure changes.

If you have translated with this version, please contact Progress Technical Support before you attempt any fix. Translating with this project database might cause loss of translations.

New correct behavior:

The original correct behavior for Translation Manager is restored in Version 9.1B06..