Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#34216 closed defect (bug) (fixed)

Remove HTML tags from translatable database error strings

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Database Keywords: has-patch
Focuses: Cc:

Description

Currently, our database error strings are just large chunks of HTML:

Looking at #polyglots-warnings, they often cause warnings in GlotPress due to missing or incorrectly translated tags, as well as starting and ending with a newline.

We generally avoid unnecessary HTML tags in translatable strings, so we should split these ones too.

Attachments (1)

34216.patch (6.7 KB) - added by SergeyBiryukov 10 years ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
10 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 34942:

Split database error messages into separate strings to remove unnecessary HTML tags from translations.

Add translator comments for placeholders.

Fixes #34216.

#2 @SergeyBiryukov
10 years ago

In 34943:

Add wp_load_translations_early() to wpdb::check_connection().

Fixes #29306. See #34216.

#3 follow-up: @pavelevap
10 years ago

Nice, but actually translators lost some context. As a paragraph, they could see what is h1 title and could make sense to the whole paragraph. But now, they have several sentences without exact order and for example string Are you sure it exists? is without any other context. What exists? In our language it is important to know what is exactly it to make a good translation.

#4 in reply to: ↑ 3 @SergeyBiryukov
10 years ago

Replying to pavelevap:

What exists? In our language it is important to know what is exactly it to make a good translation.

I agree, but these strings should still be grouped together when ordering by date of the original in GlotPress. The link to source code in GlotPress or Poedit should help as well.

#5 @pavelevap
10 years ago

Sure, but somebody can suggest translation in GlotPress only for some strings, etc and order is gone. I like the idea of removing HTML from simple strings, but in the case of long paragraphs we are losing important context which is wrong. For example translation of some sentences can be different (and better) when translators know that they are items of list (li) and exact order. I know how to simulate those situations by changing wp-config.php and see it live, but many translators not (and they should not)...

Note: See TracTickets for help on using tickets.