WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#30603 closed defect (bug) (fixed)

Twenty Fifteen: Translators comments missing from GlotPress

Reported by: netweb Owned by: iandstewart
Milestone: 4.1 Priority: normal
Severity: normal Version: 4.1
Component: Bundled Theme Keywords: i18n-change needs-patch
Focuses: docs Cc:

Description

Translators comments missing from GlotPress:

Example:

Results:

  • Only the context is displayed Context: Add new subset (greek, cyrillic, devanagari, vietnamese)

Expected:

  • The context Context: Add new subset (greek, cyrillic, devanagari, vietnamese) AND the translators comment Translators: To add an additional character subset specific to your language, translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language. to be displayed.`

An example of a 'Working Translators Comment':

Attachments (3)

30603.diff (2.3 KB) - added by netweb 7 years ago.
30603.2.diff (2.3 KB) - added by DrewAPicture 7 years ago.
30603.3.diff (2.6 KB) - added by iamtakashi 7 years ago.

Download all attachments as: .zip

Change History (19)

@netweb
7 years ago

#1 @netweb
7 years ago

In the 30603.diff patch I have switched the translators comment to a single line rather than multiline, I am not 100% sure this is the correct fix, "I think" it is though ;)

#2 @ocean90
7 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.1

#3 follow-up: @azaozz
7 years ago

Thinking the error is the capital T. There are couple of multi-line translators: comments that seem to work fine?

#4 in reply to: ↑ 3 ; follow-up: @ocean90
7 years ago

Replying to azaozz:

Thinking the error is the capital T.

That's not the error because the i18n tool is using stripos() here, see trunk/tools/i18n/extract.php@29563#L174.

#5 @DrewAPicture
7 years ago

  • Focuses docs added
  • Keywords i18n-change needs-patch added; has-patch removed

In the i18n tools it seems to me that there isn't a mechanism for handling inner-comment lines only beginning with a space and an asterisk: ' *'. That could be the issue with the comments not getting matched up.

FWIW, in my search I could only find five instances where translator comments were multi-line, four of them in TwentyFifteen and one of them in TwentyFourteen. I'd suggest lowercasing the 'T' for consistency and moving to single-line comments as a precaution.

Adversely, we could update the RegEx in find_function_calls() to handle multi-line comments. I'm thinking that would be a good later-addition at this juncture.

Last edited 7 years ago by DrewAPicture (previous) (diff)

@DrewAPicture
7 years ago

#6 @DrewAPicture
7 years ago

  • Keywords has-patch commit added; needs-patch removed

30603.2.diff lowercases the 'T'.

#7 follow-up: @iandstewart
7 years ago

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

In 30790:

Twenty Fifteen: moving to a single line for tranlator comments to prevent them being missed in i18n tools.

Props netweb, DrewAPicture, fixes #30603.

#8 @netweb
7 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

The twentyfifteen.pot needs updating after r30790

#9 @iandstewart
7 years ago

  • Keywords needs-patch added; has-patch commit removed

@iamtakashi
7 years ago

#10 @iandstewart
7 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 30811:

Twenty Fifteen: updating the .pot to reflect changes in r30790.

Props iamtakashi, fixes #30603.

#11 in reply to: ↑ 4 @netweb
7 years ago

Thanks y'all, working as intended now :)

And to follow up for those following along and future reference:

Replying to ocean90:
Replying to azaozz:

Thinking the error is the capital T.

That's not the error because the i18n tool is using stripos() here, see trunk/tools/i18n/extract.php@29563#L174

This's correct stripos() looks for /* or // on a new line, nothing to do with the capitalisation of the letter T.

Last edited 7 years ago by netweb (previous) (diff)

This ticket was mentioned in Slack in #glotpress by netweb. View the logs.


7 years ago

#13 in reply to: ↑ 7 @SergeyBiryukov
7 years ago

In 30790:

Twenty Fifteen: moving to a single line for tranlator comments to prevent them being missed in i18n tools.

For the record, looks like multiple lines were not the issue here, an empty line after /* was. See [25908].

#15 @ocean90
7 years ago

In 31500:

Revert [30790] and update POT file for Twenty Fifteen.

see #30972, #30603.

#16 @ocean90
7 years ago

In 31501:

Update POT file for Twenty Fourteen.

props SergeyBiryukov.
see #30972, #30603.

Note: See TracTickets for help on using tickets.