Changing the terminology used in Craft CMS
Coming to Craft CMS, one of the first things you notice is it’s interesting choice of words for describing things in the CMS. Such as…
- Entries
- Globals
- Singles
- Structures
- Channels
A developer can quickly piece together what they mean by intuition or by checking the documentation. However for your clients, who may or may not be technically savy, it can be a huge barrier to getting to grips with your CMS.
So to combat this, Craft allows you to translate it’s default vocabulary to one that you believe your client will understand.
Craft 2 #
As the guys at Mijingo describe in this great video, in Craft 2 you first create the directory craft/translations/
and create a php file which matches your locale. For example, if I’m creating a website for a UK company I will create the file craft/translations/en_gb.php
. This file just returns a string-to-string associative array that maps default CMS strings to new ones.
Craft 3 #
In Craft 3, things are a little bit different. You still create the craft/translations/
directory, but instead of creating an en_gb.php
file, you create subfolders that are named after the translation locale with an app.php
file inside, e.g. craft/translations/en-GB/app.php
. Note that the names of locales are a bit different in Craft 3, so instead of en_gb
it would be en-GB
. You can double the exact format by going to Settings > Sites
in your CMS admin settings.
So we’ve created craft/translations/en-GB/app.php
, now we add our string-to-string array that maps old strings to new ones.
Entries to Content #
A common word that causes confusion in Craft is Entries, the area of the CMS where you edit what’s shown on the front-end of your site. I tend to prefer the word Content, because it’s the kind of language that clients talk in. To change Entries/Entry to Content across the CMS, you have to add slightly different things depending on what Craft version you’re using. This is because of the different text used between versions.
For Craft 2, add the following to craft/translations/en_gb.php
:
<?php
return array(
'Add an entry' => 'Add content',
'All entries' => 'All content',
'Are you sure you want to delete the selected entries?' => 'Are you sure you want to delete the selected content?',
'Are you sure you want to delete this entry?' => 'Are you sure you want to delete this content?',
'Are you sure you want to delete “{name}” and all entries that use it?' => 'Are you sure you want to delete “{name}” and all content that uses it?',
'Are you sure you want to delete “{name}” and all its entries?' => 'Are you sure you want to delete “{name}” and all its content?',
'Couldn’t delete entry.' => 'Couldn’t delete content.',
'Couldn’t revert entry to past version.' => 'Couldn’t revert content to past version.',
'Couldn’t save entry type.' => 'Couldn’t save content type.',
'Couldn’t save entry.' => 'Couldn’t save content.',
'Create a new child entry' => 'Create new child content',
'Create a new entry' => 'Create new content',
'Create a new {section} entry type' => 'Create a new {section} content type',
'Create entries' => 'Create content',
'Default Entry Status' => 'Default Content Status',
'Delete entries' => 'Delete content',
'Delete other authors’ entries' => 'Delete other authors’ content',
'Edit entries' => 'Edit content',
'Edit entry' => 'Edit content',
'Edit entry type' => 'Edit content type',
'Edit entry types ({count})' => 'Edit content types ({count})',
'Edit other authors’ entries' => 'Edit other authors’ content',
'Enable versioning for entries in this section?' => 'Enable versioning for content in this section?',
'Entries' => 'Content',
'Entries deleted.' => 'Content deleted.',
'Entries in this section have their own URLs' => 'Content in this section have their own URLs',
'Entry deleted.' => 'Content deleted.',
'Entry reverted to past version.' => 'Content reverted to past version.',
'Entry saved.' => 'Content saved.',
'Entry Template' => 'Content Template',
'Entry Type' => 'Content Type',
'Entry type saved.' => 'Content type saved.',
'Entry Types' => 'Content Types',
'Entry URL Format' => 'Content URL Format',
'How you’ll refer to this entry type in the templates.' => 'How you’ll refer to this content type in the templates.',
'Link to an entry' => 'Link to content',
'New entry' => 'New content',
'Nested Entries' => 'Nested Content',
'New entry type' => 'New content type',
'New {section} content' => 'New {section} content',
'No entries exist yet.' => 'No content exists yet.',
'No entry exists with the ID “{id}”.' => 'No content exists with the ID “{id}”.',
'No entry type exists with the ID “{id}”.' => 'No content type exists with the ID “{id}”.',
'No entry types are available for this entry.' => 'No content types are available for this content.',
'No entry types exist for this section.' => 'No content types exist for this section.',
'Post a new {section} entry' => 'Post new {section} content',
'Publish live changes for other authors’ entries' => 'Publish live changes for other authors’ content',
'Recent Entries' => 'Recent Content',
'Recent {section} Entries' => 'Recent {section} Content',
'Resaving {section} entries' => 'Resaving {section} Content',
'Revert entry to this version' => 'Revert content to this version',
'Save as a new entry' => 'Save as new content',
'Section and entry locale targeting' => 'Section and content locale targeting',
'The template to use when an entry’s URL is requested.' => 'The template to use when a piece of content’s URL is requested.',
'The template to use when the entry’s URL is requested.' => 'The template to use when a piece of content’s URL is requested.',
'Top-Level Entries' => 'Top-Level Content',
'View entry' => 'View content',
'What the auto-generated entry titles should look like. You can include tags that output entry properties, such as {ex}.' => 'What the auto-generated entry titles should look like. You can include tags that output content properties, such as {ex}.',
'What the entry URI should be.' => 'What the content URI should be.',
'What the entry URLs should look like. You can include tags that output entry properties, such as {ex1} or {ex2}.' => 'What the content URLs should look like. You can include tags that output content properties, such as {ex1} or {ex2}.',
'What this entry type will be called in the CP.' => 'What this content type will be called in the CP.',
'Which locales should entries in this section target?' => 'Which locales should content in this section target?',
'Which section do you want to publish entries to?' => 'Which section do you want to publish content to?',
'Which section do you want to pull recent entries from?' => 'Which section do you want to pull recent content from?',
'Which type of entries do you want to publish?' => 'Which type of content do you want to publish?',
'{section} Entry Types' => '{section} Content Types',
);
For Craft 3, add the following to craft/translations/en-GB/app.php
:
return [
'All entries' => 'All content',
'Are you sure you want to delete the selected entries?' => 'Are you sure you want to delete the selected content?',
'Are you sure you want to delete “{name}” and all entries that use it?' => 'Are you sure you want to delete “{name}” and all content that use it?',
'Are you sure you want to delete “{name}” and all its entries?' => 'Are you sure you want to delete “{name}” and all its content?',
'Create entries' => 'Create content',
'Delete entries' => 'Delete content',
'Delete other authors’ entries' => 'Delete other authors’ content',
'Edit entries' => 'Edit content',
'Edit other authors’ entries' => 'Edit other authors’ content',
'Enable versioning for entries in this section?' => 'Enable versioning for content in this section?',
'Entries' => 'Content',
'Entries deleted.' => 'Content deleted.',
'No entries exist yet.' => 'No content exist yet.',
'Publish live changes for other authors’ entries' => 'Publish live changes for other authors’ content',
'Recent Entries' => 'Recent Content',
'Recent {section} Entries' => 'Recent {section} Content',
'Resaving {section} entries' => 'Resaving {section} content',
'Which section do you want to publish entries to?' => 'Which section do you want to publish content to?',
'Which section do you want to pull recent entries from?' => 'Which section do you want to pull recent content from?',
'Which type of entries do you want to publish?' => 'Which type of content do you want to publish?',
'Leave blank if entries don’t have URLs' => 'Leave blank if content doesn’t have URLs',
'Resaving {type} entries' => 'Resaving {type} content',
'Add an entry' => 'Add content',
'Are you sure you want to delete this entry?' => 'Are you sure you want to delete this content?',
'Couldn’t delete entry.' => 'Couldn’t delete content.',
'Couldn’t revert entry to past version.' => 'Couldn’t revert content to past version.',
'Couldn’t save entry type.' => 'Couldn’t save content type.',
'Couldn’t save entry.' => 'Couldn’t save content.',
'Create a new child entry' => 'Create new child content',
'Create a new entry' => 'Create new content',
'Create a new {section} entry type' => 'Create a new {section} content type',
'Edit entry' => 'Edit content',
'Edit entry type' => 'Edit content type',
'Edit entry types ({count})' => 'Edit content types ({count})',
'Entry Type' => 'Content Type',
'Entry Types' => 'Content Types',
'Entry deleted.' => 'Content deleted.',
'Entry reverted to past version.' => 'Content reverted to past version.',
'Entry saved.' => 'Content saved.',
'Entry type saved.' => 'Content type saved.',
'How you’ll refer to this entry type in the templates.' => 'How you’ll refer to this content type in the templates.',
'Link to an entry' => 'Link to content',
'No entry types exist for this section.' => 'No content types exist for this section.',
'Post a new {section} entry' => 'Post new {section} content',
'Revert entry to this version' => 'Revert content to this version',
'Save as a new entry' => 'Save as new content',
'View entry' => 'View content',
'What the auto-generated entry titles should look like. You can include tags that output entry properties, such as {ex}.' => 'What the auto-generated content titles should look like. You can include tags that output content properties, such as {ex}.',
'What the entry URI should be.' => 'What the content URI should be.',
'What this entry type will be called in the CP.' => 'What this content type will be called in the CP.',
'{section} Entry Types' => '{section} Content Types',
'Entry' => 'Content',
'New {section} entry' => 'New {section} content',
'New entry' => 'New content',
'New entry type' => 'New content type',
'Entry URI Format' => 'Content URI Format',
'Which template should be loaded when an entry’s URL is requested.' => 'Which template should be loaded when content’s URL is requested.',
'What entry URIs should look like for the site.' => 'What content URIs should look like for the site.'
];
Now if you go to your CMS in a new window, you should see that all the copy referring to Entries and Entry magically changes to Content.
Yay Craft!
To see what other text is available to change, for Craft 2 open your project and have a look in craft/app/translations/
, for Craft 3 have a look at the Craft GitHub.
Hi, I'm Joe Forshaw.
I'm a Software Developer from Lancashire in the UK.
For news about my posts and things I'm working on follow me on Twitter.