stable

Clone or download

Read-only

Extract gettext factory component

So that we will have a standard way to load translations in various places of Tuleap. Currently all localized js scripts are loading fr.po every time, except ckeditor upload image plugin that is loading asynchronously fr.po if current language is fr_FR. With the new gettext factory, we will be able to pass a callback responsible of providing needed translation. See example in get-upload-image-options.js file. From this patch, contribution that is adding a new localized js script should use the gettext factory, and name .po file after the full locale (fr_FR.po instead of fr.po) A dedicated patch will be done for Vue apps (they are not using node-gettext). Part of story #13729: have taskboard empty state Change-Id: I70e97b2591ba81c7b73bb37438ce820b3e00c139

Modified Files

Name
A src/www/scripts/jest.config.js +25 −0 Go to diff View file
M src/www/scripts/package.json +1 −1 Go to diff View file
M src/www/scripts/tuleap/ckeditor/element-adapter.js +1 −1 Go to diff View file
M src/www/scripts/tuleap/ckeditor/file-upload-handler-factory.spec.js +4 −1 Go to diff View file
M src/www/scripts/tuleap/ckeditor/get-upload-image-options.js +4 −2 Go to diff View file
M src/www/scripts/tuleap/ckeditor/get-upload-image-options.spec.js +1 −1 Go to diff View file
R src/www/scripts/tuleap/ckeditor/po/fr.po Go to diff View file
R src/www/scripts/tuleap/ckeditor/gettext-factory.js Go to diff View file
A src/www/scripts/tuleap/gettext/gettext-init.js +40 −0 Go to diff View file
A src/www/scripts/tuleap/gettext/gettext-init.test.js +53 −0 Go to diff View file