2011/11/27 Karl Pflästerer <k...@rl.pflaesterer.de>:
> Hi,

Hi,

> forgive me if I ask something which had already been discussed, but I've
> seen nothing in the archives.
>
> I try to help translating some of the docs and saw here
> https://edit.php.net/ this box:
>
> Check for errors in /language-snippets.ent
>
> The content for that box seems to get computed from tha class
> http://svn.php.net/repository/web/doc-editor/trunk/php/ToolsError.php
>
> There is a method attributLinkTag()
>
> To compare the linkend atrribute of the <link> tags it uses a regex.
>
> $reg = '/<link\s*?linkend=("|\')(.*?)("|\')\s*?>/s';
>
> You see between <link and the linkend attribute only whitespace is allowed.
> But for example in the german translation (and also in the english
> documentation) some <link> tags have another attribute between the element
> name and "linkend".

Could you give me an example please of this case ?


> An easy fix would be
> $reg = '/<link[^<>]+linkend=("|\')(.*?)("|\')[^<>]*>/s';
>
> But that would solve only have of the problem; the other problem is that the
> check script needs the same order of entities in both files and it compares
> only the position of the found links in both match arrays. So e.g. one link
> more in the translation will give false matches for all following entries.

Yes it is.
The goal here is to check each file and warn when there is only one
difference even if this is an ordre problem (this can be a translation
error too).


> Does it make sense to rewrite that algorithm, so that it compares each
> entity in the english original and the translation so we get better errors?

You mean to avoid order check ?
Perhaps we can do this yes : check the number of this tag, and check
if there is all of this tag, even if the order is not respected.


>  KP
>
>
>

Reply via email to