User fields are not translatable by design, see this question:
You're not missing anything; user content is currently not translatable. (It's up to each type of element whether it wants to support translatable content, and we felt that 99% of the time it would not be desirable for users to have translatable profiles.
There's a discussion thread on Github asking for translatable user fields – if you care about this feature, upvote it on Github so it gets some visibility.
As a workaround, move the user fields that need translating out of the user account and into a section. For example, you can create a section userProfiles
and automatically create a new entry in that section for each newly created user account. Assign the new user account as the author of that entry. Then give that user group permission to edit their own entries in that section, but not create new entries or edit other's entries.
This way, the user profile can be translated. Anywhere you want to display the user's profile, simply query for the userProfile
element:
{% set userProfile = craft.entries()
.section('userProfile')
.authorId(user.id)
.one()
%}
If your users only interact with frontend forms, this doesn't change a whole lot. You can just build a profile form that posts to the entries/save-entry
controller action. If you need to allow users to edit both 'native' user fields and their profile in a single form, you could use a custom controller endpoint or use JavaScript to split the form submission into two requests that call the respective endpoints.
If your users have access to the Control Panel, you might want to provide easy ways for them to find their profile entry. For example:
- Create a custom widget showing the current user profile with a link to edit it (that goes directly to the entry edit page for the profile).
- Use Template Hooks to include a link to the user profile on the user edit page. In this case,
cp.users.edit.content
would be a good place to put this.