Page 1 of 2

Adding Custom Words to Language Files

Posted: Wed Jul 29, 2009 5:20 pm
by Seraphic
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?

Re: Adding Custom Words to Language Files

Posted: Wed Jul 29, 2009 5:30 pm
by daroPL
Looks good. Can you show me where you put the code in en/common.php?

Re: Adding Custom Words to Language Files

Posted: Wed Jul 29, 2009 5:33 pm
by Seraphic
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

Re: Adding Custom Words to Language Files

Posted: Wed Jul 29, 2009 6:06 pm
by Seraphic
Are you still online?

Re: Adding Custom Words to Language Files

Posted: Wed Jul 29, 2009 8:10 pm
by Seraphic
Guess not. So did he mean I added it in the wrong location the en/common.php file?
Where should it be added?

Re: Adding Custom Words to Language Files

Posted: Wed Jul 29, 2009 8:42 pm
by daroPL
/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?

Re: Adding Custom Words to Language Files

Posted: Wed Jul 29, 2009 8:45 pm
by Seraphic
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?

Re: Adding Custom Words to Language Files

Posted: Wed Jul 29, 2009 9:42 pm
by camm15h
Seraphic, please bear in mind there is a 6 hour bump limit.
You don't need to reply to this post.

Re: Adding Custom Words to Language Files

Posted: Thu Jul 30, 2009 12:26 am
by Seraphic
Could anyone help me square this away? I don't want to have to add the word "Status" in the template itself.

Re: Adding Custom Words to Language Files

Posted: Thu Jul 30, 2009 12:30 am
by stevemaury
You again bumped this before 6 hours. Please don't.

Re: Adding Custom Words to Language Files

Posted: Thu Jul 30, 2009 5:56 am
by Seraphic
Alright, made it to the magic six hour mark and was hoping someone would have offered some help.

Re: Adding Custom Words to Language Files

Posted: Thu Jul 30, 2009 2:54 pm
by Seraphic
Could someone offer some help here? :|

Re: Adding Custom Words to Language Files

Posted: Thu Jul 30, 2009 4:04 pm
by ChriZathens
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',

Re: Adding Custom Words to Language Files

Posted: Thu Jul 30, 2009 4:13 pm
by Seraphic
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}

Re: Adding Custom Words to Language Files

Posted: Thu Jul 30, 2009 4:53 pm
by DavidIQ
Try purging your cache or try putting it in your language's viewforum.php file.