Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#17331 closed defect (bug) (fixed)

Problem with Hebrew comments on some servers

Reported by: vbcrlf's profile vbCrLf Owned by:
Milestone: WordPress.org Priority: normal
Severity: normal Version: 3.2
Component: I18N Keywords: needs-patch
Focuses: Cc:

Description

Hello,

On the server my website is on the Hebrew comments are aligned to the left instead to the right (RTL). It does not related to a theme or a plugin, and it misaligned in the admin panel as well.

I investigated the problem and found out that the comments are recognized as written in English instead of Hebrew because of this line (/wp-content/languages/he_IL.php):
$c_eng = $this->count_it($text, '/\w+/u');

Hebrew characters (in specific server configurations) are also recongized as '\w', what cause the $c_eng to high and $c_heb to be low.
Changing the line to defining the characters explicitly fixed the problem:
$c_eng = $this->count_it($text, '/[A-Za-z]+/u');

It was tested for a few months in my blog http://www.merkazhakfar.co.cc/ .

Thanks,
Ori.

Change History (4)

#1 @yoavf
14 years ago

  • Cc RanYanivHartstein added
  • Component changed from RTL to I18N
  • Keywords needs-patch added; has-patch removed

#2 @RanYanivHartstein
14 years ago

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

This is an issue with the function that identifies comment directionality and adds directional tags when necessary. It's in wp-content/languages/he_IL.php

http://svn.automattic.com/wordpress-i18n/he_IL/trunk/dist/wp-content/languages/he_IL.php

This should already be fixed when you view it - I removed that function in revision 15959. You can replace your local version of that file with the one you get there. Also fixed for 3.1 branch.

There's a discussion about whether we should replace it with a new function here (the discussion is in Hebrew):

http://groups.google.com/group/wpheb/t/afb8b30e43ad8840

#3 follow-up: @dd32
14 years ago

  • Milestone changed from Awaiting Review to WordPress.org

RanYanivHartstein: I notice you're using get_option('siteurl') there, You'd be better off changing that to use content_url() to get a HTTPS-respecting url, as well as allowing better compatibility with plugins that are manipulating user-facing url's (ie. cdn plugins, etc)

Setting the milestone to WordPress.org since it affects a international copy of WP rather than the main branch..

#4 in reply to: ↑ 3 @RanYanivHartstein
14 years ago

Replying to dd32:

RanYanivHartstein: I notice you're using get_option('siteurl') there, You'd be better off changing that to use content_url() to get a HTTPS-respecting url, as well as allowing better compatibility with plugins that are manipulating user-facing url's (ie. cdn plugins, etc)

Setting the milestone to WordPress.org since it affects a international copy of WP rather than the main branch..

Thanks, will do.

Note: See TracTickets for help on using tickets.