How to check placeholders integrity in translations

Er: Re: How to check placeholders integrity in translations

by José Miguel Andonegi Martínez -
Number of replies: 5

Hi German:

I use this trick to check for integrity:

  1. Load the language pack in la local instance of Moodle
  2. Load the language pack in the custom translation tool
  3. Run the sql instance in the attached file (tm_generator.txt)
  4. Insert the result of the query in template.tmx file

The result is a translation memory that can be analysed  with Checkmate.

The problem: probably you will get many errors due to some characters that are not allowed by Checkmate so you will have to remove manually some translation units. After doing it, you will get a report with some possible errors (see the attached image).

Of course, it would be great to have an integrated quality check system in Moodle.

Attachment kate_susmagarria.gif
In reply to José Miguel Andonegi Martínez

Re: Er: Re: How to check placeholders integrity in translations

by German Valero -
Picture of Language pack maintainers
Thanks José Miguel.

I'll try it later in my local server.

Can you please check the documentation for doing this at https://docs.moodle.org/dev/Translation_FAQ#Is_there_a_way_to_check_the_integrity_of_all_placeholders_in_a_language_pack.3F and expand/correct/change as needed?

May I assume that you have already checked and fixed the international spanish language pack for 2.9 ?

Thanks a lot.
In reply to German Valero

Er: Re: Er: Re: How to check placeholders integrity in translations

by José Miguel Andonegi Martínez -

Hi German:

I have just seen your message. It's nice to see the post in the FAQ area. smile

I have just updated the tutorial. Now it's here.

Regards!

In reply to José Miguel Andonegi Martínez

Er: Re: Er: Re: How to check placeholders integrity in translations

by José Miguel Andonegi Martínez -

Hi German:

I just had a quick look to the international Spanish Language pack. It has the logical problems derived from human errors (the same ones I found in the Basque language pack).

Some examples:

  • Some texts use entities (for instance  ). This kind of pre-UTF8 characters are allowed for HTML but not for XML. In a proper TM, they are removed, so, you could do it with a text editor Search and Replace utility (I use Notepad++). May be we could avoid using entities and change those texts (some of them are in the original English text) but I don't think it is a big problem.
  • You will get errors derived from unclosed tags (for instance missing </p>)
  • I have seen many tags like this: <P>Example</P> I am not sure if it is valid, but I would change them (see this post) .
  • You will get an error in Checkmate if you open a tag in uppercase and close it lowercase.

I did that cleaning in Basque language pack (and in some few wrong source English texts) and I encourage to do it in other language packs as well.

Regards!

In reply to José Miguel Andonegi Martínez

Er: Re: Er: Re: How to check placeholders integrity in translations

by José Miguel Andonegi Martínez -

I have updated the tutorial. Now it also explains how to get the language pack as a spreadsheet.

Regards!