One of the great things about WordPress is that it supports localization, meaning you can alter the text that is displayed to accommodate different languages, etc.
What didn’t occur to me until today is that you can also use this technique if you just want to use different terminology than what WP provides at various places in the user interface. Sure, you could search through all the code and edit text directly, but that leads to a maintenance nightmare because you’d have to do that every time you upgraded. It’s also a lot harder than what I’m about to describe in a few simple steps:
- Install poEdit (open source, available for free on all major platforms)
- Start it up and create a new catalog.
- Enter a project name in the project info tab and then go to the “Paths” tab
- Click new and enter the path to the directory containing your WordPress files
- Go to the “Keywords” tab, and add new entries for “__” (that’s two underscores) and “_e”
- Press OK to save your .po file
- poEdit will scan your files and create a list of all the text entries that you can change.
- Make changes to the text as you desire. (If you were translating to a different language, you’d do that here.) You don’t have to change every entry; it will use what is already there unless you provide a replacement.
- When you save, it will also generate a .mo file with the same name as your .po file.
- Create a “languages” directory under wp-includes.
- Copy the .mo file here, and it will now be available for you to choose as the default language for your site.
One Comment
PS - handy tip: Alt+C (in Linux and probably Windows, or the equivalent for your OS) will copy the existing text into the replacement box, if you’re just making minor edits.