On Thursday, August 17, 2017 at 9:04:23 AM UTC-7, Staś Małolepszy wrote:
> I disagree. There's nothing in Project Fluent that requires or forces
> async. Moreover I don't think async should be an explicit goal for us.

Good point.

I believe it's worth considering fallback enabled approach to be at least as 
useful as sync, for example when naming things.
I'd like to consider it to avoid ending with "get" and "getAsync" if "get" and 
"async will become the most common ones in the future.

> Given how well implemented the i18n API has become across modern
> browsers, I'd like to think how we can improve the existing API within
> the constraints of the current, sync paradigm. The existing API solved
> a number of challenges: translation loading, CSS localization, and
> manifest localization to name a few.

I don't believe we have to push for API compatibility. The standardization 
process is a perfect place to revisit the API decisions with an open mind and 
willingness to break things.
Whatever ends up getting standardized will be different from webextensions API 
as of today and will require changes to extensions.
We shouldn't change things without purpose, but I don't think we have to 
sacrifice the API quality for compatibility 
 
> Perhaps there's an avenue here for us to consider: introduce a sync
> sister-method called getFormattedMessage(id, namedArgs) which uses the
> same logic for translation loading but uses messages.ftl files rather
> than message.json? In CSS and manifest files, the __FTL_ prefix could
> be used similar to the current __MSG_ one.
> 
> This would allow us to start using FTL in Web Extensions without
> reinventing the whole workflow and the loading story.
> 
> What do you think about this meet-them-half-way approach?

I'm for it. This sounds good.

The only thing is the function name. I'd like to think about the name for the 
sync which plays well with us potentially adding fallback-enabled async one 
later.

so, if we go for `getFormattedMessage` for the sync, then would the async be 
`formatMessage`? Or should we aim for `formatMessageSync` and `formatMessage`?

zb.
_______________________________________________
tools-l10n mailing list
[email protected]
https://lists.mozilla.org/listinfo/tools-l10n

Reply via email to