[wp-trac] [WordPress Trac] #50021: Internationalization of excerpt function in "Latest Posts" block

WordPress Trac noreply at wordpress.org
Thu Feb 29 02:35:00 UTC 2024


#50021: Internationalization of excerpt function in "Latest Posts" block
-------------------------------+------------------------------
 Reporter:  tmatsuur           |       Owner:  (none)
     Type:  feature request    |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  I18N               |     Version:  5.4
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by tmatsuur):

 Thanks @sabernhardt .

 I feel that the situation here has not changed with version 6.4.3.


 To confirm, we added a few lines of text and a "Latest Posts" block to the
 content of the first post in WordPress version 6.4.3.


 When the site's language setting is Japanese and the user's language
 setting is Japanese:


 [[Image(https://elearn.jp/img/latest_posts_2024022901.png)]]

 In this situation, wp_trim_words() returns the following:

 {{{
 $post = get_post(1);
 var_dump( wp_trim_words( $post->post_content ) );
 }}}

 {{{
 string(151) "WordPress へようこそ。こちらは最初の投稿です。編集または削除
 し、コンテンツ作成を始めてください。 よ…"
 }}}


 When the user's language setting is English:

 [[Image(https://elearn.jp/img/latest_posts_2024022902.png)]]

 Also, wp_trim_words() returns:

 {{{
 string(402) "WordPress へようこそ。こちらは最初の投稿です。編集または削除
 し、コンテンツ作成を始めてください。 よりわかりやすくするために、数行追加
 しています。 これは"Latest Posts"ブロックにて抜粋表示のふるまいを確認する
 ためのものです。 抜粋内容は編集中のユーザーの言語設定に依存しています。"
 }}}

 Changing the "MAX NUMBER OF WORDS(最大文字数)" in the "Latest Posts" block
 from 10 to 100 does not change what is displayed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50021#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list