r7-labs / R7.Dnn.Extensions

A base library for DNN Platform extensions development
GNU Lesser General Public License v3.0
5 stars 5 forks source link

Localizer class #36

Open roman-yagodin opened 4 years ago

roman-yagodin commented 4 years ago

Extract localizer class to reuse in different scenarios.

It can use different backends (DNN, NGettext).

DNN backend will resource file root file, NGettext backend - text catalog.

Backport some code from R7.Epsilon for the case of "single" resource file for entire extension / subsystem.

DNN backend will need to implement plural forms.

NGettext backend will possibly need to implement DNN-like Host/Portal overrides. E.g. we would have several text catalogs under the hood, and try to get string from Portal one, then from Host one, and only then from System one.

Also would be nice to provide relative benchmarks of both backends.

Viewmodel context classes could reuse existing localizers.