News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Renaming Item in Main menu

Started by Krimm, October 24, 2010, 12:12:19 AM

Previous topic - Next topic

Krimm

SMF Version -- 2.0 RC3
Theme -- Impulse 2

Alright, so I've yet another question for the amazing SMF Support forum! Essentially I've searched on how to rename certain items throughout the forum and for the most part, its served its purpose. I renamed Sub-Forums to Sub-Boards and I found out I could edit any Menu Item I wanted...except My Messages. I've recently attained Filezilla (lolfinally) and am now able to access of the pages and whatnot. Essentially, I'd just like to know how I can rename "My Messages" to "Inbox".

Any and all help is appreciated!

Joker™

Sources/Subs.php

change txt string here
'title' => $txt['pm_short'],


Replace that string with your own string and define a new one in
themes\default\languages\Modifications.english.php
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Krimm

Well that's a start but would you be a bit more specific on what I should input? @ @ I'm clueless when it comes to php unfortunately and I'm only beginning to learn Java. Sorry XD

Joker™

Like for example, change things like this,

Source\Subs.php
Find:

'title' => $txt['pm_short'],


Replace it with:

'title' => $txt['pm_inbox'],


Now open
themes\default\languages\Modifications.english.php

Find:

?>


Add before:
$txt['pm_inbox'] = 'Inbox';


To see the changes clear site cache from here
Administration Center » Forum Maintenance » Routine
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Matthew K.

Code (Find) Select
            'title' => $txt['pm_short'],
Code (Replace) Select
            'title' => 'Your Text',

Krimm

Thanks you guys o:

I did it slightly differently though, which explains why I couldn't get it to work initially. I went to Languages > ThemeStrings.english.php and renamed pm_short to Inbox and it worked XD

I didn't know My Messages was defined as pm_short though e-e

Well that wraps it up, thanks again.

Matthew K.

I'll go ahead and mark topic as resolved then Krimm :)

Glad to see you got it figured out.

Joker™

Quote from: Labradoodle-360 on October 24, 2010, 01:30:15 AM
Code (Find) Select
            'title' => $txt['pm_short'],
Code (Replace) Select
            'title' => 'Your Text',
I think your method will put a hard text in the file which is not recommended.

Quote from: Krimm on October 24, 2010, 01:40:04 AM
I did it slightly differently though, which explains why I couldn't get it to work initially. I went to Languages > ThemeStrings.english.php and renamed pm_short to Inbox and it worked XD
That string "pm_short" maybe used at some other places, so i won't recommend you to change predefined strings at all.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Krimm

hm but isn't it just sort of the same thing as what you're going? pm_short remains the same, however it now displays the string "Inbox".

Basically what I have in ThemeStrings.english.php is:

$txt['pm_short'] = '@Postal';

Won't the variable name, pm_short still be accessible to other codes?

Joker™

Quote from: Krimm on October 24, 2010, 09:49:26 AM
hm but isn't it just sort of the same thing as what you're going? pm_short remains the same, however it now displays the string "Inbox".

Basically what I have in ThemeStrings.english.php is:

$txt['pm_short'] = '@Postal';

Won't the variable name, pm_short still be accessible to other codes?
See what i have learnt so far is that use should create a new string instead of changing original one, as the original string might be used at various places. So sometime it make changes at such places also which you might not like :).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Matthew K.

Yes it does, but why you put strings into language files is so they can be translated. This is mainly a mod standard. And for custom coding, it's not a huge deal to put text in a non-language file.

But yes, the best way is to put it in a language file.
Quote from: Joker™ on October 24, 2010, 03:30:28 AM
Quote from: Labradoodle-360 on October 24, 2010, 01:30:15 AM
Code (Find) Select
            'title' => $txt['pm_short'],
Code (Replace) Select
            'title' => 'Your Text',
I think your method will put a hard text in the file which is not recommended.

Advertisement: