make of xx.po file after svn checkout

katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Fri, 2007-08-31 18:29

Yesterday I downloaded the svn version of G2 locally to start to edit on some tr.po files with following command:

svn checkout https://gallery.svn.sourceforge.net/svnroot/gallery/trunk/gallery2 gallery2

Before editing I did a "svn update" again to be up-to-date.

Then I did "make tr.po" as described under Localization which gave me the following errors:

PHP Notice: Undefined variable: minutes in /srv/www/htdocs/gallery2/lib/tools/po/extract.php(165) : eval()'d code on line 3
PHP Notice: Undefined variable: hours in /srv/www/htdocs/gallery2/lib/tools/po/extract.php(165) : eval()'d code on line 3
PHP Notice: Undefined variable: days in /srv/www/htdocs/gallery2/lib/tools/po/extract.php(165) : eval()'d code on line 3
PHP Notice: Undefined variable: weeks in /srv/www/htdocs/gallery2/lib/tools/po/extract.php(165) : eval()'d code on line 3
PHP Notice: Undefined variable: minutes in /srv/www/htdocs/gallery2/lib/tools/po/extract.php(165) : eval()'d code on line 3
PHP Notice: Undefined variable: hours in /srv/www/htdocs/gallery2/lib/tools/po/extract.php(165) : eval()'d code on line 3
PHP Notice: Undefined variable: days in /srv/www/htdocs/gallery2/lib/tools/po/extract.php(165) : eval()'d code on line 3
PHP Notice: Undefined variable: weeks in /srv/www/htdocs/gallery2/lib/tools/po/extract.php(165) : eval()'d code on line 3
PHP Notice: Undefined variable: many in /srv/www/htdocs/gallery2/lib/tools/po/extract.php(165) : eval()'d code on line 3
PHP Notice: Undefined variable: many in /srv/www/htdocs/gallery2/lib/tools/po/extract.php(165) : eval()'d code on line 3

I tried the same with de.po and en.po which gave me the same errors.

Is my svn tree broken?
Did I miss something?

Help wanted

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2007-08-31 20:53

FAQ: What information is required when I ask for help in the forums?

cd modules/core/po
make tr.po

this works for me on current svn.

 
katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Sat, 2007-09-01 16:07

Gallery version = 2.3-svn core 1.2.21 r17012
API = Core 7.36, Module 3.8, Theme 2.6, Embed 1.2
PHP version = 5.2.0 apache2handler
Webserver = Apache/2.2.3 (Linux/SUSE)
Database = mysqli 5.0.26, lock.system=flock
Toolkits = ArchiveUpload, Dcraw, Exif, Getid3, ImageMagick, jpegtran, LinkItemToolkit, NetPBM, SquareThumb, Thumbnail, Gd
Acceleration = none, none
Operating system = Linux cou 2.6.18.8-0.5-default #1 SMP Fri Jun 22 12:17:53 UTC 2007 i686
Default theme = matrix
gettext = enabled
Locale = en_GB
Browser = Opera/9.23 (X11; Linux i686; U; en)
Rows in GalleryAccessMap table = 21
Rows in GalleryAccessSubscriberMap table = 3
Rows in GalleryUser table = 2
Rows in GalleryItem table = 1
Rows in GalleryAlbumItem table = 1
Rows in GalleryCacheMap table = 0

