fluent-lua icon indicating copy to clipboard operation
fluent-lua copied to clipboard

Provide compatability shim to i18n

Open alerque opened this issue 4 years ago • 0 comments

The i18n.lua project has a fairly mature localization implementation all on it's own. The Lua API works like most other gettext() interfaces to date. It isn't nearly as flexible as Fluent but it's on par with most other systems. Most interesting to this feature suggestion is how widely adopted it is already.

One thing we could probably do is provide a shim module (as a sub-module) not included by default but that would return a compatible interface. The backend would load data from *.ftl sources per our Fluent syntax parser, build an AST as normal, then pare it down to just the parts that the i18n module will understand and populate it as a data set, then let people query it through i18n as usual.

Only the way the populated their data would have to change out of the gate so migration would be easy. Code could be updated to use the Fluent interface on an ad-hoc basis.

alerque avatar Sep 13 '19 13:09 alerque