Starting from version 5.6.2, the localization support of concrete5 has been greatly improved.
From this version, besides having localized block type names, we have also the following items localized:
- Attribute names (for instance, the
Width
file attribute, theExclude From Nav
page attribute or theI would like to receive private messages
user attribute) - Attribute set names (for instance, the
Navigation and Indexing
set of the page attributes) - Attribute type names (for instance,
Text Area
orNumber
) - Permission names (for instance, the
View Versions
or theSearch Files in File Manager
permissions) - Permission descriptions (for instance,
Can access the file manager
) - Types of access entities (for instance,
Group
,User
,Group Combination
) - Job set names (for instance,
Default
)
If you develop a package that creates new values for those items, or if your package needs to show the translation of those values, you should not use the t()
function.
To avoid ambiguity (for instance, Set
has a tons of meanings, so it has a tons of possible translations), those texts are associated to translation contexts (to see what they are see the Internationalization and the t() functions family how to).
Here's the list of those contexts and how to use them.
Names of attributes
The context for the names of the attributes is AttributeKeyName, so you have to write:
tc('AttributeKeyName', 'Attribute name')
Names of attribute sets
The context for the names of the attribute sets is AttributeSetName, so you have to write:
tc('AttributeSetName', 'Attribute set name')
Names of attribute types
The context for the names of the attribute types is AttributeTypeName, so you have to write:
tc('AttributeTypeName', 'Attribute type name')
Names of permissions
The context for the names of the permissions is PermissionKeyName, so you have to write:
tc('PermissionKeyName', 'Permission name')
Descriptions of permissions
The context for the descriptions of the permissions PermissionKeyDescription, so you have to write:
tc('PermissionKeyDescription', 'Permission description')
Names of access entity types
The context for the names of the access entity types is PermissionAccessEntityTypeName, so you have to write:
tc('PermissionAccessEntityTypeName', 'Access entity type name')
Names of job sets
The context for the names of the job sets is JobSetName, so you have to write:
tc('JobSetName', 'Job set name')