Warning on system check with upgrade.php:
output_buffering is activated in php.ini
modified files (tr.po's and updated files)

Shall a add content of php -i too?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2007-09-01 16:48

PHP version = 5.2.0 apache2handler

That's what your webserver is using.. but in this case for the makefiles we need to know what version you're using for cmdline PHP. From your shell do php -v.. is this also PHP 5.2.0? (cli) or (cgi) ?

I ran make tr.po in core/po dir successfully, with PHP 4.4.4-9(cli) and PHP 5.2.3(cli).

 
katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Sat, 2007-09-01 19:54

php -v says:
PHP 5.2.0 with Suhosin-Patch 0.9.6.1 (cli) (built: Jul 30 2007 15:36:02)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
with Suhosin v0.9.10, (C) Copyright 2006, by Hardened-PHP Project

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2007-09-01 21:06

If you have another php version you can try, it would be worth a check. Or if you would like to PM me temporary shell access to your server, I can login and debug the problem.

 
katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Sun, 2007-09-02 09:08

Sorry - I suddenly remembered http://gallery.menalto.com/node/8742

It's an php5 related issue still not being fixed (see http://bugs.php.net/bug.php?id=18556)

In turkish there are two different letters (small/capital): i/İ and ı/I
and the conversion of for example classnames with a capital I in their name seems still not to be handled correctly in latest php5...

:-(

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2007-09-02 15:58

Hm.. I still couldn't see any error with PHP5.2.3 after setting LANG env var to tr_TR.UTF-8 (setlocale() in php code confirmed this locale is selected when extract.php runs). Also, there are no classes in extract.php so that particular bug doesn't apply.. but it could be something related.

Can you select a different locale in your shell before running 'make' and see if that helps?

 
katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Sun, 2007-09-02 17:35

There are other bugs related to tr_TR, for example http://bugs.php.net/search.php?cmd=display&search_for=tr_TR&x=0&y=0
No difference with LANG=de_DE.UTF8 - same messages.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2007-09-02 21:41

Ok. I can't do anything more without seeing the problem.. good luck!

 
katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Mon, 2007-09-03 10:40

Ok, I'll stay put in #gallery-support...

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2007-09-03 15:13

(my offer to debug on your system still stands..)

 
katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Tue, 2007-09-04 19:18

... do you read your PM?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2007-09-04 19:55

yes. don't have time for remote debugging, i'm afraid. if you can debug and find out what strings are being eval'ed to generate those errors, that would be a start.

 
katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Wed, 2007-09-05 07:15

ok.
I've set setDebug('buffered') and got this output when switching lamguage to turkish:

Fatal error: Call to undefined method CoreModule::setId() in /srv/www/htdocs/gallery2/modules/core/module.inc on line 32

No output in Smarty Debug window at all.

Same error in forum http://gallery.menalto.com/node/53921 with no answer (writer turkish). When searching with Google for "Fatal error: Call to undefined method CoreModule" there are only 4 links coming up, 2 in gallery and 2 abroad (turkish sites); one site seems to be down, the other shows a german interface (my kde is german)

Is there a way to debug that error further on?

I get mad about this! >-(

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2007-09-05 17:54

Sorry, all we can recommend is to use PHP 4.x.
See: http://bugs.php.net/bug.php?id=35050#c105582
(which is linked from our http://codex.gallery2.org/Gallery2:Known_Issues page)

 
katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Wed, 2007-09-05 19:22

I somehow expected that answer... :-/

Please show me
the way
to the next
whisky bar
Oh don't ask why
Oh don't ask why
...

 
katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Fri, 2007-09-07 09:49

Well I can be stubborn... ;-)

Please see again

  1. I wrote to news.php.net and got this got this answer: http://news.php.net/php.general/261773
  2. I had a look at the patch under http://www.topolis.lt/php/#35050 and saw it did not work for my system
  3. I wrote to the author of the patch and got this answer:
    Quote:
    Patch is written for PHP 5.2.5-dev. It should work in 6.0-dev and PHP
    5.2.1 or later version. Any version later than 2006-12-05.

    and

    Quote:
    If you need workaround, just set LC_CTYPE locale to C. It also deals with
    programming mistakes in PHP scripts.

    ---
    setlocale(LC_ALL,'tr_TR.UTF-8');
    setlocale(LC_CTYPE, 'C');

  4. I searched for LC_ALL under G2 tree and found one occurence in modules/core/classes/GalleryTranslator.class I added a line under it and finally was able to open the gallery with turkish interface:
    --- GalleryTranslator.class	
    +++ GalleryTranslator.class	
    @@ -304,6 +304,7 @@
     	    putenv("LANGUAGE=${languageCode}");
     
     	    GalleryTranslator::_setlocale(LC_ALL, $languageCode);
    +	    GalleryTranslator::_setlocale(LC_CTYPE, 'C');
     	}
     
     	$this->_languageCode = $languageCode;

    The only thing is: I do not know if and where I need to set LC_CTYPE somewhere to get the make tr.po and make install PO=tr to work.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2007-09-08 17:27

you can set it in your environment before you run make, or you can add it to lib/tools/po/extract.php

 
katpatuka
katpatuka's picture

Joined: 2007-01-26
Posts: 35
Posted: Sat, 2007-09-15 19:18

Still didn't work...

Nonethless I decided not to care about that anymore, updated my system to php5.2.4, finished working on the tr.po files and sent them to sourceforge

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2007-09-16 04:19

great, thanks!!