Skip to content

Examples catalog #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Examples catalog #39

wants to merge 2 commits into from

Conversation

lucacasonato
Copy link
Collaborator

@lucacasonato lucacasonato commented Mar 15, 2025

This commit adds a catalog of examples of how to do various things with MessageFormat 2. It is still relatively empty, but I hope that we can start filling this up with some more things collectively.

The idea here is for searches like "doing X with messageformat 2" to end up somewhere useful.

The best way to build a catalog like this is to look at Google Search console, see what people are looking for with "message format 2" in the query, and then make sure that frequent queries have a dedicated page. That requires having some decent traffic first though, so we need to seed it with examples that we think will be useful first.

image
image

Copy link

cloudflare-workers-and-pages bot commented Mar 15, 2025

Deploying mfv2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2c84abe
Status: ✅  Deploy successful!
Preview URL: https://b2da80d7.mfv2.pages.dev
Branch Preview URL: https://cookbook.mfv2.pages.dev

View logs

Copy link
Member

@aphillips aphillips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incomplete review

Comment on lines +27 to +30
The denominator of the compact form is a power of 10. In US English, examples
are 1,000 (K), 1,000,000 (M), or 1,000,000,000 (B). In other locales, different
denominators may be used, which may not always be a power of 1000. In India, for
example, 1,00,000 (L) is used to represent 100,000.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use better line breaks. Semantic line breaks makes it easier to suggest edits, etc.

The examples (expecially the lakh example) is unclear. Perhaps:

Suggested change
The denominator of the compact form is a power of 10. In US English, examples
are 1,000 (K), 1,000,000 (M), or 1,000,000,000 (B). In other locales, different
denominators may be used, which may not always be a power of 1000. In India, for
example, 1,00,000 (L) is used to represent 100,000.
For example, in US English (`en-US`) you might see:
- `100,000``100K`
- `1,000,000``1M`
- `1,000,000,000``1B`
Other locales have different rules or might use different default
denominators.
For example, English as used in India (`en-IN`) uses a different grouping strategy with units called "lakhs" and "crore":
- `1,00,000``1L`
- `10,00,000``10L`
- `1,00,00,00,000``100Cr`

Comment on lines +24 to +25
Compact notation is a way of expressing large numbers in a more concise form. It
is commonly used in financial and scientific applications.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure about scientific applications? Perhaps:

Suggested change
Compact notation is a way of expressing large numbers in a more concise form. It
is commonly used in financial and scientific applications.
Compact notation is a way of expressing large numbers in a more concise form.
This is useful for displaying numbers in environments with limited
screen display space.

@@ -0,0 +1,17 @@
---
title: Displaying percentages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently not in the spec, but may be added soon. The concern is that we might add a separate function.

@aphillips
Copy link
Member

Cookbooks (like this PR) are an outstanding idea.

one {{Je zde jeden prvek.}}
few {{Jsou zde {$count} prvky.}}
many {{Jsou zde {$count} prvků.}}
* {{Jsou zde {$count} prvků.}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably make other vs * more clear, but maybe that's better suited to a more complex example with multiple selectors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants