Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Elgg 1.8 Social Networking

You're reading from   Elgg 1.8 Social Networking Create, customize, and deploy your very own social networking site with Elgg with this book and ebook

Arrow left icon
Product type Paperback
Published in Feb 2012
Publisher Packt
ISBN-13 9781849511308
Length 384 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Cash Costello Cash Costello
Author Profile Icon Cash Costello
Cash Costello
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Elgg 1.8 Social Networking
Credits
Foreword
About the Author
About the Author of 1st edition
About the Reviewers
www.PacktPub.com
Preface
1. Social Networking and Elgg FREE CHAPTER 2. Installing Elgg 3. A Tour of Your First Elgg Site 4. Sharing Content 5. Communities, Collaboration, and Conversation 6. Finding and Using Plugins 7. Creating Your First Plugin 8. Customization through Plugins 9. Theming Elgg 10. Moving to Production Developer's Quick Start Guide Views Catalog Index

Lesson 1: Changing wording


This lesson expands your knowledge of Elgg's language system.

Problem

There is wording that you want to change. Elgg says 'comments', but you prefer 'responses'. Elgg says 'Register', but you prefer 'Sign up'. You may think that those changes involve editing lots of files, but the solution is much easier than that.

Solution

Remember the elgg_echo() function from last chapter that mapped strings such as 'hello:world' to the proper phrase in the user's language ("Hello, World!" in English, "¡Hola, Mundo!" in Spanish, and so on)? Besides providing translations, we can also take advantage of elgg_echo() to easily change wording. We do this by overriding the language mapping using a plugin.

Example

In this example, we will change the 'comment' language to 'response' language so that instead of displaying Post comment after a blog post like in the following screenshot:

It will display Post a response like the following screenshot:

Step 1: Create the plugin structure

Just as we...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image