Skip to content

Add preferred_language for users creating API

Baodong请求将feat/create-user-with-preferred-lang合并到main-jh

Related issue: #2509 (closed)

What does this MR do and why?

  • JH Only
  • Free
  • SaaS and Self-Managed

Add attribute of preferred_language for users creating API.

curl example:

curl --location 'http://localhost:3000/api/v4/users' \
--header 'PRIVATE-TOKEN: <ADMIN-TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "user@gmail.com",
    "name": "username",
    "username": "username",
    "password": "P@ssw0rd!",
    "preferred_language": "fr"
}'

preferred_language should be a member of ::Gitlab::I18n.available_locales:

["bg", "cs_CZ", "da_DK", "de", "en", "eo", "es", "fil_PH", "fr", "gl_ES", "id_ID", "it", "ja", "ko", "nb_NO", "nl_NL", "pl_PL", "pt_BR", "ro_RO", "ru", "si_LK", "tr_TR", "uk", "zh_CN", "zh_HK", "zh_TW"]
Baodong 编辑于

合并请求报告

加载中