WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#41470 closed defect (bug) (invalid)

Chinese Translation "zh_HK" in wp trim words that should not be translated.

Reported by: turtlepod Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: I18N Keywords:
Focuses: Cc:
PR Number:

Description

I'm really sorry, I don't know where to report this (I do not speak Chinese)
So, I'll just post it here.

In zh_HK.pot, there's a word that should not be translated, but in zh_HK, they translated it. And it cause wp_trim_words fail to trim the text (e.g excerpt show full content)

I checked at the zh_CN.pot and i think it should be translated to "characters_excluding_spaces"

Link: https://developer.wordpress.org/reference/functions/wp_trim_words/

<?php
  /*
     * translators: If your word count is based on single characters (e.g. East Asian characters),
     * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
     * Do not translate into your own language.
     */
    if ( strpos( _x( 'words', 'Word count type. Do not translate!' ), 'characters' ) === 0 && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
        $text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
        preg_match_all( '/./u', $text, $words_array );
        $words_array = array_slice( $words_array[0], 0, $num_words + 1 );
        $sep = '';
    } else {
        $words_array = preg_split( "/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY );
        $sep = ' ';
    }

Screenshot of the translation:
https://drive.google.com/file/d/0B9TdkMXV_Q7GRGdRek5FeU12T00/view?usp=sharing

If anyone can report to their translation team it would be great!

Change History (4)

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


2 years ago

#2 @netweb
2 years ago

  • Component changed from Text Changes to I18N
  • Focuses accessibility docs template removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version 4.8 deleted

I've pinged the #zh_HK in Slack https://wordpress.slack.com/archives/C02RP50LK/p1501216374669059

Also pinging @wisley and @ckykenken from #zh-hk team here on the ticket :)

p.s. I'm going to close the ticket as it's not a core issue, discussion can continue on the ticket without reopening it

#3 @turtlepod
2 years ago

Thank you so much!
I really appreciate it.

#4 @greglui
2 years ago

Looks like it has been fixed by @ckykenken for 4.8. And I just reverted it for 4.6 and 4.7 thanks!

Note: See TracTickets for help on using tickets.