Override system messages

Permalink
Scenario - you're a user registering with a site someone built in C5... you go to register a new account but something distracts you, e.g. phone call, boss, etc. You come back to your registration and complete the form and hit enter you see this:

Invalid token

What does this mean to you? Absolutely stuff all. Perhaps you think the site is broken and you don't bother to register or perhaps you then raise a support ticket/email and waste someone's time - not sure which is worse for the Co. running the site.

How do you override these messages? I know they're output as e,g, t('Invalid token') so is there a way to override the language lookup without having to create a damned language pack for one or two phrases?

TBH 'Invalid token' should just be changed to a meaningful call to action that makes sense to as many people as possible but that's not going to happen quickly unless someone already happens to be on it, so.... suggestions?

surefyre
 
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi surefyre,

I believe you can override register.php and customize the invalid token error.
https://github.com/concrete5/concrete5/blob/develop/concrete/control...
surefyre replied on at Permalink Reply
surefyre
Yeah, overriding whole controllers just to change a line of text seems somehow wrong to me, although I take your point and it's my last resort option.

Feels like using InDesign to leave a postit note :)
surefyre replied on at Permalink Reply
surefyre
Another case in point - the IP Blacklist message. It's in /src so the actual file can't be overridden according to the Override article as /src is non-overridable ?
surefyre replied on at Permalink Reply
surefyre
Another case in point - the IP Blacklist message. It's in /src so the actual file can't be overridden according to the Override article as /src is non-overridable ?
JohntheFish replied on at Permalink Reply
JohntheFish
You can sometimes play tricks using a language file. Set up a language file for US with a 'translation' for the system message you want to override.
surefyre replied on at Permalink Reply
surefyre
Hiya John, yes I was actually considering getting the current en_gb mo, decompiling it to a po then editing it with the messages we want then recompiling the en_gb (or maybe an alternate) mo file and putting that in.

Seriously though, it's like using Jupiter to crack an egg... is there not some easier method that could be implemented going forward perhaps?
JohntheFish replied on at Permalink Reply
JohntheFish
For 'Invalid Token' you could have a problem. Its used all over the place. Which takes you back to overriding or hacking the core.....