#6742 closed enhancement (fixed)
Add hook for translating English
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | I18N | Keywords: | has-patch |
Focuses: | Cc: |
Description
I want to be able to make __('foo')
return bar
, even if the blog is in English. If WordPress is in any other language besides English, I think you can just use the "gettext" filter to do this. However, my blog is in English, so you can't.
Attached patch adds a backwards compatible pre-translating hook for allowing plugins to switch phrases before they are translated.
It also passes the domain to "gettext" filter for the hell of it.
Attachments (1)
Change History (8)
#2
@
15 years ago
- Milestone 2.6 deleted
- Resolution set to invalid
- Status changed from new to closed
Agreeing with Westi here. Nothing forces you not to use English in translation files. Since there's no response I'll presume that you've tried this method and been successful. Please let us know if there's problems with this approach though.
#3
@
15 years ago
- Milestone set to 2.7
- Resolution invalid deleted
- Status changed from closed to reopened
Sorry, seemed to be missed westi's response.
I'm talking about a plugin here, not my own personal blog.
However, I honestly can't remember what I was trying to do at the time. I think I was trying to use the default widgets page for managing the dashboard and didn't want to use an output buffer.
So yeah, reopening for feedback, but not hard set on wanting it as I can just use an output buffer to modify strings. Still though, having a pre-filter much like you can do with get_option()
would be handy and I don't see any harm except maybe extra CPU cycles.
#5
@
15 years ago
- Priority changed from lowest to normal
- Severity changed from trivial to normal
I have wanted this on a few occasions too, so as to avoid output buffering to change strings without filters such as the comments page header.
PLEASE include this, I've been wanting it for ages! :)
Can you not create a translation file even for an English blog.
i.e set WP_LANG to en_Viper and have a en_Viper.mo file.