How to make user fields translatable (content)

I would like to be able to translate the content of the users biography field but whenever I try to save it in another language I get an error

Exception: Exception

No route found for path: “account” and request method: “PATCH”

Is there a way to do it?

User fields should be translatable just like page content or file metadata. It works alright for me with 3.6 Alpha 4. Please check if you can reproduce the issue in a fresh Starterkit.

I have just copied this more detailed error message from the browser console:

POST https://domain.tld/kirbytest/api/account 404
request @ index.js:1
post @ index.js:1
patch @ index.js:1
save @ index.js:1
(anonymous) @ vendor.js:6
ws.dispatch @ vendor.js:12
dispatch @ vendor.js:6
onSave @ index.js:1
Vt @ vendor.js:6
n @ vendor.js:6
Vt @ vendor.js:6
n @ vendor.js:6
Qr.i._wrapper @ vendor.js:6
index.js:1 {status: ‘error’, message: ‘No route found for path: “account” and request method: “PATCH”’, code: 404, exception: ‘Exception’, key: null, …}code: 404details: Array(0)length: 0[[Prototype]]: Array(0)exception: "Exception"file: "/kirbytest/kirby/src/Http/Router.php"key: nullline: 154message: "No route found for path: "account" and request method: "PATCH""route: nullstatus: “error”[[Prototype]]: Objectconstructor: ƒ Object()arguments: (…)assign: ƒ assign()caller: (…)create: ƒ create()defineProperties: ƒ defineProperties()defineProperty: ƒ defineProperty()entries: ƒ entries()freeze: ƒ freeze()fromEntries: ƒ fromEntries()getOwnPropertyDescriptor: ƒ getOwnPropertyDescriptor()getOwnPropertyDescriptors: ƒ getOwnPropertyDescriptors()getOwnPropertyNames: ƒ getOwnPropertyNames()getOwnPropertySymbols: ƒ getOwnPropertySymbols()getPrototypeOf: ƒ getPrototypeOf()hasOwn: ƒ hasOwn()is: ƒ is()isExtensible: ƒ isExtensible()isFrozen: ƒ isFrozen()isSealed: ƒ isSealed()keys: ƒ keys()length: 1name: "Object"preventExtensions: ƒ preventExtensions()prototype: {constructor: ƒ, defineGetter: ƒ, defineSetter: ƒ, hasOwnProperty: ƒ, lookupGetter: ƒ, …}seal: ƒ seal()setPrototypeOf: ƒ setPrototypeOf()values: ƒ values()[[Prototype]]: ƒ ()[[Scopes]]: Scopes[0]hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()defineGetter: ƒ defineGetter()defineSetter: ƒ defineSetter()lookupGetter: ƒ lookupGetter()lookupSetter: ƒ lookupSetter()proto: (…)get proto: ƒ proto()set proto: ƒ proto()

onError @ index.js:1
request @ index.js:1
async function (async)
request @ index.js:1
post @ index.js:1
patch @ index.js:1
save @ index.js:1
(anonymous) @ vendor.js:6
ws.dispatch @ vendor.js:12
dispatch @ vendor.js:6
onSave @ index.js:1
Vt @ vendor.js:6
n @ vendor.js:6
Vt @ vendor.js:6
n @ vendor.js:6
Qr.i._wrapper @ vendor.js:6

Does it help?

Hm, the question is why Kirby tries to call an account route when this doesn’t exist.

I have only one users blueprint (default.yml):

# User blueprints are used to create new user roles, define form fields for each user role and set role permissions.
# By default, Kirby only has the `admin` role, a user role that is allowed to do anything.
# The title is required, everything else is optional.
# The default user blueprint does not define a role, but a standard set of fields
# available for each defined user role with blueprints that only contain a title.
# More about users, roles and permissions: https://getkirby.com/docs/guide/users/managing-users
title: User

columns:
  - width: 1/2
    fields:
      street:
        label: Street
        type: text
      zip:
        label: ZIP
        type: text
        width: 1/4
      city:
        label: City
        type: text
        width: 3/4
      country:
        label: Country
        type: text

  - width: 1/2
    fields:
      website:
        label: Website
        type: url
      twitter:
        label: Twitter
        type: text
        icon: twitter
        placeholder: @username
      instagram:
        label: Instagram
        type: text
        icon: instagram
        placeholder: username

  - width: 1/1
    fields:
      bio:
        label: Bio
        type: textarea# User blueprints are used to create new user roles, define form fields for each user role and set role permissions.
# By default, Kirby only has the `admin` role, a user role that is allowed to do anything.
# The title is required, everything else is optional.
# The default user blueprint does not define a role, but a standard set of fields
# available for each defined user role with blueprints that only contain a title.
# More about users, roles and permissions: https://getkirby.com/docs/guide/users/managing-users
title: User

columns:
  - width: 1/2
    fields:
      street:
        label: Street
        type: text
      zip:
        label: ZIP
        type: text
        width: 1/4
      city:
        label: City
        type: text
        width: 3/4
      country:
        label: Country
        type: text

  - width: 1/2
    fields:
      website:
        label: Website
        type: url
      twitter:
        label: Twitter
        type: text
        icon: twitter
        placeholder: @username
      instagram:
        label: Instagram
        type: text
        icon: instagram
        placeholder: username

  - width: 1/1
    fields:
      bio:
        label: Bio
        type: textarea

Ah, I see now that this happens when you are on your account page (instead of accessing your account via the users’ view).

But this isn’t related to translating content but also happens when you want to store content via the account view in a non-multilang installation.

For the time being you can update your user via users/userid.

1 Like

Ah, thanks. It seems as if I discover some bugs by trying out Kirby (3.6) for the first time :wink: