i18n

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
computergenius
Forum Newbie
Posts: 7
Joined: Sat Feb 19, 2005 2:26 pm
Location: Spain

i18n

Post by computergenius »

I am having problems getting gettext() to work - and I also think that if/when I get it working, I won't be able to use it, as it appears that you have to restart Apache if you change the translations.

So, at the moment, I am just getting the English to appear, not the translation.

And, I wonder if I get it working, if it will work for this project, as it is on shared hosting, and I can't restart Apache.

So, three related questions:
Should I carry on trying to get it to work?
Have I misunderstood the "restart Apache" bit?
Are there alternatives?
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: i18n

Post by Vegan »

can you post some code with what you are trying to do?
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
computergenius
Forum Newbie
Posts: 7
Joined: Sat Feb 19, 2005 2:26 pm
Location: Spain

Re: i18n

Post by computergenius »

I have been giving it some thought, and decided not to use gettext(). There seem to be so many people having problems with it, and many negative comments about it.

I like poedit, so plan to use that to create a .po file. It seems to be easy to use for translators.

But then, I have written a translation file creation script which will read the contents of a .po file, and write it as a json file. Then I can load the json file, and read the translations. Seems to be a quick way to do it.

It has the advantage that my translation file creation script can be instructed to include all standard translations - like menus, which are often the same across the site, and can make small text files, perhaps one for each page, probably one for each group.

But as I never got it to work reliably, I have to ask! Do you REALLY have to restart apache after making changes when using .po and gettext() ?
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: i18n

Post by Vegan »

http://php.net/manual/en/function.gettext.php

the manual is kinda limited for this function
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
computergenius
Forum Newbie
Posts: 7
Joined: Sat Feb 19, 2005 2:26 pm
Location: Spain

Re: i18n

Post by computergenius »

Yes, I have checked the manual, and many other places as well.

No real help, though.
Post Reply