[messages_builder] Align translations with their template

The generated code looks up messages by their index in the template and
passes arguments in the order of the template's placeholders, but each
data file was serialized on its own. So a translation which was missing
a message, or had an extra one, returned the wrong messages, and a
translation which reordered placeholders got the wrong arguments.

Translations are now aligned with their template: missing messages fall
back to the template, extra messages are dropped, and argument indices
are remapped to the template's placeholder order.

All data files of a context now share a hash of the template's message
names and placeholders, so updating a translation does not change the
generated code.
5 files changed
tree: 141ef176182e077249d2936735f397b6b9c30bd5
  1. .gemini/
  2. .github/
  3. pkgs/
  4. .gitignore
  5. CONTRIBUTING.md
  6. LICENSE
  7. README.md
README.md

Overview

This repository is home to Dart internationalization (i18n) and localization (l10n) related packages.

Packages

PackageDescriptionIssuesVersion
intlContains code to deal with internationalized/localized messages, date and number formatting and parsing, bi-directional text, and other internationalization issues.issuespub package
intl4xA lightweight modular library for internationalization (i18n) functionality.issuespub package
intl_translationContains code to deal with internationalized/localized messages, date and number formatting and parsing, bi-directional text, and other internationalization issues.issuespub package
messagesA lightweight modular library for localization (l10n) functionality.issues
messages_builderBuild the messages for consumption by package:messagesissues
messages_serializerSerialization of messages for package:messages.issues
messages_shrinkerRemoving unneeded messages from message data files for package:messages.issuespub package

Contribute

Let us know about bugs and feature requests, file a pull request, or participate in the discussions!

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

For additional information about contributing, see our contributing page.