Skip to content

Instantly share code, notes, and snippets.

View dlockhart's full-sized avatar

Dave Lockhart dlockhart

  • D2L Corporation
  • Toronto, Ontario
View GitHub Profile

ICU Message Syntax at D2L

At D2L, we use the ICU Message Syntax to help express the subtleties of spelling, grammar and conjugation inherent in each language.

The following sections describe the different features of ICU Message Syntax.

Basic Principles

In its simplest form, each message is a plain piece of text, like this:

(function() {
var proto = Object.create(HTMLElement.prototype);
proto.createdCallback = function() {
var tmpl = document.createElement('template');
tmpl.innerHTML = '<style>p {color:red; display: block;}</style><p><b>Foo</b> <content></content></p>';
this.createShadowRoot()
.appendChild(document.importNode(tmpl.content, true));
};
proto.attachedCallback = function() {
return 'a';
@dlockhart
dlockhart / polymer-style-module-bug.html
Created April 17, 2018 15:09
Example of a bug in Polymer 2 style modules
<dom-module id="foo-element">
<template strip-whitespace>
<style>
:host {
display: inline-block;
}
</style>
<button>foo</button>
</template>
<script>