Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Better differentiation between a PM and an Activity comment?
MasterOne
✭✭
Interestingly my forum members confuse the Message and Add Comment buttons on a member's profile page quite often, which means that a lot of messages meant as PM land on our Activity page.
I'd like to rename the two buttons to something more distinctive, like Send a Private Message and Add a public Activity comment.
I just rgrep'ed through the code, Add Comment only appears once hardcoded in applications/dashboard/views/profile/activity.php
, but was unable to find the Message button (too many "Message" results).
What's best practice to change those two button wordings?
0
Comments
Look at the source of the page and you'll find better strings to look up - for example "SpMessage". That will lead you to that part of code:
echo Anchor(Sprite('SpMessage').' '.T('New Message'), '/messages/add', 'Button NewConversation Primary');
So you have to make a custom translation for 'New Message' in order to change the text of the button
For "Add Comment" you'll find that in the sources:
.Anchor(T('Activity.Comment', 'Comment')
so you have to translate 'Activity.Comment'I have now tried to add the following to
conf/locale.php
:but that did not work, because these two go to different places.
New Message
gets replaced at the top of Inbox in the MeMenu, and I could not find the other one to show up anywhere.Well, I've used this site to look both things up. Use your browser and the "Inspect element" menu entry in the context menu of the browser in order to find meaningful strings that most probably will result in only a few search results. Then search for that text in the vanilla source code. I'll bet you'll find the T('something') that you need.
By the way: maybe you are faster if you search inside of the language file for "Message". There shouldn't be as much hits as in the source code.
Didn't get any closer so far, @R_J, and your mentioning of the language file got me puzzled, because localization is what I was struggling with more than a year ago when I set up our forum:
Additional locale definition files not working?
Problem with "Welcome Aboard" e-mail being empty in 2.1b1?
This may be OT here, but as far as I remember I tried switch from the default locale en-CA to en-US and failed, and I just took a look, in my
locales
folder there is only theskeleton
. Any idea where I can find up-to-date info on localization?Since you shouldn't edit any of the core files, you have to add your own language file. Language files of Vanilla are spread around the applications folder and so it would be easier and more clever to look at any language translation file. It could even be a Chinese language file because you are only interested in the left part of each line. Take a look at what I've found in the German language file when I do a search for "message" (I have done a little sorting already):
See what I mean? You do not have to speak one single word of German because you can understand the term that should be translated
But that's just a workaround. The better way is to find the correct place in Vanilla code. If you do not understand the structure of Vanilla, it is hard to guess where HTML you are looking at has been generated. Searching the source for some unique words that you can see in the HTML source near the word you want to translate is a good trick that will almost always get you to the php file where you can see the text that you want to translate. It will most probably enclosed in the function T(). Some form elements like Label doesn't need that translation function (because their content is always passed through that function) but you will see the text to translate there nevertheless.
And to your ancient problem of multiple definition files: why don't you create as many as you like and make one single "master" definitions.php file where you include all others?