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?
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?
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 :)
Feels like using InDesign to leave a postit note :)
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 ?
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 ?
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.
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?
Seriously though, it's like using Jupiter to crack an egg... is there not some easier method that could be implemented going forward perhaps?
For 'Invalid Token' you could have a problem. Its used all over the place. Which takes you back to overriding or hacking the core.....
I believe you can override register.php and customize the invalid token error.
https://github.com/concrete5/concrete5/blob/develop/concrete/control...