Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#5594 closed defect (bug) (duplicate)

Translations do not work on AMD64

Reported by: szotsaki's profile szotsaki Owned by:
Milestone: Priority: high
Severity: major Version: 2.3.2
Component: General Keywords: translation, AMD64, gettext, patch
Focuses: Cc:

Description

Even tough I installed the Hungarian language pack correctly (copied into the languages folder and changed the wp-config.php file) Wordpress did not recognise the new settings and used English as its default language.

I figured out (with this post: http://wordpress.org/support/topic/36104?replies=3#post-204361) that there is a bug in the wp-includes/gettext.php file.

I had to change a line (+ $magic == $MAGIC1) and everything works fine!

Here is the patch:

--- gettext.php	2008-01-06 21:47:28.000000000 +0100
+++ gettext.php	2008-01-06 21:38:13.000000000 +0100
@@ -114,7 +114,7 @@
 
 		$this->STREAM = $Reader;
 		$magic = $this->readint();
-		if ($magic == ($MAGIC1 & 0xFFFFFFFF) || $magic == ($MAGIC3 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms
+		if ($magic == ($MAGIC1 & 0xFFFFFFFF) || $magic == ($MAGIC3 & 0xFFFFFFFF) || $magic == $MAGIC1) { // to make sure it works for 64-bit platforms
 			$this->BYTEORDER = 0;
 		} elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) {
 			$this->BYTEORDER = 1;

My system:
Linux szotsaki 2.6.23-gentoo-r5 #2 SMP Sat Jan 5 00:14:58 CET 2008 x86_64 Intel(R) Core(TM)2 Duo CPU T5250 @ 1.50GHz GenuineIntel GNU/Linux
Lighttpd and MySQL

Change History (3)

#1 @lloydbudd
17 years ago

szotsaki, can you see if the patch in #3780 works for you? If so this issue has been fixed on trunk.

#2 @szotsaki
17 years ago

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

Yes, it must be work.
The diff (http://trac.wordpress.org/attachment/ticket/3780/gettext-64-without-bitwise-ops.diff) uses the $magic == $MAGIC1 which is the essence of my solution.

Thus I mark this bug as duplicate.

#3 @darkdragon
17 years ago

  • Milestone 2.5 deleted
Note: See TracTickets for help on using tickets.