Translate without gettext support

Jakadinho

Joined: 2008-08-25
Posts: 7
Posted: Mon, 2008-08-25 13:26

I dont have gettext support becouse its not my server and i dont think they would reconfigure PHP just becouse of this.

I would like to know if there is any chance that i can translate default language witch is English now (for all users) into something else?

i dont wont to add another language. I just want to change the existing one. Is this possible??

THX for the help.

 
iNDigo_Child

Joined: 2008-08-25
Posts: 2
Posted: Mon, 2008-08-25 15:21

1. Download this: http://upgradephp.berlios.de/
2. Put everything from the ZIP file to your server (gallery2/lib/upgradephp/...directory upgradephp needs to be created)
3. Put this text in the config.php file: include "lib/upgradephp/ext/gettext.php";...anywhere between <?php and ?>...I've put it in a new line just before the ?> (on the end of the page)and it works like a charm.
4. Go to your Gallery2 Admin Page and see if you can change the language.

Greetings from Slovenia ;)

 
Jakadinho

Joined: 2008-08-25
Posts: 7
Posted: Mon, 2008-08-25 19:44

Thx alot. I dindn't imagine the solution could be so easy.

(Ali po naše 100x bohlonej :))

 
Jakadinho

Joined: 2008-08-25
Posts: 7
Posted: Tue, 2008-08-26 20:43

Now I have another trouble. When i change a language (i tried alot of them) nothing happened.
I checked around and it seems my server doesnt have locales installed

I woluld like to know how can i edit the default (English) translation. Even without gettext support gallery is in English so i think there should be an option so i can somehow edit it.

I only need one working language so why not edit the default one ?

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Tue, 2008-08-26 20:53

Hi,

that is theoretically possible, but not practically.

The translation system works like this (in simple words):
Code code print gettext("english word") code code code

The a parser looks for every appearance of the gettext function and extracts the content and put it in a separate file.
In the example its "english word".
You can now translate it in that file and PHP will change the english text to the translated text.
If no translation is present, or gettext does not work, then the original text is used.

So there is no english text file.
The code is english..

I suggest you ask your hoster to install PHP with gettext, or even some locales.
They are easy to install and absolutely no security risc.

Jens
--
Last Gallery v1 Developer.
Tryout the TEST-Version of Gallery 1.6

 
Jakadinho

Joined: 2008-08-25
Posts: 7
Posted: Tue, 2008-08-26 22:34

Thx for the reply.

I thought answer may be like this.
I started to translate the original code since I only want to make few language changes.

Maybe it sounds silly but for me its the easyest solution

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Tue, 2008-08-26 22:44

You really should NOT do that.

Why? I did that for G1 in 2003 end how did i end up?

_I_ wrote the G1 gettext code and became a team member *g*

Jens
--
Last Gallery v1 Developer.
Tryout the TEST-Version of Gallery 1.6

 
Jakadinho

Joined: 2008-08-25
Posts: 7
Posted: Tue, 2008-08-26 23:06

I was just looking the code and i see that it might be to much for me. Editing theme code was easy but the core itself not so much.

So what do i need to do now?

Should i ask for locales only or gettext also. I dont know if this upgradephp script is OK or i causing me trouble so i cant see translation

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Tue, 2008-08-26 23:20

Ask for both.
But focus on the locales.

The upgradephp is okay, its just slower then the original PHP gettext and it might have problems with some plural forms.
Which language do you speak/want?

Jens
--
Last Gallery v1 Developer.
Tryout the TEST-Version of Gallery 1.6

 
Jakadinho

Joined: 2008-08-25
Posts: 7
Posted: Wed, 2008-08-27 09:18

I would like to have gallery in Slovenian language.
I will ask for locales although im quite shure that slovenian locales should be installed (couse admin is slovenian)

thx for the help

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Wed, 2008-08-27 10:38

Slovenian is supported by upgradephp.

Jens
--
Last Gallery v1 Developer.
Tryout the TEST-Version of Gallery 1.6

 
Jakadinho

Joined: 2008-08-25
Posts: 7
Posted: Wed, 2008-08-27 13:53

So this means the only thing i have to do is to ask for locales ?

 
antivirtel

Joined: 2010-05-30
Posts: 1
Posted: Sun, 2010-05-30 18:23

yeah, and Hungarian ? I want to hung. trans., or I can fix it, it will only a single hung. lang. gallery(If I can...)