I have crossed the land and walked through fire for a plain gettext JavaScript library that accepts standardized JSON translation objects, but to no avail. So I checked the source and realized what a small change be needed for this excellent lib to support this.
The case is I want to use standardized gettext that's populated with translations at runtime in the browser, without doing HTTP requests to .po files (i.e. the translations are bundled in the JavaScript file).
Do you think this goes against the purpose of this library?
Is the truthiness of file.translations a stable enough check for an already parsed JSON object?
If not, yay! If so, I'll make a new npm package that simply extends this one with that simple check.
Hi!
I have crossed the land and walked through fire for a plain gettext JavaScript library that accepts standardized JSON translation objects, but to no avail. So I checked the source and realized what a small change be needed for this excellent lib to support this.
The case is I want to use standardized gettext that's populated with translations at runtime in the browser, without doing HTTP requests to .po files (i.e. the translations are bundled in the JavaScript file).
file.translations
a stable enough check for an already parsed JSON object?If not, yay! If so, I'll make a new npm package that simply extends this one with that simple check.