PDA

View Full Version : [How?] Replace default phrase with mod/plugin


Stagehandspace
04-19-2009, 01:16 AM
Title says it all really...I'm creating a mod but want to replace a default phrase with my own, how can I do this using the mods xml file rather then user having to do it manually from admincp phrase manager?

I tried adding the phrase to my mod:
<phrases>
<phrasetype name="GLOBAL" fieldname="global">
<phrase name="Original phrase" date="xxxxxxxxx" username="xxxxxx" version="x.x"><![CDATA[My replacement]]></phrase>
</phrases>
</phrasetype>

and ticked the overwrite box when installing mod xml but to no avail.

Also what would the uninstall code be if user was to uninstall the mod so phrase would go back to default?

Dismounted
04-19-2009, 05:22 AM
You shouldn't (and can't, as you've found out) do that. If you need to use a phrase slightly differently - create your own.

Actually, you can do it, but that requires editing the database and rebuilding the language.g\

Stagehandspace
04-21-2009, 10:56 AM
...If you need to use a phrase slightly differently - create your own.


Ok so how do I do this so that my phrase will "be in place" of the old phrase without having to manaully do it via admincp variable manager?

please show demo code!

Dismounted
04-22-2009, 07:09 AM
My meaning of that sentence is about using phrases in your own product - it looks like you're talking about things in default templates. For that, you can add a translation of the phrase.