Last active
September 26, 2018 15:00
-
-
Save illepic/875bccfdc30822fd608b9a23a36bf50b to your computer and use it in GitHub Desktop.
Drupal.t() - Particle integration version 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/_patterns/02-molecules/carousel/index.js | |
import carouselPlugin from 'some/bloated/carousel/plugin/project'; | |
export function enable($context, settings) { | |
// ... | |
carouselPlugin.goBackText = settings.carousel.strings.goBackText || 'Go back'; | |
carouselPlugin.goForwardText = settings.carousel.strings.goForwardText || 'Go back'; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { enableAllComponents } from '../../source/design-system'; | |
console.log('drupal-theme ran'); | |
Drupal.behaviors.designSystem = { | |
attach($context, settings) { | |
const componentSettings = { | |
// Carousel settings! | |
carousel: { | |
strings: { | |
goForwardText: Drupal.t('Go forward'), | |
goBackText: Drupal.t('Go back'), | |
}, | |
}, | |
// Flerp component settings! | |
flerp: { | |
strings: { | |
merp: 'merp', | |
}, | |
height: settings.drupalCustomModule.height, // Note: this is how we pull in drupalSettings if needed | |
speed: settings.drupalCustomModule.speed, | |
}, | |
}; | |
enableAllComponents($context, componentSettings); | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment