Skip to content
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

WIP: start l10n tooling #486

Merged
merged 17 commits into from
Oct 17, 2018
Merged

WIP: start l10n tooling #486

merged 17 commits into from
Oct 17, 2018

Conversation

groovecoder
Copy link
Member

@groovecoder groovecoder commented Sep 29, 2018

No description provided.

@groovecoder groovecoder force-pushed the add-fluent-for-l10n branch 4 times, most recently from 8fc7c4a to 8082cb3 Compare September 30, 2018 00:11
.env-dist Outdated
@@ -4,6 +4,9 @@ SERVER_URL=http://localhost:6060
PORT=6060
COOKIE_SECRET=3895d33b5f9730f5eb2a2067fe0a690e298f55f5e382c032fd3656863412

# available languages for l20n
AVAILABLE_LANGUAGES="de,en,es,fr,it,ja,pt,ru,zh"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this account for en-US, en-CA, en-UK, etc?

Copy link
Member Author

Choose a reason for hiding this comment

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

We should thoroughly test, but the accept-language module says that get will "Get the most likely language given an Accept-Language string".

.eslintignore Outdated
@@ -3,3 +3,4 @@ coverage
loadtests
public/dist
public/js/polyfills
public/js/l20n.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Oy vey! Any chance we can import via npm versus copy-pasta this file below?

middleware.js Outdated

function pickLanguage (req, res, next) {
acceptLanguage.languages(AppConstants.AVAILABLE_LANGUAGES.split(","));
req.app.locals.locale = acceptLanguage.get(req.headers["accept-language"]);

This comment was marked as resolved.

Copy link
Member Author

Choose a reason for hiding this comment

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

Code looks like it will default to whatever is the first language tag specified in acceptLanguage.languages. So in our case - yes.


terms = Terms and Privacy

copyright = Portions of this content are © 1998-2018 by individual mozilla.org contributors. Content available under a Creative Commons license
Copy link
Contributor

Choose a reason for hiding this comment

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

Actual markup below is:

<p data-l10n-id="copyright">
  Portions of this content are &copy; 1998-2018 by individual mozilla.org contributors.
  <br />
  Content available under a <a {{> analytics/link_event eventLabel="Creative Commons"}} href="https://www.mozilla.org/foundation/licensing/website-content/" target="_blank" rel="noopener">Creative Commons license</a>.
</p>

Not sure if the .ftl files should use &copy; entity or if we need anything special for link preserving.


terms = Allgemeine&nbsp;Geschäftsbedingungen&nbsp;und&nbsp;Datenschutzerklärung

copyright = Teile dieses Inhalts sind © 1998-2018 von einzelnen mozilla.org-Mitwirkenden. Inhalt verfügbar unter einer Creative Commons-Lizenz
Copy link
Contributor

Choose a reason for hiding this comment

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

/cc @flodolo @stasm

Do either of you have any guidance or suggestions on bundling the .ftl files directly in the source repo, versus doing something like a separate "blurts-server-l10n" repo for translations?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Reasons to use a different repository:

  • History: Pontoon will write in the repository every 20 minutes, once for each locale (if there are changes). History is going to become messy very quickly.
  • Decouplement: You can develop on master and decide when strings are ready for translation.

Cons:

  • You need scripts to import strings back.
  • You need to expose strings in the l10n repository via PR.

Alternatively, we can also write in a branch instead of master, but then you need to deal with merges back and forth.

Side note: we'll need a dev server updated frequently for l10n testing. For that it might be easier to have the strings in the main repository.

From the point of view of configuration, if you want Pontoon to write here we just need to add its bot.

Copy link
Member Author

Choose a reason for hiding this comment

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

@flodolo can you point us to examples of each kind of setup? I.e., same-repo vs. separate-repo?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Screenshots and Test Pilot have strings in the main repo
https://github.com/mozilla-services/screenshots/
https://github.com/mozilla/testpilot/

For Test Pilot we use a l10n branch.

Other products use a repo for strings, but I don't have website examples at hands
strings: https://github.com/mozilla-l10n/firefoxios-l10n
code: https://github.com/mozilla-mobile/firefox-ios

Copy link
Contributor

Choose a reason for hiding this comment

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

The one separate-repo I can remember off the top of my head is FxA's content server:

https://github.com/mozilla/fxa-content-server
vs
https://github.com/mozilla/fxa-content-server-l10n

I think the trick was putting a package.json in the *-l10n repo so you can include it as a dependency in your main repo's package.json. But of course, as I went to prove that, I notice that FxA team is using some Bash script[1] to download locales, so we may want to sync up with them to see why they switched to doing it that way (or maybe I'm misremembering how it was done originally).

[1] https://github.com/mozilla/fxa-content-server/blob/master/scripts/download_l10n.sh

@stasm
Copy link
Contributor

stasm commented Oct 1, 2018

Thanks for the CC and for kicking this off.

l20n.js hasn't been actively developed in more than a year. We shifted focus completely to Fluent. I should really get to deprecating it officially (l20n/spec#17).

Instead, we have developed fluent (for parsing FTL files and formatting translations) and fluent-dom (for localizing the DOM), although they might require some additional work to set up. fluent-dom doesn't initialize the localization of the document automatically during the load of the page. Some glue code is needed to parse the links to FTL files form <head> and start the localization of the document.

There's an experimental packaged called fluent-web which provides this glue code together with the dependencies. We haven't had a strong driver to work on it recently. @zbraniecki will know the latest status of it.

For language negotiation there's also fluent-langneg which is well-tested and used by a number of other Mozilla web projects. It might make sense to use it here, too, although other packages available on npm should be OK as well.

@pdehaan
Copy link
Contributor

pdehaan commented Oct 1, 2018

Another good reference for fluent lib usage is the https://github.com/mozilla/send repo.

@groovecoder groovecoder force-pushed the add-fluent-for-l10n branch 2 times, most recently from 0e140e5 to 29aef58 Compare October 2, 2018 15:32
@groovecoder
Copy link
Member Author

I looked thru send, screenshots, testpilot, and fluent-web and I prefer fluent-web by a large margin. I tried to simply replace l20n.js with fluent-web.js but it looks like fluent-web has some making & building steps that I can't figure out.

How long would it take to get fluent-web up to a usable state like l20n.js? Can it be done by the end of this week?

If not, I'll start digging into using fluent-dom directly.

@zbraniecki
Copy link

but it looks like fluent-web has some making & building steps that I can't figure out.

hg clone https://github.com/projectfluent/fluent-web
cd fluent-web
npm i
make build
open ./examples/simple.html

does that work?

@groovecoder
Copy link
Member Author

I get SyntaxError: import declarations may only appear at top level of a module fluent-web.js:2

@groovecoder
Copy link
Member Author

I'm happy to move this over to a fluent-web issue.

@groovecoder
Copy link
Member Author

Opened projectfluent/fluent-web#2

@groovecoder groovecoder force-pushed the add-fluent-for-l10n branch 3 times, most recently from 53016bb to cb93013 Compare October 3, 2018 21:32
@groovecoder
Copy link
Member Author

