Skip to content

Instantly share code, notes, and snippets.

View stasm's full-sized avatar

Stanisław Małolepszy stasm

View GitHub Profile
@stasm
stasm / 1.md
Last active October 23, 2023 06:48

A message with a variable:

Hello, {$username}!

A message with an annotated variable:

{#input $date :datetime month=long day=numeric}
Today is {$date}.
@stasm
stasm / README.md
Last active October 15, 2023 11:40
MessageFormat Beauty Contest

When evaluating each option below, please keep in mind the following questions:

  1. What's going on in the examples? What's your first reaction to seeing them?
  2. What do you like about each example? Any good ideas worth transplanting to other options? Feel free to mix and match.
  3. What do you dislike about each example? Imagine you have to work with this syntax in the future (it will one day be available directly in JavaScript!). What do you thikn is going to be annoying?
  4. What do you think the output of help, hello and notif is exactly (including leading and trailing whitespace)?
  5. How would you add a single space in front of all presented messages, to make it part of the translatable text?
  6. How would you add a newline in front of all presented messages, to make it part of the translatable text?
@stasm
stasm / elems.txt
Created May 7, 2020 12:34
vars and elems used in voice-web/web/locales/en/
articleLink
b
bold
browseWrap
datasetLink
discourseLink
githubLink
goalPercentage
italic
languagesLink
@stasm
stasm / compat.diff
Created April 21, 2020 13:40
@fluent compat vs ES2018
diff -wru compat/fluent-bundle.js es2018/fluent-bundle.js
--- compat/fluent-bundle.js 2020-04-21 14:45:46.219383600 +0200
+++ es2018/fluent-bundle.js 2020-04-21 14:46:02.403757100 +0200
@@ -8,190 +8,6 @@
})(this, function (exports) {
"use strict";
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
../../gecko-strings/browser/browser/aboutTabCrashed.ftl
Choose { crashed-restore-tab-button } to reload the page.
Choose { crashed-restore-tab-button } or { crashed-restore-all-button } to reload the page/pages.
Choose { crashed-restore-tab-button } or { crashed-restore-all-button } to reload the page/pages.
../../gecko-strings/browser/browser/browserContext.ftl
{ main-context-menu-back.tooltiptext }
{ main-context-menu-back.aria-label }
{ main-context-menu-forward.tooltiptext }
{ main-context-menu-forward.aria-label }
{ main-context-menu-reload.aria-label }

Keybase proof

I hereby claim:

  • I am stasm on github.
  • I am sta (https://keybase.io/sta) on keybase.
  • I have a public key ASCqb0sg6M1_OWVxrTG4YhF6GNuUjBD3ji1aeWyR93WTtQo

To claim this, I am signing this object:

@stasm
stasm / playground.ftl
Created March 22, 2019 15:08
A Fluent Playground snippet
hello = Witaj {$username}!
## browser/browser/branding/sync-brand.ftl
branding/sync-short = Sync
branding/sync-full = Firefox Sync
branding/fxaccount = {$first-letter ->
[lowercase] compte Firefox
*[uppercase] Compte Firefox
}
## browser/browser/preferences/preferences.ftl
separate-profile-mode =
brandShorterName
browser/branding/official/brand.dtd:brandShorterName
Firefox
mail/branding/thunderbird/brand.dtd:brandShorterName
Thunderbird
brandShortName
browser/branding/official/brand.dtd:brandShortName
Firefox
mail/branding/thunderbird/brand.dtd:brandShortName
Thunderbird
@stasm
stasm / _readme.md
Last active October 30, 2018 10:25
Parameterized Terms in Practice.

Two examples of changes required to the current localizations into Italian and Ukrainian if VariantLists are replaced with parameterized terms (a.k.a. macros). See projectfluent/fluent#176 for details of the proposal.