[PHP-BUG] Bug #60800 [NEW]: String is not translated

2012-01-19 Thread niklas at iandapp dot com
From: 
Operating system: Centos 6.2
PHP version:  5.3.9
Package:  Gettext related
Bug Type: Bug
Bug description:String is not translated

Description:

What happens is that the msgid in the .mo is printed, not the translated
one. I.e. if i do "echo gettext("Service");" then "Service" is printed, not
the swedish "Tjänster".

There are absolutely no error messages in httpd/error_log. Not when running
the app or (re-)starting apache. 

This is my directory structure:

/path/to/locale/sv_SE.utf8/LC_MESSAGES/messages.mo
/path/to/setlocale.php

My messages.po file:

msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-01-18 20:09+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: setlocale.php:29
msgid "Service"
msgstr "Tjänst"

#: setlocale.php:30
msgid "Name"
msgstr "Tjänst"

setlocale.php:



Since "gettext is supported " is printed, gettext is at least working to
some degree.

'sv_SE.utf8' is also printed, hence it exist in the system

I'm not sure if it is a bug that makes this not working or if it is a bug
that makes no error messages being presented anywhere (not sure if it is
supposed to...). 

This is my configuration from makeing php:

./configure --enable-intl --with-gettext --with-gettext=/usr/sbin
--with-apxs2=/usr/sbin/apxs --with-mysql=mysqlnd --with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd  

Here I get some error about phar (but I think PHP_Archive is working
because I have no other indication that it shouldn't work). Didn't copy the
error message and now it's long gone outside the terminal window. 

Before compiling i did this: 

yum -y install gcc-c++


Test script:
---


Expected result:

I expect the translated text (msgstr) to be printed when running the
script. 

Actual result:
--
The default text or the text is presented instead (msgid)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=60800&edit=1
-- 
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=60800&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=60800&r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=60800&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=60800&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=60800&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=60800&r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=60800&r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=60800&r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=60800&r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=60800&r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=60800&r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=60800&r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=60800&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=60800&r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=60800&r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=60800&r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=60800&r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=60800&r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=60800&r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=60800&r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=60800&r=mysqlcfg



Bug #60800 [Opn]: String is not translated

2012-01-19 Thread niklas at iandapp dot com
Edit report at https://bugs.php.net/bug.php?id=60800&edit=1

 ID: 60800
 User updated by:niklas at iandapp dot com
 Reported by:niklas at iandapp dot com
 Summary:String is not translated
 Status: Open
 Type:   Bug
 Package:Gettext related
 Operating System:   Centos 6.2
 PHP Version:5.3.9
 Block user comment: N
 Private report: N

 New Comment:

I think this was a bit unclear so I specify the path here:
/path/to/ = /var/www/html/smic/modules/core/localization


Previous Comments:

[2012-01-19 09:08:33] niklas at iandapp dot com

Description:

What happens is that the msgid in the .mo is printed, not the translated one. 
I.e. if i do "echo gettext("Service");" then "Service" is printed, not the 
swedish "Tjänster".

There are absolutely no error messages in httpd/error_log. Not when running the 
app or (re-)starting apache. 

This is my directory structure:

/path/to/locale/sv_SE.utf8/LC_MESSAGES/messages.mo
/path/to/setlocale.php

My messages.po file:

msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-01-18 20:09+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: setlocale.php:29
msgid "Service"
msgstr "Tjänst"

#: setlocale.php:30
msgid "Name"
msgstr "Tjänst"

setlocale.php:



Since "gettext is supported " is printed, gettext is at least working to some 
degree.

'sv_SE.utf8' is also printed, hence it exist in the system

I'm not sure if it is a bug that makes this not working or if it is a bug that 
makes no error messages being presented anywhere (not sure if it is supposed 
to...). 

This is my configuration from makeing php:

./configure --enable-intl --with-gettext --with-gettext=/usr/sbin 
--with-apxs2=/usr/sbin/apxs --with-mysql=mysqlnd --with-mysqli=mysqlnd 
--with-pdo-mysql=mysqlnd  

Here I get some error about phar (but I think PHP_Archive is working because I 
have no other indication that it shouldn't work). Didn't copy the error message 
and now it's long gone outside the terminal window. 

Before compiling i did this: 

yum -y install gcc-c++


Test script:
---


Expected result:

I expect the translated text (msgstr) to be printed when running the script. 

Actual result:
--
The default text or the text is presented instead (msgid)






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60800&edit=1