# Changelog
All notable changes to this project will be documented in this file.

This plugin evolved from [@open-xchange/rollup-plugin-po2json](https://gitlab.com/openxchange/appsuite/web-foundation/rollup-plugin-po2json), adapted for Vite 8 and Rolldown.

## [Unreleased]

## [1.3.0] - 2026-11-12

### Added

- Option `missingComments` lists gettext calls without a translator comment as a build warning (`'warn'`) or fails the build (`'error'`). Off by default.

### Fixed

- `<!-- #. … -->` comments in a Vue template are no longer dropped when the SFC imports gettext in its second `<script>` block, e.g. `<script setup>` after a plain `<script>`

## [1.2.0] - 2026-11-10

### Fixed

- Write the POT file to disk instead of emitting it into the bundle, so it no longer appears in the Vite manifest. `outFile` can now point outside `outDir` (`../` or an absolute path) to keep the file out of the build output too, and with it out of manifests that other plugins build from `outDir`, such as `vite-plugin-ox-bundle`.

## [1.1.7] - 2026-11-04

### Fixed

- Add the `c-format` flag for every printf placeholder the dictionary formats (e.g. `%s`, `%2$s`), not only numeric ones
- Type `GettextPlugin` as an intersection with `Plugin`, so it compiles against Vite versions whose `Plugin` declares its own `meta`
- Translator comments between chained calls or before a closing brace are no longer dropped; comments are now collected from every token, not only from AST nodes
- A translator comment is no longer taken by another call with a string argument on the same line; only gettext calls consume comments
- A msgid used several times in one file keeps the translator comments of every occurrence instead of only the last one

### Security

- Update dev dependencies vite, vitest and minimatch to versions without known advisories

## [1.1.6] - 2026-05-11

### Fixed

- Extract HTML translator comments that follow a nested `<template v-for>` inside the root `<template>`

## [1.1.5] - 2026-04-22

### Fixed

- Extract messages (and HTML translator comments) from Vue SFCs that use `<script setup lang="ts">`. Plugin-vue emits the script as a virtual submodule in that case, so the main `.vue` file's template-pairing synthesis was never consumed; the build now folds the parent `.vue` codes into the submodule's extraction.

## [1.1.4] - 2026-04-22

### Added

- Extract HTML translator comments (`<!-- #. … -->`) from Vue templates and attach them to the following `gt(...)` call

## [1.1.3] - 2026-04-21

### Fixed

- Preserve `#.` translator comments above top-level `gt(...)` calls in Vue SFC `<script setup>` blocks
- Extract gt calls from Vue templates when the render function is inlined (setup bindings wrapped as `_unref(gt)(...)`)

## [1.1.2] - 2026-04-21

### Added

- Test coverage for Vue SFC files, both in production mode (pot extraction) and development mode (dev server transform)
- Extract gt calls from Vue template expressions (e.g. `:alt="gt('…')"`, `{{ gt.ngettext(…) }}`), covering `<script setup>` and Options API bindings

### Fixed

- Extract gt calls from Vue SFC files when the `<template>` or `<style>` block contains a multiline template literal

## [1.1.1] - 2026-03-26

### Added

- Expose languages as a Set and add `hasLanguage` method to Dictionary

## [1.1.0] - 2026-03-25

### Added

- Support informal locale suffixes in gettext plugin

### Changed

- Update dependency typescript to v6

## 1.0.0 - 2026-03-13

### Changed

- Fork from `@open-xchange/rollup-plugin-po2json` v0.9.5
- Migrate to Vite 8 / Rolldown
- Emit translation chunks in `buildStart` (Rolldown suppresses `resolveDynamicImport` for `@vite-ignore` imports)
- Set `dictionary: true` in `resolveId` (Rolldown doesn't apply meta from `load` hook)
- Migrate tests from Rollup to Vite build API
- Add `vite ^8.0.0` as peer dependency

[unreleased]: https://gitlab.com/openxchange/appsuite/web-foundation/vite-plugin-po2json/-/compare/1.3.0...main
[1.3.0]: https://gitlab.com/openxchange/appsuite/web-foundation/vite-plugin-po2json/-/compare/1.2.0...1.3.0
[1.2.0]: https://gitlab.com/openxchange/appsuite/web-foundation/vite-plugin-po2json/-/compare/1.1.7...1.2.0
[1.1.7]: https://gitlab.com/openxchange/appsuite/web-foundation/vite-plugin-po2json/-/compare/1.1.6...1.1.7
[1.1.6]: https://gitlab.com/openxchange/appsuite/web-foundation/vite-plugin-po2json/-/compare/1.1.5...1.1.6
[1.1.5]: https://gitlab.com/openxchange/appsuite/web-foundation/vite-plugin-po2json/-/compare/1.1.4...1.1.5
[1.1.4]: https://gitlab.com/openxchange/appsuite/web-foundation/vite-plugin-po2json/-/compare/1.1.3...1.1.4
[1.1.3]: https://gitlab.com/openxchange/appsuite/web-foundation/vite-plugin-po2json/-/compare/1.1.2...1.1.3
[1.1.2]: https://gitlab.com/openxchange/appsuite/web-foundation/vite-plugin-po2json/-/compare/1.1.1...1.1.2
[1.1.1]: https://gitlab.com/openxchange/appsuite/web-foundation/vite-plugin-po2json/-/compare/1.1.0...1.1.1
[1.1.0]: https://gitlab.com/openxchange/appsuite/web-foundation/vite-plugin-po2json/-/tags/1.1.0
