Skip to content

Instantly share code, notes, and snippets.

@illepic
Created September 26, 2018 00:05
Show Gist options
  • Save illepic/71b5bd870bae9b06f9e8aa72444baa73 to your computer and use it in GitHub Desktop.
Save illepic/71b5bd870bae9b06f9e8aa72444baa73 to your computer and use it in GitHub Desktop.
Particle Drupal.t() integration
// apps/drupal/index.js
import { carousel } from '../../source/design-system';
Drupal.behaviors.carouselIntegration = {
attach($context) {
carousel.enable($context, {
strings: {
goBackText: Drupal.t('Go back'),
goForwardText: Drupal.t('Go forward'),
},
});
},
};
// src/_patterns/02-molecules/carousel/index.js
export function enable($context, settings) {
// ...
carouselPlugin.goBackText = settings.strings.goBackText;
carouselPlugin.goForwardText = settings.strings.goForwardText;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment