# Localized assets

This API reference document contains information on creating asset localizations

**Note:**

If you want to find out which asset system your project uses and which section of this document applies to you, [click here](https://hygraph.com/classic-docs/api-reference/assets/assets-overview#which-asset-system-does-my-project-use).

## Hygraph Asset Management

Our asset system lets you create a localizations by providing as `fileName` (optional) and `uploadUrl`. You can use the `createAsset` mutation and create the localization simultaneously, or use `updateAsset` and add a localization to an existing asset.

**Pro Tip:**

If you don't pass a `fileName`, the system uses the file name of the file you provide - via URL or local file.

If you pass a `fileName`, it overwrites the name of the file you provide. 

The following example shows the URL upload of an asset along with its localized content:

```graphql
mutation test {
  createAsset(
    data: {
			uploadUrl: "<UPLOAD_URL>"
      localizations:{
        create: {
          locale: de
          data:{
            uploadUrl: "<LOCALE_UPLOAD_URL>"
          }
        }
      }
    }
  ) {
    id
    url
    localizations {
      id
      url
    }
  }
}
```

This other example updates an existing asset entry, adding the `de` localization:

```graphql
mutation test {
  updateAsset(
    where: {id: "<ASSET_ID>"}
    data: {
      localizations: {
        create: {
          locale: de, 
          data: { 
            uploadUrl: "<LOCALE_UPLOAD_URL>"
          }
        }
      }
    }
  ) {
    id
    locale
    url
    localizations {
      url
      locale
    }
  }
}
```

**Pro Tip:**

For the action of creation of localized assets to work, your project configuration must already have the locale configured.

Learn more about [mutating localized content](https://hygraph.com/classic-docs/api-reference/content-api/localization#mutating-localized-content).

## Legacy asset system

Since assets are localized by default, you can upload a file for your project locales.

You can do this from the UI: Simply navigate to **Assets** and access the edit view of your asset entry.

Click the eye icon next to your localization to ensure the `Upload` button is visible.

![Asset localization - Legacy asset system](https://hygraph.com/images/classic-docs/api-reference/assets/asset-localization-legacy.png)

**Pro Tip:**

Localizations only display on the sidebar if you've previously configured them in your project settings.

## Localize assets in the UI

You can also localize assets using the UI. [Check out this document to learn more](https://hygraph.com/classic-docs/developer-guides/content/content-localization#localize-assets).
