Adding Custom Words to Language Files

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Adding Custom Words to Language Files

Post by Seraphic » Wed Jul 29, 2009 5:20 pm

Hi,

I am trying to add a new word in the forumlist_body.html file.

So in forumlist_body.html added: {L_STATUS}
Then in en/common.php I added: 'STATUS' => 'Status',

Refreshed template, but it just shows as { STATUS }
So I take it I left something out?

User avatar
daroPL
Translator
Posts: 515
Joined: Tue Mar 27, 2007 11:58 am
Location: Poznan, Poland
Name: Darek
Contact:

Re: Adding Custom Words to Language Files

Post by daroPL » Wed Jul 29, 2009 5:30 pm

Looks good. Can you show me where you put the code in en/common.php?

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Re: Adding Custom Words to Language Files

Post by Seraphic » Wed Jul 29, 2009 5:33 pm

daroPL wrote:Looks good. Can you show me where you put the code in en/common.php?
Line 453

After
'STATISTICS' => 'Statistics',
After

'STATUS' => 'Status',

Before
'START_WATCHING_FORUM' => 'Subscribe forum',
Before

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Re: Adding Custom Words to Language Files

Post by Seraphic » Wed Jul 29, 2009 6:06 pm

Are you still online?

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Re: Adding Custom Words to Language Files

Post by Seraphic » Wed Jul 29, 2009 8:10 pm

Guess not. So did he mean I added it in the wrong location the en/common.php file?
Where should it be added?

User avatar
daroPL
Translator
Posts: 515
Joined: Tue Mar 27, 2007 11:58 am
Location: Poznan, Poland
Name: Darek
Contact:

Re: Adding Custom Words to Language Files

Post by daroPL » Wed Jul 29, 2009 8:42 pm

/language/[iso]/common.php is included on all pages, except for the admin pages. So it seems to be odd that the variable doesn't display there, although you correctly added that line.
Maybe did you add that for wrong language pack?

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Re: Adding Custom Words to Language Files

Post by Seraphic » Wed Jul 29, 2009 8:45 pm

Only have one language pack. It was added to: /phpbb3/language/en/common.php
Does it need to go in specific location or is common.php the wrong language file?

User avatar
camm15h
Former Team Member
Posts: 4981
Joined: Wed Jul 30, 2003 1:02 am
Location: Hull, UK
Name: Paul Cammish

Re: Adding Custom Words to Language Files

Post by camm15h » Wed Jul 29, 2009 9:42 pm

Seraphic, please bear in mind there is a 6 hour bump limit.
You don't need to reply to this post.

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Re: Adding Custom Words to Language Files

Post by Seraphic » Thu Jul 30, 2009 12:26 am

Could anyone help me square this away? I don't want to have to add the word "Status" in the template itself.

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50926
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Adding Custom Words to Language Files

Post by stevemaury » Thu Jul 30, 2009 12:30 am

You again bumped this before 6 hours. Please don't.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Re: Adding Custom Words to Language Files

Post by Seraphic » Thu Jul 30, 2009 5:56 am

Alright, made it to the magic six hour mark and was hoping someone would have offered some help.

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Re: Adding Custom Words to Language Files

Post by Seraphic » Thu Jul 30, 2009 2:54 pm

Could someone offer some help here? :|

User avatar
ChriZathens
Registered User
Posts: 1477
Joined: Tue Apr 18, 2006 9:11 pm
Location: Athens, Greece
Name: Chris

Re: Adding Custom Words to Language Files

Post by ChriZathens » Thu Jul 30, 2009 4:04 pm

That's odd...
...have you left a tab space after the lang var and before the =>?
I mean instead of

Code: Select all

'STATUS'=> 'Status',
have it like

Code: Select all

'STATUS'     => 'Status',
My mods in MODDB:
Add Homepage link in header - Change user activity post limit - Post number in viewtopic
If you need support click on the support tab there and post your question.
Do not PM me - chances of viewing my PMs are way thinner than viewing the support question in the customization DB...

Seraphic
Registered User
Posts: 274
Joined: Wed Feb 15, 2006 8:20 am

Re: Adding Custom Words to Language Files

Post by Seraphic » Thu Jul 30, 2009 4:13 pm

I should have used a code tag, it messed it up.

In en/common.php I have:

Code: Select all

    'STATUS'                    => 'Status',
In template/forumlist_body.html I have:

Code: Select all

{L_STATUS}
But all that shows up on forum index is:

Code: Select all

{ STATUS }
Did some searching and found the below. Tried it, but did not work. But maybe because it is for phpbb2 and also because I am not sure if I used the correct language and php file (used en/common.php and index.php).
In your lang_english/lang_main.php:
Code: ‹ Select ›
$lang['books'] = 'Books';
$lang['otherlangvar'] = 'otherword';

In your php file where the menu is at:
Code: ‹ Select › ‹ Expand ›
$template->assign_vars(array(
'L_BOOKS' => $lang['books'],
'L_OTHERLANGVAR' => $lang['otherlangvar']
));

'L_OTHERLANGVAR' => $lang['otherlangvar'] i put in there to show you you can add more vars there.

In your tpl file where the menu is in at the place you want the word Books or Libros to apear:
Code: ‹ Select ›
{L_BOOKS}

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17090
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: Adding Custom Words to Language Files

Post by DavidIQ » Thu Jul 30, 2009 4:53 pm

Try purging your cache or try putting it in your language's viewforum.php file.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

Locked

Return to “[3.0.x] Support Forum”