• Stars
    star
    231
  • Rank 173,434 (Top 4 %)
  • Language
  • License
    Other
  • Created almost 5 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Developing a standard for localizable message strings

MessageFormat Working Group

Welcome to the home page for the MessageFormat Working Group, a subgroup of the Unicode CLDR-TC.

Charter

The Message Format Working Group (MFWG) is tasked with developing an industry standard for the representation of localizable message strings to be a successor to ICU MessageFormat. MFWG will recommend how to remove redundancies, make the syntax more usable, and support more complex features, such as gender, inflections, and speech. MFWG will also consider the integration of the new standard with programming environments, including, but not limited to, ICU, DOM, and ECMAScript, and with localization platform interchange. The output of MFWG will be a specification for the new syntax.

MessageFormat 2 Draft Syntax

The current draft syntax for defining messages can be found in spec/syntax.md. The syntax is formally described in ABNF.

Messages can be simple strings:

{Hello, world!}

Messages can interpolate arguments formatted using formatting functions:

{Today is {$date :datetime weekday=long}.}

Messages can define variants which correspond to the grammatical (or other) requirements of the language:

match {$count :number}
when 1 {You have one notification.}
when * {You have {$count} notifications.}

The message syntax is also capable of expressing more complex translation, for example:

let $hostName = {$host :person firstName=long}
let $guestName = {$guest :person firstName=long}
let $guestsOther = {$guestCount :number offset=1}

match {$host :gender} {$guestOther :number}

when female 0 {{$hostName} does not give a party.}
when female 1 {{$hostName} invites {$guestName} to her party.}
when female 2 {{$hostName} invites {$guestName} and one other person to her party.}
when female * {{$hostName} invites {$guestName} and {$guestsOther} other people to her party.}

when male 0 {{$hostName} does not give a party.}
when male 1 {{$hostName} invites {$guestName} to his party.}
when male 2 {{$hostName} invites {$guestName} and one other person to his party.}
when male * {{$hostName} invites {$guestName} and {$guestsOther} other people to his party.}

when * 0 {{$hostName} does not give a party.}
when * 1 {{$hostName} invites {$guestName} to their party.}
when * 2 {{$hostName} invites {$guestName} and one other person to their party.}
when * * {{$hostName} invites {$guestName} and {$guestsOther} other people to their party.}

See more examples and the formal definition of the grammar in spec/syntax.md.

Implementations

  • Java: com.ibm.icu.message2, part of ICU 72 released in October 2022, is a tech preview implementation of the MessageFormat 2 syntax, together with a formatting API. See the ICU User Guide for examples and a quickstart guide.
  • JavaScript: messageformat 4.0 implements the MessageFormat 2 syntax, together with a polyfill of the runtime API proposed for ECMA-402.

Sharing Feedback

We invite feedback about the current syntax draft, as well as the real-life use-cases, requirements, tooling, runtime APIs, localization workflows, and other topics.

Participation

To join in:

  1. Review CONTRIBUTING.md
  2. Apply to join our mailing list
  3. Watch this repository (use the "Watch" button in the upper right corner)

Copyright & Licenses

Copyright © 1991-2023 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the United States and other countries.

The project is released under LICENSE. A CLA is required to contribute to this project - please refer to the CONTRIBUTING.md file (or start a Pull Request) for more information.

More Repositories

1

icu

The home of the ICU project source code.
C++
2,111
star
2

icu4x

Solving i18n for client-side and resource-constrained environments.
Rust
1,078
star
3

cldr

The home of the Unicode Common Locale Data Repository
Java
828
star
4

last-resort-font

Last Resort Font
673
star
5

cldr-json

JSON Data from the Unicode CLDR Project
Shell
447
star
6

text-rendering-tests

Unicode’s test suite for text rendering engines
HTML
166
star
7

unilex

Lexical data at Unicode
Clojure
63
star
8

unicodetools

home of unicodetools and https://util.unicode.org JSPs
HTML
51
star
9

icu-data

ICU Data Repository
Java
32
star
10

icu-docs

Docs (API, Userguide) for ICU
HTML
25
star
11

cldr-staging

Proposed production data for CLDR data
HTML
25
star
12

cjk-symbols

CJK Symbols
PostScript
22
star
13

icu-demos

sample apps for ICU (formerly icuapps)
Java
20
star
14

unihan-database

For review of draft Unihan database changes, removals, and additions by experts.
18
star
15

lstm_word_segmentation

Python code for training an LSTM model for word segmentation in Thai, Burmese, and similar languages.
Python
18
star
16

uk-source-ideographs

UK-Source Ideographs
11
star
17

jira-github-pr-check

Checks GitHub pull requests for valid and accepted Jira tickets. Used for ICU and CLDR
JavaScript
11
star
18

cldr-implementers-guide

Implementer's Guide for CLDR
9
star
19

uli-docs

ULI has been Archived, see https://unicode.org/uli
8
star
20

ml-confusables-generator

Generates confusables for Han script using ML techniques
Jupyter Notebook
8
star
21

rust-discuss

OmnICU-SC: For discussion of i18n in Rust.
7
star
22

unicode-org.github.io

top level index.html for https://unicode-org.github.io/
HTML
7
star
23

icu-docker

Dockerfiles for ICU development
Shell
6
star
24

icu4jni

New home of the (archived) ICU4JNI project.
Java
5
star
25

uli

ULI has been Archived, see https://unicode.org/uli
Python
4
star
26

icu-jira-safari

Note: GitHub provides this directly now.
JavaScript
4
star
27

icu-trac-tools

ICU’s trac plugins
Python
3
star
28

icu4x-docs

ICU4X Docs
HTML
3
star
29

conformance

Unicode & CLDR Data Driven Testing
Python
3
star
30

icu-trac2jira

ICU and CLDR’s Trac to JIRA conversion tool. Archived, not under active maintenance.
JavaScript
3
star
31

cldr-apps-webdriver

CLDR Survey Tool WebDriver Test Framework
Java
2
star
32

icu-remunge-svndump

munger for svndump — to be used for pre-combining ICU svn trees
Perl
2
star
33

icu-perf

ICU performance test results. Maintained by ICU-TC
JavaScript
2
star
34

template-repo

Template Repository for Unicode projects
1
star