Jump to content

thosecars82

Members
  • Posts

    59
  • Joined

  • Last visited

    Never

Everything posted by thosecars82

  1. Sorry, I just realized that I had not described the problem accurately. The problem is that I have this simple code <? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.arreglaordenador.com" ); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <?php $language="fr_FR"; putenv("LC_ALL=$language"); setlocale(LC_ALL, $language); bindtextdomain("messages", "./locale"); textdomain("messages"); print "<p>"._("hi! This website is written in English.")."</p>\n"; ?> </body> </html> and no matter what string I set the variable $language with that gettext will always look for a translation in the folder locale\es_ES\LC_MESSAGES whether the language is Spanish (es_ES) or not. For example, in the above code, gettext will not look for the French translation as it should in locale\fr_FR\LC_MESSAGES but it will look for the translation into the folder corresponding to Spanish language, that is to say, locale\es_ES\LC_MESSAGES. Moreover, if gettext does not find the folder locale\es_ES\LC_MESSAGES then it will display the string in the original language(English) even if $language equals "fr_FR" and at the same time there is a locale\fr_FR\LC_MESSAGES folder created and the corresponding messages.mo and messages.po files created in this folder. I made sure that I re-run Apache and MySql under Xampp whenever I change anything in the code but it keeps having this behaviour anyways. Do you have any idea about why only translations in .po files in the Spanish folder locale\es_ES\LC_MESSAGES are considered and not those translations corresponding to other languages and other folders? Thanks in advance.
  2. Hello I have a problem. Altough I got gettext working under a remote server environment, I have not got it working yet under a XAMPP installation. I have made sure that gettext is enabled by going to http://localhost and looking into phpinfo. The code is really simple: <? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.arreglaordenador.com" ); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <?php $language="es_ES"; putenv("LC_ALL=$language"); setlocale(LC_ALL, $language); bindtextdomain("messages", "./locale"); textdomain("messages"); print "<p>"._("This website is written in English")."</p>\n"; ?> </body> </html> Any idea? Thanks
  3. Just had to include a .htaccess file into the wordpress installation with this code: DirectoryIndex index.php Thanks though.
  4. Hello there I would appreciate if any of you could give me a hint about why I just see a blank page when I click http://www.arreglaordenador.com/blog/wp-admin/install.php I uploaded all the unzipped wordpress installation file and uploaded the content into the blog directory http://www.arreglaordenador.com/blog Now I do not understand why I do not even see anything in this page. I just see blank. Does any of you have any idea about it? Thanks a lot.
  5. Hello I would like to ask you why I see this square in red color just in my local xampp installation. If I run the code in the remote server (http://www.arreglaordenador.com/numberimage2.php) I see the square in black color instead of red. Do you have any ideas? <?php $im = imagecreatetruecolor(100, 100); // sets background to red $red = imagecolorallocate($im, 255, 0, 0); imagefill($im, 0, 0, $red); header('Content-type: image/png'); imagepng($im); imagedestroy($im); ?> Thanks
  6. Ok, thanks for those two lines for debugging. They helped me to know the problem was the $rootPath variable. Now, if you see the number is displayed, however the background is displayed in black color making the number very difficult to see. However, I do not understand why this just happens remotely and not locally. <?php $fontDir = "fonts/"; $fn = (isset($_GET['fn'])) ? $_GET['fn'] : "arial.ttf"; $fs = (isset($_GET['fs'])) ? $_GET['fs'] : 10; $maxWidth = 80 * $fs; $colorArray = array ("red", "green", "blue", "cyan", "magenta", "yellow", "black", "white", "gray"); // $colorArray = array ("black", "black", "black", "black", "black", "black", "black", "black", "black"); $color = (isset($_GET['color'])) ? $colorArray[$_GET['color']] : $colorArray[rand(0, ]; $txt = (isset($_GET['txt'])) ? $_GET['txt'] : "0000000"; $coords = imagettfbbox($fs, 0, $fontDir . $fn, $txt); $w = abs($coords[4]) + 8; $h = abs($coords[5]) + 8; $img = imagecreatetruecolor($w, $h); $red = imagecolorallocate($img, 255,0,0); $green = imagecolorallocate($img, 0,255,0); $blue = imagecolorallocate($img, 0,0,255); $cyan = imagecolorallocate($img, 0,255,255); $magenta = imagecolorallocate($img, 255,0,255); $yellow = imagecolorallocate($img, 255,255,0); $black = imagecolorallocate($img, 0,0,0); $white = imagecolorallocate($img, 255,255,255); $gray = imagecolorallocate($img, 127,127,127); $fill = ($color == "white") ? $black : $white; imagefill($img, 0, 0, $fill); $position = 4; if (isset($_GET['position'])) $position = $_GET['position']; imagettftext($img, $fs, 0, 0, $h-$position, $$color, "$fontDir$fn", $txt); header("content-type: image/jpeg"); imagejpeg($img, "", 100); imagedestroy($img); ?> Thanks
  7. Hello I do not know why but this code seems to work fine only in my xampp local insallation but not in the remote server. I just see a black square instead of the number 0000000 when I run this code in the remote server through the link http://www.arreglaordenador.com/numberimage.php and the code in numberimage.php is: <?php $fontDir = $rootPath . "fonts\\"; $fn = (isset($_GET['fn'])) ? $_GET['fn'] : "ARIAL.ttf"; $fs = (isset($_GET['fs'])) ? $_GET['fs'] : 10; $maxWidth = 80 * $fs; //$colorArray = array ("red", "green", "blue", "cyan", "magenta", "yellow", "black", "white", "gray"); $colorArray = array ("black", "black", "black", "black", "black", "black", "black", "black", "black"); $color = (isset($_GET['color'])) ? $colorArray[$_GET['color']] : $colorArray[rand(0, ]; $txt = (isset($_GET['txt'])) ? $_GET['txt'] : "0000000"; $coords = imagettfbbox($fs, 0, $fontDir . $fn, $txt); $w = abs($coords[4]) + 8; $h = abs($coords[5]) + 8; $img = imagecreatetruecolor($w, $h); $red = imagecolorallocate($img, 255,0,0); $green = imagecolorallocate($img, 0,255,0); $blue = imagecolorallocate($img, 0,0,255); $cyan = imagecolorallocate($img, 0,255,255); $magenta = imagecolorallocate($img, 255,0,255); $yellow = imagecolorallocate($img, 255,255,0); $black = imagecolorallocate($img, 0,0,0); $white = imagecolorallocate($img, 255,255,255); $gray = imagecolorallocate($img, 127,127,127); $fill = ($color == "white") ? $black : $white; imagefill($img, 0, 0, $fill); $position = 4; if (isset($_GET['position'])) $position = $_GET['position']; imagettftext($img, $fs, 0, 0, $h-$position, $$color, "$fontDir$fn", $txt); header("content-type: image/jpeg"); imagejpeg($img, "", 100); imagedestroy($img); ?> Does any of you have any suggestion? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.