Still waiting to see if we can use fluent-web for the front-end l10n, but I made a significant change to this PR for back-end l10n ...

  1. On server start-up:
    • scan public/locales directory for available languages
    • instantiate a FluentBundle for each language
    • keep both in app.locals
    • app.use(pickLanguage) middleware
  2. During request:
    • pickLanguage checks Accept-Language and sets appropriate req.locale and req.fluentBundle
  3. In back-end code, e.g., controllers/home.js, use req.fluentBundle.format(req.fluentBundle.getMessage("notFound") where it used to have the hard-coded English message.
    • (could probably condense this with a locale.bundleMessage() helper function

This seems to work fine!

screen shot 2018-10-03 at 4 34 46 pm

And it feels simpler than some of the other approaches I saw in send, testpilot, screenshots, etc.

Does it seem sane?

@pdehaan
Copy link
Contributor

pdehaan commented Oct 3, 2018

One further wrench into the plan is that the presence of a directory/file isn't always an indicator of translation %%.

In other repos (like mozilla/send) we had a script which would only include locales that are 100% translated. I think mozilla/fxa-content-server had a lower threshold (90%) before it would be considered ready for production.

@@ -22,7 +23,8 @@ function home(req, res) {

function notFound(req, res) {
res.status(404);
res.render("error", { message: "Page not found." });
const message = req.fluentBundle.format(req.fluentBundle.getMessage("notFound"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is per-user and probably not suited for app.locals.*, would it be possible to wrap this in some sort of helper function or middleware to cut down on verbosity?

function formatMessage(bundle, message) {
  return bundle.format(bundle.getMessage(message));
}

...

const message = formatMessage(req.fluentBundle, "notFound");

email-utils.js Outdated
@@ -45,6 +45,7 @@ const EmailUtils = {

sendEmail(aRecipient, aSubject, aTemplate, aContext) {
if (!gTransporter) {
// TODO: l10n?
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this message even user facing, or is this purely server logging?

locale-utils.js Outdated


function loadAvailableLanguages () {
return fs.readdirSync( localesDir );
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this needs any footgun protection to capture stuff like .DS_Store or other files which may not be in the locales/* dir. Or if we need to add filter out any results that aren't a subdirectory, etc.

locale-utils.js Outdated
function loadFluentBundles (availableLanguages) {
const fluentBundles = {};
for (const lang of availableLanguages) {
const langFTLSource = fs.readFileSync(path.join(localesDir, lang, "app.ftl"), "utf8");
Copy link
Contributor

Choose a reason for hiding this comment

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

Or if this needs to be in a try..catch to handle any folders/results which may not be a subdirectory, or there may not be an "app.ftl" file.


<meta name="defaultLanguage" content="en">
<meta name="availableLanguages" content="{{ AVAILABLE_LANGUAGES }}">
<link rel="localization" href="/locales/{{ locale }}/app.ftl">
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, because we're changing the views/layouts/default.hbs template, we'll need to decide what level we want to keep that views/error-429.html template in sync (since we have-to/should update the markup in both places).

@groovecoder groovecoder force-pushed the add-fluent-for-l10n branch 3 times, most recently from bb8af38 to 85a5f95 Compare October 4, 2018 19:13
@groovecoder
Copy link
Member Author

Addressed all comments except the template-level ones. (Still checking if we'll be able to use fluent-web for template strings, or if we'll make a handlebars helper for them.)

Consolidated some of the server start-up code into a single locale.loadLanguagesIntoApp function.

Made the pickLanguage middleware also add a fluentFormat helper on the request object, so calling code can be simplified to, e.g., req.fluentFormat("notFound")

@groovecoder
Copy link
Member Author

The %-checking heuristic seems neat, but how helpful is it?

The fxa-content-server check just seems to check that a translated message is non-blank, which ignores up-to-date-ness of the translations; the send check for 100% no errors nor missing translations means (like you say in the PR) that any update to en-US invalidates all translations until they are back to 100%?

Either tooling tactic seems to rely on a significant amount of manual translation support anyway. Does the tooling help notify the human translators of the updates needed?

@groovecoder groovecoder force-pushed the add-fluent-for-l10n branch 2 times, most recently from b82397e to 0734f7f Compare October 4, 2018 19:48
That's good news, but data breaches can happen any time and there is still more you can do.
Subscribe to Firefox Monitor for a full report, alerts when new breaches happen, and tips on protecting your passwords.

featured-breach-results =
Copy link
Collaborator

Choose a reason for hiding this comment

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

@stasm I'm still running into some selector trouble here in "featured-breach-results". As is, this throws a "ctor is not a constructor" error. If I change [one] to [1], the string will return correctly only if the value of $breachCount is exactly 1. I'm totally puzzled as I recreated this over in the Fluent playground where it appears to be working exactly as expected. Have you run into anything like this?

Copy link
Contributor

Choose a reason for hiding this comment

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

This might be related to the Intl.PluralRules API. It's still a fairly new feature in JavaScript. Looking at the browser support matrix, is there a chance you're testing on Safari? In order to support Safari as well as older browsers, you'll need to polyfill Intl.PluralRules. I recommend intl-pluralrules.

Background: Fluent relies on this API to match variant keys which are not numbers. When you use [one] Fluent maps the numerical value of $breachCount to a plural category. Categories are defined in CLDR. For English, they're one and other. Other languages have fewer or more.

Copy link
Member Author

Choose a reason for hiding this comment

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

Aha, node.js is probably the culprit here - it doesn't have support for Intl.PluralRules API. I'll see if I can add that to our package.json and get this to work.

const path = require("path");

// node.js needs Intl.PluralRules polyfill
require("intl-pluralrules");
Copy link
Member Author

Choose a reason for hiding this comment

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

its-working-its-working

Copy link
Collaborator

Choose a reason for hiding this comment

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

I can't even find a good enough emoji.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Happy to hear that was it!

@groovecoder
Copy link
Member Author

Updated to have fluentFormat add messages from all .ftl files in the in public/locales/{lang}/ directories.

@@ -0,0 +1,35 @@
-product-name = Firefox Monitor
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a note similar to the one in the add-on, extending it to all brands in this section?

-brand-name = Firefox
-brand-Quantum = Firefox Quantum
-brand-Mozilla = Mozilla
-brand-HIBP = HIBP
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a note to explain what HIBP stands for.

# Descriptive headline for a column of links where users can give feedback, or get additional information about, Firefox Monitor.
layout-support = Support
# Link that takes the user to a Firefox Monitor survey.
give-feedback = <span class="nowrap">Give Feedback</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to avoid exposing this markup to localizers (same for the next string)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep, we can move this to template.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll remove it wherever possible. Unfortunately, for cases like L82 and a few others, it will need to remain as is.

error-not-subscribed = This email address is not subscribed to {-product-name}.
error-hibp-throttled = Too many connections to {-brand-HIBP}.
error-hibp-connect = Error connecting to {-brand-HIBP}.
error-hibp-load-breaches = Could not load breaches.
Copy link
Collaborator

Choose a reason for hiding this comment

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

breaches -> data breaches?

Copy link
Collaborator

@lesleyjanenorton lesleyjanenorton Oct 16, 2018

Choose a reason for hiding this comment

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

I think L16-L18 are actually log errors and may not need to be localized at all. @groovecoder do we want to localize these?

error-hibp-connect = Error connecting to HIBP.
error-hibp-load-breaches = Could not load breaches.

hibp-notify-email-subject = {-product-name} Alert : Your account was involved in a breach.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still open question. Is it because it's the title of a web page?

And hackers rely on bad habits, like using the same password everywhere or using common phrases (p@ssw0rd, anyone?),
so that if they hack one account, they can hack many. Here are six ways to protect your accounts.

pwt-headline-1 = Use a Different Password for Every Account
Copy link
Collaborator

Choose a reason for hiding this comment

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

I pointed out before that this approach doesn't scale. Group headline and summary with meaningful IDs, don't use numbers.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think in this case the numbers are meaningful because the password tips are specifically presented in the order that they are numbered. Additionally, the tips are displayed alongside corresponding icons which are also numbered accordingly. I will happily defer to your judgement here if you think this is going to cause future problems though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Regarding the colon spacing on L13 (for some reason I can't respond to that comment directly): We just received updated copy for the emails and the extra space has been removed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Additionally, the tips are displayed alongside corresponding icons which are also numbered accordingly.

How is that done? Have you considered other types of numerals?

I will happily defer to your judgement here if you think this is going to cause future problems though.

Two likely scenarios:

  • You want to change the order.
  • You want to replace or update one of the tips. You'll need to change the message ID to do that.

In both cases you'll need to add a mapping afterward.

Also, strings are presented sequentially to localizers, so having title and description together help a bit.

-brand-Quantum = Firefox Quantum
-brand-Mozilla = Mozilla
-brand-HIBP = HIBP
-product-name-nowrap = <span class="nowrap">Firefox Monitor</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be easier to use a non breaking space in the main brand name, and always use that?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Potentially - we've discussed this in previous pull requests and my understanding is that   is deprecated and there are a11y concerns with using it.

form-signup-error = Must be a valid email.


found-breaches-headline = This could be a problem...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use single unicode character

}.

scan-results = Your account { $breachCount ->
[0] Your email address did not appear in our basic scan.
Copy link
Collaborator

@flodolo flodolo Oct 16, 2018

Choose a reason for hiding this comment

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

@stasm @zbraniecki Thoughts on using Fluent like this, also in the previous string?

I really think we should split out the 0 case. If nothing else for practical reasons: it would be impossible to translate this in Pontoon, where there no text area for variants.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@flodolo thanks for the feedback. Is it possible to translate any variant in Pontoon, or is there a specific issue with the zero case?

Copy link
Collaborator

Choose a reason for hiding this comment

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

screen shot 2018-10-16 at 4 25 07 pm

Was following this example and a similar example of usage here: https://projectfluent.org/play/

Copy link

Choose a reason for hiding this comment

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

This is perfectly fine Fluent, it's just tricky for localizers to understand what we're asking them to translate.

It becomes easier if we're exposing the full phrase for each variant.

There's things we'll want to do on the l10n tooling side there in the next year, but right now, the extra repetition of the head and tail section would be good.

single-featured-breach-result = Your account appeared in the <span class="bold"> { $featuredBreach } </span> breach, but did not appear in any other known data breaches.
multiple-featured-breach-results =
  {  $breachCount ->
        [one] Your account appeared in the <span class="bold"> { $featuredBreach } </span> breach, as well as { $breachCount } other breach.
       *[other] Your account appeared in the <span class="bold"> { $featuredBreach } </span> breach, as well as { $breachCount } other breaches.
  }

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Pike thanks for the clarification

Copy link
Collaborator

Choose a reason for hiding this comment

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

What Pike said :)

The UI looks like this. The fragment before would become another input field, and you would need to drag the input field to see everything.

Copy link
Collaborator

@flodolo flodolo Oct 17, 2018

Choose a reason for hiding this comment

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

To be clear, I would do this

featured-breach-no-results = 
  Your account appeared in the <span class="bold"> { $featuredBreach } </span> breach, 
  but did not appear in any other known data breaches.

featured-breach-results =
    { $breachCount ->
        [one] Your account appeared in the <span class="bold"> { $featuredBreach } </span> breach, as well as { $breachCount } other breach.
      *[other] Your account appeared in the <span class="bold"> { $featuredBreach } </span> breach, as well as { $breachCount } other breaches.
    }

scan-no-results = 
    Your email address did not appear in our basic scan.
    That's good news, but data breaches can happen any time and there is still more you can do. 
    Subscribe to Firefox Monitor for a full report, alerts when new breaches happen, and tips on protecting your passwords.
    
scan-results = 
  { $breachCount ->
      [one] Your account appeared in the following breach.
     *[other] Your account appeared in the following { $breachCount } breaches.
  }

Note also that your current string would result in Your account Your email address did not appear in our basic scan. etc

Copy link
Contributor

Choose a reason for hiding this comment

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

I really think we should split out the 0 case. If nothing else for practical reasons: it would be impossible to translate this in Pontoon, where there no text area for variants.

From the Fluent perspective, I think using [0] like this is fine and it adds flavor to the translation. The Good Practices document has more discussion about this.

However, if Pontoon doesn't support extra variants right now, we should avoid it (for now). Sorry, @lesleyjanenorton! We'll get there eventually :)


# copyright-info (without markup) = Portions of this content are 1998-2018 by individual mozilla.org contributors. Content available under a Creative Commons license.
copyright-info =
Portions of this content are <span class="copyright-symbol">&copy;</span> 1998-2018 by individual mozilla.org contributors. <br />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please no HTML entities, use the utf-8 characters (©)

email-messages = Email messages
employers = Employers
ethnicities = Ethnicities
family-members'-names = Family members' names
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm pretty sure the ' in the ID is a parsing error. The string, on the other hand, should use an apostrophe

@groovecoder
Copy link
Member Author

After @lesleyjanenorton's updates, I added commits to remove the test de/app.ftl file, to move public/locales to locales at the base of the repo, and to check for NODE_ENV === "heroku" to enable pontoon JS for in-page localization.

I've also pushed this branch directly to https://fx-breach-alerts.herokuapp.com/ so we can see this code running live before our upcoming meeting.

(Note: @lesleyjanenorton I'm getting error {"stack":"TypeError: dataClasses.split is not a function at Object.breachDataClasses (/Users/lcrouch/code/mozilla/blurts-server/hbs-helpers.js:28:71) on http://localhost:6060/user/verify?token=87dea900-428d-4b71-aad9-16b9ceb7ed92. Trying to track it down now.)

@flodolo
Copy link
Collaborator

flodolo commented Oct 17, 2018

to check for NODE_ENV === "heroku" to enable pontoon JS for in-page localization.

I'm not exactly sure if that works reliably, or for Fluent projects. @mathjazz ?

@groovecoder groovecoder temporarily deployed to fx-breach-alerts October 17, 2018 16:17 Inactive
@mathjazz
Copy link
Contributor

I'm not exactly sure if that works reliably, or for Fluent projects. @mathjazz ?

In theory it works, but requires additional testing. AFAICT, it hasn't been used in combination with a Fluent.

I suggest we don't block enabling localization on it and enable in-place localization as a follow-up.

@groovecoder
Copy link
Member Author

In our case, I've specifically set NODE_ENV=heroku using heroku:config so it should work for us. Not sure what the broader NODE_ENV convention is.

I've also fixed the error on /user/verify so the text actually shows, though the page styles are messed up.

screen shot 2018-10-17 at 11 17 44 am

# - Declined to adapt to grammatical case.
# - Transliterated.
# - Translated.
-product-name = Firefox Monitor
Copy link

Choose a reason for hiding this comment

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

If you're making this Firefox{"\u00A0"}Monitor (aka nbsp), you probably get around the dom fragments and the nowrap, and that might also be good for a11y?

Copy link
Member Author

Choose a reason for hiding this comment

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

Filed #535 for a follow-up on this.

@groovecoder
Copy link
Member Author

I'm merging this now, as it touches so many files and is preventing us from doing much else until it's merged.

Filed #533 for email localization, #534 for the heroku/in-page localization follow-up, #535 for &nbsp; discussion & decision, and #524 to verify that @mozilla-pontoon can/will create the launch .ftl files in the repository for launch.

They are all in the l10n label now.

@groovecoder groovecoder merged commit c721f33 into master Oct 17, 2018
@groovecoder groovecoder deleted the add-fluent-for-l10n branch October 17, 2018 20:04
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.

8 participants