More Power and Security with the “Translations Checks”.

More Power and Security with the “Translations Checks”.

The translation checks gives us the power to set up a bunch of validation checks for all strings

and how to handle them (off, warning and error):

  • The translation respects any defined limits on the length of the string.
  • Email addresses found on source string are preserved in the translation.
  • New lines at the beginning of a source string are preserved in its translations.
  • New lines at the end of a source string are preserved in its translations.
  • The symbol the editor uses to denote a newline character in a source string is not copied to the translation.
  • Variable substitution specifiers (like “%s”) are preserved in the translations.
  • Translation contains only spaces.
  • URLs found on source string are preserved in the translation.
  • HTML tags are preserved in the translation.
  • Match translation brackets number (“{[()]}”) with the corresponding source string.
  • Numbers in the source string are preserved in its translations.
  • Any typographical characters (such as dashes and curly quotes) are preserved in the translation.

We aren’t gonna explain all of them, they’re plenty explanatory but one deserves we stop for 2 min:

URLs found on source string are preserved in the translation, and can’t be saved.

Do you remember, in a earlier post, we discussed how it was important to use the php sprintf() function in the WordPress strings for security issues. This simply solves it.

We immediately set it up globally for our community, so automatically for all our projects, to “error”.

Now even if a url appears in the clear in a string, (i know it shouldn’t, but it happens), an “error message” appears on the translator’s web ui if the translations doesn’t reflect exactly the source and he can’t save it.

What does it means: Security for authors, efficiency for translators. Better translations.

One more feature that makes us feel that the use of Transifex for our community is the right choice.

Below the image of how we setup everything, we’re testing this new feature, it might evolved in time but for sure the url rule will not.

How Wp-Transaltions setup pot files in Transifex

And you what do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *