Open zakkudo opened 6 years ago
As it is now, to work around it I have to do:
import y18n from 'y18n';
const instance = y18n({updateFiles: false});
instance.setLocale('language');
instance.cache['language'] = {};
const translation = instance.__('translate this!');
I wrote a static parser for webpack that reads the source files and uses y18n to generate the json file. But cache isn't part of the public api and there is no way to keep readFile from being called in a browser. Is there any way to make this more flexible?
https://github.com/zakkudo/translation-static-analyzer https://github.com/zakkudo/translate-webpack-plugin
I plan on making npm packages by next week for this, which will be a bit easier to test with....