[Libreoffice] Reducing duplicating strings

Michael Meeks michael.meeks at suse.com
Tue Nov 15 04:12:06 PST 2011


Hi Lior,

On Mon, 2011-11-07 at 22:35 +0100, Lior Kaplan wrote:
> One of the things I noticed while working about LibO translation is
> the strong deja-vu feeling. I keep thinking - wait, I've already
> translated this string. I went to check the code, and found out there
> are actually a lot of duplicated strings.

	Bother :-) and of course I just made that worse by pushing some of the
file-picker strings down from svx/ into vcl/ duplicating them at the
same time: sorry.

> Just to clarify - I don't expect each string to only appear once, as
> it might have different meaning or other context depending of the part
> of LibO in which it appears. But that said, there are cases where the
> same strings appear in very adjacent parts of LibO, which I think can
> be reduced.

	Sounds like a worthy thing to do to me - but it'll require some compile
testing I suspect, and perhaps some new features.

> A small example could be the strings at
> svx/source/unodialogs/textconversiondlgs - from 60 strings, 29 are
> duplicates and it has only 3 src files. Actually, one file

	:-)

>  (chinese_dialogs.src) have all the strings of the other files
> (chinese_dialogs.src and chinese_dialogs.src) + 2 new strings.

	That seems like there should be some associated code sharing as well to
me ;-) quite probably the UI should be built from a base-class for that
- which would shrink our code size as well. Well worth fixing if you're
interested.

	Things like:

    CheckBox CB_USE_VARIANTS
    {
	...
        Text [ en-US ] = "~Use Taiwan, Hong Kong SAR, and Macao SAR
character variants";

	make me wonder if the .src file format even allows the text field to
refer to another (shared) string definition. If not, of course we should
prolly fix that in the rsc/ module and tools/ resmgr.

> This need to double translate in a single module (or PO file in the
> pootle system) is quite frustrating. I would be happy try and figure a
> solution to save some of these extra strings to translate when
> possible.

	Right; I wonder how best to do it. Alternatives might be to build a
list of known duplicate strings that are semantically identical and
munge that into the .po generation tooling ( Andras ? ). Either way - it
sounds like detecting duplicates once is much more efficient than doing
it per-language :-)

	Thanks,

		Michael.

-- 
michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list