# General Translation Changelog: generaltranslation 7.8.0: Locale-aware list formatting
URL: https://generaltranslation.com/en-GB/blog/generaltranslation_v7_8_0.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: 
Authors: Ernest McCarter
Published: 2025-10-29

## Overview

In **generaltranslation@7.8.0**, we&#39;re introducing list-formatting capabilities that lay the groundwork for upcoming components and methods. This release adds `formatListToParts()` to the `GT` class and also provides it as a standalone function.

***

## Motivation

Lists of items require proper locale-aware formatting. Specifically, we wanted to add the ability to join multiple items (not just strings) into a formatted list. This sets us up nicely for creating lists of arbitrary data, such as JSX elements.

***

## Usage

The new `formatListToParts()` function preserves the original types of list items while inserting appropriate locale-specific separators:

```javascript
import { GT, formatListToParts } from 'generaltranslation'

const gt = new GT({ locales: ['en'] })

// Mixed data types
gt.formatListToParts(['apple', 42, { type: 'fruit' }])
// Returns: ['apple', ', ', 42, ', and ', { type: 'fruit' }]

// Standalone function
formatListToParts(['red', 'green', 'blue'], {
  locales: ['es'],
  type: 'disjunction',
})
// Returns: ['red', ', ', 'green', ' o ', 'blue']
```

Different list types and styles are supported:

```javascript
// Disjunction (or)
gt.formatListToParts(['A', 'B', 'C'], { type: 'disjunction' })
// Returns: ['A', ', ', 'B', ', or ', 'C']

// Short style
gt.formatListToParts(['first', 'second'], { style: 'short' })
// Returns: ['first', ' & ', 'second']

// Unit formatting
gt.formatListToParts(['1km', '2mi'], { type: 'unit' })
// Returns: ['1km', ', ', '2mi']
```

***


## Foundation for Components

This functionality lays the groundwork for the forthcoming `<List/>` component and `msg.list()` / `gt.list()` methods, which will provide React interfaces for list formatting.

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
