edit lang file

ramonskil

Joined: 2006-04-12
Posts: 18
Posted: Wed, 2006-04-12 19:37

i have uploaded the dir libs/tools from gallery2-development
to my existing gallery2

i did this because i changed the nl.po file
and then i did

make install po=nl

and i get this result

/bin/sh: line 1: php: command not found
msgfmt: tmp.po: warning: PO file header missing or invalid
warning: charset conversion will not work
msgfmt: found 1 fatal error

what did i do wrong??

plz help me out

greetz
ramonskil

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-04-12 21:44

try:
make install PO=nl
(capitals for PO)

 
ramonskil

Joined: 2006-04-12
Posts: 18
Posted: Thu, 2006-04-13 08:11

still the same problem
but if i PO instead of po

then i only get one of those error if i user po then i got several of the same errors

 
sebmex

Joined: 2006-03-21
Posts: 79
Posted: Thu, 2006-04-13 12:34

I have the same problem here, did you find the solution to that ?

thanks for stopping at my thread for explanation : http://gallery.menalto.com/node/33533

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-04-13 14:40

you need php in your path.

 
ramonskil

Joined: 2006-04-12
Posts: 18
Posted: Thu, 2006-04-13 15:42

what do you mean i need php in my path??

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-04-13 22:02

use google to learn about shell/commandline PATHs

 
ramonskil

Joined: 2006-04-12
Posts: 18
Posted: Fri, 2006-04-14 07:37

lol i know a lil about php en shell command line paths but what do you mean with i need php in my path

when i do make install PO=nl
i need to be in the po dir which i want to change right?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2006-04-14 14:23

yes, you should be in the po dir.
in that dir, type 'php -v'
that must work. ie, you must be able to run php just by typing php, not C:\Path\PHP\bin\php.exe
that's "in your path"

 
ramonskil

Joined: 2006-04-12
Posts: 18
Posted: Fri, 2006-04-14 19:44

i have linux debian installd with apache php4 and several addons and that works fine

 
renmarc

Joined: 2006-04-18
Posts: 3
Posted: Sun, 2006-04-30 20:59

My paths are correct...version is displayed with php -v...but i've always this error:

make install PO=it
Updating it
it
tmp.po:1: parse error
tmp.po:2: la parola chiave "b" è sconoscita
tmp.po: warning: PO file header missing, fuzzy, or invalid
warning: charset conversion will not work
found 3 fatal errors
Fail: it
make: *** [install] Error 1

PS: fuzzy line is removed.

Any help?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-05-01 03:04

make sure you have a valid po header and po tags around that line and the line itself is valid.. can't really tell you more without seeing it.

 
JanP

Joined: 2005-10-05
Posts: 34
Posted: Mon, 2006-05-01 13:46

I'm having trouble as well, I get this message:

[***@server po]# make install PO=nl
Updating nl
nl
PHP Warning: file(nl.po): failed to open stream: No such file or directory in /var/www/html/gallery2/lib/tools/po/trim-po.php on line 42
msgfmt: tmp.po: warning: PO file header missing or invalid
warning: charset conversion will not work
msgfmt: found 1 fatal error
Fail: nl

The only thing I've edited are a couple of translations of EXIF tags (because they were incorrect), so I'm pretty sure the .po is valid.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-05-01 14:25

http://codex.gallery2.org/index.php/Gallery2:Localization

it mentions near the top you need a developer install or nightly snapshot or current svn (these include the lib/tools/po dir).

 
JanP

Joined: 2005-10-05
Posts: 34
Posted: Mon, 2006-05-01 18:10

Well... I HAVE the developer install. So I don't know what's going on. I used to have the "typical" package but that gave a totally different error, so I installed the developer and now I get this.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-05-01 18:42

oops, misread the error.. "nl.po" is the file is didn't find, not trim-po.php as I thought.
cd modules/exif/po
make install PO=nl
this is what you tried? make sure nl.po exists and has correct permissions.

 
JanP

Joined: 2005-10-05
Posts: 34
Posted: Mon, 2006-05-01 18:45

To give you some more info; I'm running this from /var/www/html/gallery2/modules/exif/po
So yeah, that should be the right directory. I've tried chmodding nl.po (it IS present, I can see it perfectly using dir and I can edit it with nano or vi or whatever) to 666 and even 777, but to no avail :( This is really, really weird.

Here, look at my complete console output:

