Hi,
We're looking for feedback on the a behavior when writing multiline patterns in Fluent.
The decision we're trying to make is whether this message:
this-is-my-key =| ~/projects/mozilla-unified central ⍉ | |
| ▶ ./mach build -j80 | |
| 0:00.49 /home/zbraniecki/.mozbuild/tup/tup upd /home/zbraniecki/projects/mozilla-unified/obj-x86_64-pc-linux-gnu-opt/<default> --debug-logging -j80 | |
| 0:00.49 [ tup ] [0.001s] Scanning filesystem... | |
| 0:01.79 [ tup ] [1.296s] Reading in new environment variables... | |
| 0:01.79 [ tup ] [1.296s] No Tupfiles to parse. | |
| 0:01.79 [ tup ] [1.296s] No files to delete. | |
| 0:01.86 [ tup ] [1.367s] Executing Commands... | |
| Traceback (most recent call last): | |
| File "/usr/lib/python2.7/logging/__init__.py", line 892, in emit |
| diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp | |
| --- a/dom/base/nsDocument.cpp | |
| +++ b/dom/base/nsDocument.cpp | |
| @@ -3360,6 +3360,13 @@ nsIDocument::LocalizationLinkAdded(Eleme | |
| AutoTArray<nsString, 1> resourceIds; | |
| resourceIds.AppendElement(href); | |
| mDocumentL10n->AddResourceIds(resourceIds); | |
| + } else if (mReadyState == READYSTATE_COMPLETE) { | |
| + // Otherwise, if the document has already been parsed | |
| + // we need to lazily initialize the localization. |
| diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp | |
| --- a/dom/base/nsDocument.cpp | |
| +++ b/dom/base/nsDocument.cpp | |
| @@ -3360,6 +3360,12 @@ nsIDocument::LocalizationLinkAdded(Eleme | |
| AutoTArray<nsString, 1> resourceIds; | |
| resourceIds.AppendElement(href); | |
| mDocumentL10n->AddResourceIds(resourceIds); | |
| + } else if (mReadyState == READYSTATE_COMPLETE) { | |
| + // Otherwise, if the document has already been parsed | |
| + // we need to lazily initialize the localization. |
| <Localized | |
| id="create-account" | |
| confirm={ | |
| <button onClick={createAccount}></button> | |
| } | |
| cancel={ | |
| <Link to="/"></Link> | |
| }> | |
| <p>{'<confirm>Create account</confirm> or <cancel>go back</cancel>.'}</p> | |
| </Localized> |
| extern crate syn; | |
| #[macro_use] | |
| extern crate quote; | |
| extern crate proc_macro2; | |
| use quote::ToTokens; | |
| use proc_macro2::{Ident, Span}; | |
| /** | |
| * Generate a boilerplate for a plural rule function. |
| if exists("b:current_syntax") | |
| finish | |
| endif | |
| syntax match fluentComment "\v#.*$" | |
| syntax match fluentIdentifier "^\v[a-zA-Z-]+" nextgroup=fluentDelimiter | |
| syntax match fluentDelimiter "\s*=\s*" contained skipnl nextgroup=fluentPattern | |
| syntax region fluentPattern contained start="" end="\v^(( )@!|( +[\.\[\*\}])@=)" contains=fluentPlaceableExpression | |
| syntax match fluentAttribute "\v\.[a-zA-Z-]+" nextgroup=fluentDelimiter | |
| syntax region fluentPlaceableExpression contained matchgroup=fluentPlaceableBraces start=+{+ end=+}+ contains=@fluentExpression |
| #! /usr/bin/env bash | |
| # trizen -S python2-virtualenv | |
| # virutalenv2 migrate | |
| # source migrate/bin/activate | |
| # pip install mercurial | |
| # pip install python-hglib | |
| # sh ./ftl_migration.sh | |
| function interrupt_code() | |
| # This code runs if user hits control-c |
| This is a pretty unscientific study. I just had a browser with ~12 tabs open, including 3x gmail, slack, facebook, telegram, irccloud and a bunch of more static pages. | |
| I placed Firefox window on half of my screen and terminal on the other. Selected the last tab (google results) and waited ~2 minutes, | |
| until CPU was low. | |
| Then I turned on powerstat, waited for 8 samples with Fx window not in focus, then started scrolling through each tab one after another. | |
| I did this for about ~1min and then waited one more minute with Firefox not in focus (back on google search results). | |
| Then I restarted the browser with WebRender on and performed the same procedure. |
| key = Value | |
| .attr = Attribute | |
| .attr2 = Attribute 2 | |
| key.attr = Attribute | |
| key.attr2 = Attribute 2 | |
| key | |
| .attr = Attribute | |
| .attr2 = Attribute 2 |