Skip to content
better-i18n.com
Sur cette page

Update translations. Each entry updates ONE language for ONE key. Set isSource=true to update the source text.

Parameters #

ParameterTypeRequiredDescription
projectstringYesProject identifier in org/project format
translationsarrayYesArray of translation updates

Translation Object #

FieldTypeRequiredDescription
keystringYesKey name (e.g., 'submit_button')
languagestringYesLanguage code (e.g., 'en', 'tr', 'de')
textstringYesTranslation text
namespacestringNoNamespace (default: 'default')
isSourcebooleanNoSet to true to update source text
statusstringNoTranslation status (e.g., 'published')
namespaceContextobjectNoContext for the namespace

Examples #

Update a translation #

JSON
{
  "project": "my-org/my-app",
  "translations": [
    {
      "key": "auth.login.title",
      "language": "tr",
      "text": "Giriş yap"
    }
  ]
}

Update source text #

JSON
{
  "project": "my-org/my-app",
  "translations": [
    {
      "key": "auth.login.title",
      "language": "en",
      "text": "Log in to your account",
      "isSource": true
    }
  ]
}

Publish a translation #

JSON
{
  "project": "my-org/my-app",
  "translations": [
    {
      "key": "auth.login.title",
      "language": "tr",
      "text": "Hesabınıza giriş yapın",
      "status": "published"
    }
  ]
}

Batch update #

JSON
{
  "project": "my-org/my-app",
  "translations": [
    {
      "key": "auth.login.title",
      "language": "tr",
      "text": "Giriş"
    },
    {
      "key": "auth.login.button",
      "language": "tr",
      "text": "Giriş yap"
    },
    {
      "key": "auth.login.button",
      "language": "de",
      "text": "Anmelden"
    }
  ]
}

Response #

JSON
{
  "success": true,
  "project": "my-org/my-app",
  "keysUpdated": 2,
  "updates": [
    {
      "key": "auth.login.title",
      "language": "tr",
      "status": "updated"
    },
    {
      "key": "auth.login.button",
      "language": "tr",
      "status": "updated"
    }
  ]
}