[root@server po]# cd /var/www/html/gallery2/modules/exif/po
[root@server po]# dir
af.po  da.po  en_GB.po  eu.po  ga.po        is.po  ja.po  messages.po  no.po  pt_BR.po  sr.po        sv.po  vi.po     zh_TW.po
cs.po  de.po  es.po     fr.po  GNUmakefile  it.po  lt.po  nl.po        pl.po  ru.po     strings.raw  tr.po  zh_CN.po
[root@server po]# chmod 666 nl.po
[root@server po]# make install PO=nl
Updating nl
nl
PHP Warning:  file(nl.po): failed to open stream: No such file or directory in /var/www/html/gallery2/lib/tools/po/trim-po.php on line 42
msgfmt: tmp.po: warning: PO file header missing or invalid
                warning: charset conversion will not work
msgfmt: found 1 fatal error
Fail: nl
make: *** [install] Fout 1
 
JanP

Joined: 2005-10-05
Posts: 34
Posted: Tue, 2006-05-02 15:06

OK, I've figured it out. I the following console command:

[root@server gallery2]# cp modules/exif/po/nl.po lib/tools/po/

To create a copy of nl.po from the exif directory to the tools directory, and it worked:

[root@server gallery2]# cp modules/exif/po/nl.po lib/tools/po/
[root@server gallery2]# cd modules/exif/po
[root@server po]# make install PO=nl
Updating nl
nl
144 translated messages.

I restart Apache and, it's a miracle, it worked! I don't know if I just overlooked the step "copy the po file from it's modules directory to the lib/tools/po directory", or something like that, but anyway, it worked and I'm really happy with it :)

 
ramonskil

Joined: 2006-04-12
Posts: 18
Posted: Tue, 2006-05-02 16:04

make: *** Geen regel voor het maken van doel `install'. Stop.
i get this error
in english it means
make: *** No rule to create for map `install'. Stop.

 
JanP

Joined: 2005-10-05
Posts: 34
Posted: Tue, 2006-05-02 17:52

Can you post your complete console output? You had a different error when you first started this topic - it was similar to mine, what did you change?

 
ramonskil

Joined: 2006-04-12
Posts: 18
Posted: Tue, 2006-05-02 18:07

if i dit what you did
copied the nl.po to /var/www/gallery2/lib/tools/po

