Re: What's the recommended way to override just a couple of language strings?
Reply #3 –
Should be no different for "normal" language strings, those are just $txt[''] = ''; stuff and you can use the same file.
You could also edit the strings from the ACP if wanted, its no different then opening them up in vim and having at it.
Addons.xxxx.php at allows an override (to index.english.php) as its loaded right after index.xxxx.php and you don't have to do anything, but if its some other string outside of index.english.php then that trick is not going to work.
Take a look at simple portal, it uses the integrate_buffer hook (see sources/PortalIntegration.subs.php => sp_integrate_buffer) for one way to manipulate that specific $forum_version line.
Re: What's the recommended way to override just a couple of language strings?
Reply #5 –
I'm responding to the "override" part of your question, you don't seem to be asking how to add a new string but to override an existing one.
To override you need to load your language file, custom or whatever, after the language file that contains the string you want to overwrite and before its used in the templates / sources. The easy one is the index.english with addons.english (and I mentioned that in response to $forum_copyright).
If the string is not in index.english, but instead in one of the obscure language files, then I'm not sure TBH. Its either find where its loaded and add use that controller hook, or maybe there is a hook in the loadlanguage controller that you could use and check if XYZ is being loaded then load your file to replace the strings.
Performance in integrate buffer should not be a concern, its just basic string search and replace that you are doing. Its no more overhead then any other hook in the system.
Re: What's the recommended way to override just a couple of language strings?
Reply #7 –
Someone with a better understanding of how the language fallback works should jump in here since I'm not sure on how that works. Custom templates fall back to the system default, but I don't think language packs work like that.
If you create your own subset language, call it the Frenzie language, it only has a few strings in some of the language files.
You make the default forum language French, but allow Frenzie to be user selectable.
If it does not find the string in Frenzie, I don't think it falls back to check in the French pack instead, but who knows, maybe it does (and if not maybe it should)
Re: What's the recommended way to override just a couple of language strings?
Reply #8 –
Does Elk still support ThemeStrings.***.php? That allows overriding default language strings in SMF, so unless you've changed that code to nobble it the same should apply to Elk..