However, it often makes sense for other teams to factor out code into shared libraries, stripes-erm-components for example, and, as the ecosystem grows, other vendors will as well. We are running up against this in the ReShare project. Inevitably, these shared codebases will want to include strings and strings need translations.
Approach
A new key in the stripes section of package.json: translateDepsstripesDeps. This will take an array of resolvable dependencies of your module that have translations needing to be pulled in (and, later, can have other stripes-specific resources gathered). stripes-translations-plugin can aggregate and deduplicate this list for inclusion.
Environment
None
Potential Workaround
None
Checklist
hide
TestRail: Results
Activity
Show:
Matt Jones February 4, 2020 at 2:48 PM
with whatever finds the icons (there is no stripes-icons-plugin).
That metadata along with translation references and branding are gathered together in stripes-config-plugin.
Jason Skomorowski February 4, 2020 at 1:37 PM
Good point Zak. I did in that I named it stripesDeps so that it can be used for more general purposes than translations. However, the implementation only handles translations as icons are done completely separately eg. the hardcoded list of stripes-components, stripes-core etc. is directly in stripes-tranlsations-plugin.js and not shared with whatever finds the icons (there is no stripes-icons-plugin).
Zak Burke January 30, 2020 at 4:49 PM
Could we build this in such a way that we also expose package resources such as icons (and sound?) to being pulled into the bundle?
Purpose
Currently translations are only gathered from Stripes modules (eg. apps, plugins, etc.) and this hardcoded list of common libraries:
https://github.com/folio-org/stripes-core/blob/master/webpack/stripes-translations-plugin.js#L19
However, it often makes sense for other teams to factor out code into shared libraries,
stripes-erm-components
for example, and, as the ecosystem grows, other vendors will as well. We are running up against this in the ReShare project. Inevitably, these shared codebases will want to include strings and strings need translations.Approach
A new key in the
stripes
section of package.json:translateDeps
stripesDeps
. This will take an array of resolvable dependencies of your module that have translations needing to be pulled in (and, later, can have other stripes-specific resources gathered). stripes-translations-plugin can aggregate and deduplicate this list for inclusion.