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 / until.lol
Created June 29, 2013 22:54
A count-down to my vacation.
<plural($n) {
$n == 0 ? "zero" :
$n == 1 ? "one" :
$n % 10 >= 2 &&
$n % 10 <= 4 &&
($n % 100 < 10 || $n % 100 >= 20) ? "few" :
"many" }>
<until[plural($days), plural($hours)] {
zero: {
@stasm
stasm / 0.L20nExamples.md
Last active December 20, 2015 04:19
L20n examples for Gaia

L20n

This gist documents a few opportunities to improve the localization of Gaia by using L20n. In all presented examples, I try to show the existing code, explain the problem from the localizers' or developers' perspective, and suggest a solution.

You can find out more about L20n at:

@stasm
stasm / fuzz
Last active August 29, 2015 14:23 — forked from zbraniecki/fuzz
#!/usr/bin/env python
import argparse
import random
import hglib
import json
import subprocess
PY_COMPARE = 'compare-dirs'
JS_COMPARE = '/home/stas/moz/compare-locales.js/bin/compare-dirs.js'
@stasm
stasm / abstract.md
Last active August 29, 2015 14:24
New syntax for L20n

New Syntax Proposal for L20n

Goals & Means:

  • Make the most commonly used syntax easy on the eyes by reducing the number of characters used.

@stasm
stasm / .env
Last active December 17, 2021 18:20
Pontoon in Docker
SECRET_KEY=hiphopopotamus
DJANGO_DEV=True
DJANGO_DEBUG=True
DATABASE_URL=postgres://pontoon:pontoon@localhost/pontoon
SESSION_COOKIE_SECURE=False
SITE_URL=http://localhost:8000
FXA_CLIENT_ID=2651b9211a44b7b2
FXA_SECRET_KEY=a3cafccbafe39db54f2723f8a6f804c337e362950f197b5b33050d784129d570
FXA_OAUTH_ENDPOINT=https://oauth-stable.dev.lcip.org/v1
FXA_PROFILE_ENDPOINT=https://stable.dev.lcip.org/profile/v1
@stasm
stasm / Template.js
Created July 26, 2016 14:50
Polymer's HTMLTemplateElement polyfill
/**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
// @version 0.7.22-251f4af
@stasm
stasm / workload-low.ftl
Last active February 27, 2023 13:42
An example of a large file, FTL v0.2.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# browser/locales/en-US/browser/menubar.ftl
[[ File menu ]]
# Try editing the translations here!
shared-photos = { $user_name } { $photo_count ->
[0] hasn't added any photos yet
[one] added a new photo
*[other] added { $photo_count } new photos
}.
liked-comment = { $user_name } liked your comment on { $user_gender ->
[male] his
@stasm
stasm / doc.md
Last active February 22, 2017 00:53

Classes

MessageContext

Message contexts are single-language stores of translations. They are responsible for parsing translation resources in the FTL syntax and can format translation units (entities) to strings.

Always use MessageContext.format to retrieve translation units from a context. Translations can contain references to other entities or external arguments, conditional logic in form of select expressions, traits

@stasm
stasm / attrs.ftl
Last active October 5, 2017 20:45 — forked from zbraniecki/attrs.ftl
Experiment with FTL syntax
key = Value
key.attr = Attribute
key.attr2 = Attribute 2
key.attr = Attribute
key.attr2 = Attribute 2
key =
Multiline
Value