Eléphant du PHP |
385 Messages
28 oct. 2015, 14:07
Finalement j'ai un autre problème désoler, voilà ma traduction n'ai pas faite mon fichier index
<?php require"localization.php";?>
<h1><?php echo _("chaine") ?></h1>
mon fichier localization.php
<?php
/*
Copyright (c) 2003,2004,2005,2009 Danilo Segan <[email protected]>.
Copyright (c) 2005,2006 Steven Armstrong <[email protected]>
This file is part of PHP-gettext.
PHP-gettext is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
PHP-gettext is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with PHP-gettext; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
error_reporting(E_ALL | E_STRICT);
// define constants
define('PROJECT_DIR', realpath('./'));
define('LOCALE_DIR', PROJECT_DIR .'/locale');
define('DEFAULT_LOCALE', 'en');
require_once('lib/gettext/gettext.inc');
$supported_locales = array('en');
$encoding = 'UTF-8';
$locale = (isset($_GET['lang']))? $_GET['lang'] : DEFAULT_LOCALE;
// gettext setup
T_setlocale(LC_MESSAGES, $locale);
// Set the text domain as 'messages'
$domain = 'messages';
bindtextdomain($domain, LOCALE_DIR);
// bind_textdomain_codeset is supported only in PHP 4.2.0+
if (function_exists('bind_textdomain_codeset'))
bind_textdomain_codeset($domain, $encoding);
textdomain($domain);
header("Content-type: text/html; charset=$encoding");
?>
mon fichier de traduction situé dans C:\wamp\www\gettext\international\locale\en_US\LC_MESSAGES
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2015-10-28 13:47+0100\n"
"PO-Revision-Date: 2015-10-28 13:51+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.5\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en\n"
msgid "chaine"
msgstr "string array here yeah!!!!"
j'ai du oublié quelque chose mais je ne sais pas quoi par contre dans poedit je n'ai pas trouvé pour sélectionner les mots clés, merci encore de votre aide.