Skip to content

Locale Support #261

@mfriesen

Description

@mfriesen

Currently, FormKiQ does not include locale support, and all localization and value customization is done externally.

Ideally, FormKiQ will enable localization and customization of all interface and API values, beginning with "allowedValues" for schema/classification attributes, as well as "interfaceKey" values for use in user interfaces.

Design:

POST /sites/{siteId}/locales/{locale}/resourceItems/
{
  "itemType": "interface|schema|classification",
  "localizedValue": "",
  "interfaceKey": "",
  "classificationId": "",
  "attributeKey": "",
  "allowedValue": "",
}
POST /sites/{siteId}/locales/{locale}/resourceItems/
{
  "itemType": "interface",
  "interfaceKey": "cancel",
  "localizedValue": "Cancel"
}

For more robust organization of interfaceKeys, users can use periods to organize, e.g., "loadingError", "admin.loadingError"
(This will likely be used to organize in the FormKiQ Document Console)

DELETE /sites/{siteId}/locales/{locale}/resourceItems/{itemKey}
PUT /sites/{siteId}/locales/{locale}/resourceItems/{itemKey}
GET /sites/{siteId}/locales/{locale}/resourceItems/
[
  {
    "itemKey": "schema##{attributeKey}##{allowedValue}",
    "localizedValue": "",
  },
 {
    "itemKey": "classification##{classificationId}##{attributeKey}##{allowedValue}",
    "localizedValue": "",
  },
 {
    "itemKey": "interface##{interfaceKey}"
    "localizedValue": "",
  }
]

Locale param or Accept-Language header would also be used for these endpoints:
e.g., ?locale=fr
e.g., Accept-Language=en-US,en;q=0.9 (or just en, or en-001, etc.)

GET /sites/{siteId}/schema/document
{
  "name": "string",
  "attributes": {
    "required": [
      {
        "attributeKey": "string",
        "allowedValues": [
          "string"
        ],
        "localizedAllowedValues":{
           "allowedValue":"localizedValue"
        }
      }
    ]
  }
}

GET /sites/{siteId}/schema/document/attributes/{key}/allowedValues
GET /sites/{siteId}/classifications/{classificationId}
GET /sites/{siteId}/classifications/{classificationId}/attributes/{key}/allowedValues

Locale create/edit/delete
GET /sites/{siteId}/locales
POST /sites/{siteId}/locales
DELETE /sites/{siteId}/locales

Sub-issues

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions