Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#42161 closed defect (bug) (fixed)

i18n: Use %s placeholders in translation strings (wp-admin/setup-config.php)

Reported by: ramiy's profile ramiy Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch needs-testing
Focuses: Cc:

Description

This patch replaces wp-config.php with %s in translation strings. This way the file name can't be mistakenly changes by the translator (this is the best practice).

I also added <code> tag around the file name.

Attachments (3)

42161.patch (1.7 KB) - added by ramiy 7 years ago.
42161.2.patch (2.9 KB) - added by ramiy 7 years ago.
two more strings
42161.3.diff (2.2 KB) - added by danieltj 7 years ago.
Update to strings

Download all attachments as: .zip

Change History (11)

@ramiy
7 years ago

#1 @ramiy
7 years ago

  • Keywords has-patch added

#2 @ramiy
7 years ago

I should say that the other translation strings in the file use %s and the file names use <code> HTML tags.

This ticket was mentioned in Slack in #core-i18n by ramiy. View the logs.


7 years ago

@ramiy
7 years ago

two more strings

#4 @ramiy
7 years ago

Note: the second patch has minor string changes.

@danieltj
7 years ago

Update to strings

#5 @danieltj
7 years ago

  • Keywords needs-testing added

In 42161.3.diff

I've updated the patch because the last two changes are fine as they are already and the wording itself doesn't need to be changed - the file names just need to be used as placeholders.

#6 @ramiy
7 years ago

@danieltj other translation strings that display filenames using %s placeholders are usually use <code> tags to emphasize the file, not apostrophes. Just saying...

If we are already fixing those strings, let's apply all the accepted conventions - %s placeholders, translators comments, HTML tags etc.

#7 @SergeyBiryukov
7 years ago

  • Milestone changed from Awaiting Review to 4.9

#8 @SergeyBiryukov
7 years ago

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

In 41904:

I18N: Replace hardcoded file name in translatable strings in wp-admin/setup-config.php with a placeholder.

Props ramiy, danieltj.
Fixes #42161.

Note: See TracTickets for help on using tickets.