and then i get make: *** Geen regel voor het maken van doel `install'. Stop.

when i try it in the same dir like /var/www/gallery2/moduels/rating/po

then i get

[***@server po]# make install PO=nl
Updating nl
nl
PHP Warning: file(nl.po): failed to open stream: No such file or directory in /var/www/html/gallery2/lib/tools/po/trim-po.php on line 42
msgfmt: tmp.po: warning: PO file header missing or invalid
warning: charset conversion will not work
msgfmt: found 1 fatal error
Fail: nl

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-05-02 22:06

what do you get for php -v ?
you should not have to copy the po file to lib/tools/po. for some reason the current directory when the trim-po.php script runs is lib/tools/po instead of the dir where you ran 'make'.. i'm guessing maybe you're using php-cgi instead of php-cli.. if that's the cause, maybe we can figure out how to make it work for both.

 
ramonskil

Joined: 2006-04-12
Posts: 18
Posted: Wed, 2006-05-03 08:58

yes i have installed php-cgi

 
JanP

Joined: 2005-10-05
Posts: 34
Posted: Wed, 2006-05-03 12:30
mindless wrote:
what do you get for php -v ?
you should not have to copy the po file to lib/tools/po. for some reason the current directory when the trim-po.php script runs is lib/tools/po instead of the dir where you ran 'make'.. i'm guessing maybe you're using php-cgi instead of php-cli.. if that's the cause, maybe we can figure out how to make it work for both.

I don't know what my problem was, but the solution to it was indeed to copy the .po file to the direcotry where trim-po.php is located, as stated above.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-05-03 18:46

neither of you answered my question:

Quote:
what do you get for php -v ?

 
ramonskil

Joined: 2006-04-12
Posts: 18
Posted: Wed, 2006-05-03 21:11

Server2:~# php -v
-bash: php: command not found

this what i get

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-05-03 21:28

uhhh....

 
ramonskil

Joined: 2006-04-12
Posts: 18
Posted: Thu, 2006-05-04 09:57

??? what you mean with uhhh.. something wrong?

keep in mind
i have linux debian no windows
php4, apache 1.3, mysql installed and evrey thing works fine

 
JanP

Joined: 2005-10-05
Posts: 34
Posted: Thu, 2006-05-04 16:06

Sorry, here's my output:

[***@server gallery2]# php -v
PHP 4.3.11 (cgi) (built: Dec  1 2005 18:42:23)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    with eAccelerator v0.9.3, Copyright (c) 2004-2005 eAccelerator, by eAccelerator

So yeah, I guess it's cgi :P

ramonskil wrote:
??? what you mean with uhhh.. something wrong?

keep in mind
i have linux debian no windows
php4, apache 1.3, mysql installed and evrey thing works fine

It means you don't have PHP in your path - you can't execute it from any directory you choose. I don't really know how to fix it though - you could search for it on Google.

 
ramonskil

Joined: 2006-04-12
Posts: 18
Posted: Thu, 2006-05-04 16:27

didnt install php-cgi *dumb*

so i installed it
and it works like a charm :D

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-05-04 18:30

current svn now has a change so it should work with either php-cli or php-cgi.

 
JanP

Joined: 2005-10-05
Posts: 34
Posted: Fri, 2006-05-05 09:06

Nice :)

 
lpa

Joined: 2006-05-18
Posts: 1
Posted: Thu, 2006-05-18 11:21
mindless wrote:
current svn now has a change so it should work with either php-cli or php-cgi.

What were these changese and how can I upgrade my installation to get those changes?

Lauri

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-05-18 14:52

click "downloads" above.. it has info on svn and nightly snapshots.

 
kalev377

Joined: 2006-06-06
Posts: 59
Posted: Fri, 2006-07-28 21:39

Hello,

Please help me with the localization problem, as it seems that noone olse wants to translate Gallery to Estonian...

I had the same "msgfmt: tmp.po: warning: PO file header missing or invalid" error when trying to "make install et.po"
Reading this thread I discovered i had also the php cgi so I used the SVN.
After that the error changed:

[root@must po]# make install PO=et
Updating et
et
PHP Notice:  Use of undefined constant STDERR - assumed 'STDERR' in /home/web/minupildid.ee/g2/lib/tools/po/trim-po.php on line 21
PHP Warning:  fwrite(): supplied argument is not a valid stream resource in /home/web/minupildid.ee/g2/lib/tools/po/trim-po.php on line 21
PHP Notice:  Use of undefined constant STDERR - assumed 'STDERR' in /home/web/minupildid.ee/g2/lib/tools/po/trim-po.php on line 21
PHP Warning:  fwrite(): supplied argument is not a valid stream resource in /home/web/minupildid.ee/g2/lib/tools/po/trim-po.php on line 21
tmp.po:41:10: invalid multibyte sequence
msgfmt: tmp.po: warning: PO file header fuzzy
                warning: older versions of msgfmt will give an error on this
msgfmt: found 1 fatal error
Fail: et
make: *** [install] Error 1
[root@must po]# php -v
PHP 5.0.4 (cgi-fcgi) (built: May 23 2006 14:29:04)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies


Gallery version = 2.2-svn core 1.1.14
PHP version = 5.0.4 apache2handler
Webserver = Apache/2.2.0 (Fedora)
Database = mysql 5.0.22-log, lock.system=flock
Toolkits = Gd, SquareThumb, ImageMagick, NetPBM
Acceleration = full/900, none
Operating system = Linux must.minupildid.ee 2.6.16-1.2122_FC5 #1 Sun May 21 15:01:01 EDT 2006 i686
Default theme = classic
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5

 
kalev377

Joined: 2006-06-06
Posts: 59
Posted: Fri, 2006-07-28 23:48

After translating more strings and trying the "make install PO=et" again, the error changed to this:

[root@must po]# make install PO=et
Updating et
et
PHP Notice:  Use of undefined constant STDERR - assumed 'STDERR' in /home/web/minupildid.ee/g2/lib/tools/po/trim-po.php on line 21
PHP Warning:  fwrite(): supplied argument is not a valid stream resource in /home/web/minupildid.ee/g2/lib/tools/po/trim-po.php on line 21
PHP Notice:  Use of undefined constant STDERR - assumed 'STDERR' in /home/web/minupildid.ee/g2/lib/tools/po/trim-po.php on line 21
PHP Warning:  fwrite(): supplied argument is not a valid stream resource in /home/web/minupildid.ee/g2/lib/tools/po/trim-po.php on line 21
tmp.po:41:10: invalid multibyte sequence
tmp.po:73:16: invalid multibyte sequence
tmp.po:74:16: invalid multibyte sequence
tmp.po:79:16: invalid multibyte sequence
tmp.po:80:16: invalid multibyte sequence
tmp.po:83:11: invalid multibyte sequence
tmp.po:110:10: invalid multibyte sequence
tmp.po:113:25: invalid multibyte sequence
tmp.po:113:26: invalid multibyte sequence
tmp.po:117:10: invalid multibyte sequence
tmp.po:126:10: invalid multibyte sequence
tmp.po:129:10: invalid multibyte sequence
tmp.po:129:21: invalid multibyte sequence
tmp.po:138:10: invalid multibyte sequence
tmp.po:141:10: invalid multibyte sequence
tmp.po:141:14: invalid multibyte sequence
tmp.po:153:28: invalid multibyte sequence
tmp.po:165:33: invalid multibyte sequence
tmp.po:171:17: invalid multibyte sequence
tmp.po:174:23: invalid multibyte sequence
msgfmt: too many errors, aborting
Fail: et
make: *** [install] Error 1

Can you help?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2006-07-29 01:36

ah, warning output from that script only worked with PHP CLI, not CGI. i have committed an update that should fix this. update from svn or get tomorrow's nightly snapshot.

 
kalev377

Joined: 2006-06-06
Posts: 59
Posted: Sun, 2006-07-30 10:39

Hello again, thanks mindless, updating the svn worked fine, the errors are gone.
Unfortunately the translation does not work :(

I did it like this:

in /home/web/minupildid.ee/g2/modules/core/po/

i executed "make et.po", then changed header to:

"Project-Id-Version: Gallery: 2.2-svn core 1.1.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-07-28 23:27+0300\n"
"PO-Revision-Date: 2006-07-30 13:03+0300\n"
"Last-Translator: poromaan <poromaan@gmail.com>\n"
"Language-Team: Estonian <poromaan@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

then translated some of the file, then did:

[root@must po]# make install PO=et
Updating et
et
6 translated messages, 929 untranslated messages.

Then added to /home/web/minupildid.ee/g2/modules/core/classes/GalleryTranslator.class between other language lines the lines:

            /* Estonian */
            $supportedLanguages['et']['ET']['description'] = 'Eesti';
            $defaultCountry['et'] = 'ET';

And changed in the web page the language to "Eesti".

But nothing happens.. Everything is still in English...
Do I have to restart the server or something else?
Have i forgotten anything?

Your help is much appreciated..

 
kalev377

Joined: 2006-06-06
Posts: 59
Posted: Sun, 2006-07-30 11:46

restarting httpd had no effect. restarting the server had no effect either...

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-07-30 15:18

did you select the new language? either edit your user account (Your Account or in site admin/users) or add the Language Selector block to your theme.

 
kalev377

Joined: 2006-06-06
Posts: 59
Posted: Mon, 2006-07-31 06:21

Yes, I tried both ways, I have language selector on my main page sidebar and I changed the language in my account settings too..

Everything I have read about the translations says that I should be set to go.. :(

 
kalev377

Joined: 2006-06-06
Posts: 59
Posted: Mon, 2006-07-31 19:10

Maybe the only way to go is to submit the half-translated file and to get it with the svn update?
I have currently 445 translated messages, 481 untranslated messages.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-08-01 14:48

you're welcome to submit something.. i don't know why you aren't able to see the translation.

 
kalev377

Joined: 2006-06-06
Posts: 59
Posted: Wed, 2006-08-02 18:23

So..
I submitted a few Estonian language po files and they were integrated..
After "svn update" and "httpd restart" nothing happened.. everything is still in English while the language selector is on Eesti.
Tried even changing the language to something else first and then to "Eesti", but no effect...
Does it work for anyone else?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-08-02 21:41

oops, I put the wrong country code in GalleryTranslator.class... fixed now in svn, and I see the et translations ok.

 
kalev377

Joined: 2006-06-06
Posts: 59
Posted: Thu, 2006-08-03 04:07

Yeeeehhaaaaa!

After another svn update I had two "Eesti" in the css file, one didn't work(the one I entered) and one worked fine(yours), so I deleted mine:)
I can now see my translations right after make install PO=et

Thank you mindless :)