This is a Rollup plugin that helps you to translation strings in JavaScript that are used in Drupal websites.
Based on DrupalTranslationsWebpackPlugin.
npm install --save-dev rollup-plugin-drupal-interface-translations
import drupalInterfaceTranslations from 'rollup-plugin-drupal-interface-translations';
// https://rollupjs.org/configuration-options/
export default {
input: 'main.js',
plugins: [drupalInterfaceTranslations()],
};
This plugin can be used with Vite.
import { defineConfig } from 'vite';
import drupalInterfaceTranslations from 'rollup-plugin-drupal-interface-translations';
// https://vitejs.dev/config/
export default defineConfig({
build: {
rollupOptions: {
input: 'main.js',
plugins: [drupalInterfaceTranslations()],
},
},
});
Defines the files that are included in and excluded from interface translation extraction.
There are the parameters for the createFilter function in @rollup/pluginutils.
Type
: string
Default
: "translations/{MODULE_NAME}.pot"
The file path relative of the .pot (portable object template) file that this plugin will generate.
The Exploratorium is a 501(c)(3) nonprofit organization. Our tax ID #: 94-1696494