an optional pages parameter for each locale allows to limit generation of localized pages by providing an array of RexExp strings
localizedPath (LocalizedRouter and LocalizedLink as well) falls back to defaultLang when pointing to a page that has not been localized in the locale.
LocalizedLink will only fall back to defaultLang if language is not explicitly set. This avoids having the active class triggered in a language switcher for instance.
Some further thoughts/options:
RegExps could be replaced by more friendly path patterns, by adding a dependency to node-match-path.
Alternatively, the fallback behaviour may be controlled via a fallback prop on LocalizedLink instead of relying on the language prop.
Hi,
This PR fixes https://github.com/gatsbyjs/themes/issues/128
pages
parameter for each locale allows to limit generation of localized pages by providing an array of RexExp stringslocalizedPath
(LocalizedRouter
andLocalizedLink
as well) falls back to defaultLang when pointing to a page that has not been localized in the locale.LocalizedLink
will only fall back to defaultLang if language is not explicitly set. This avoids having the active class triggered in a language switcher for instance.Some further thoughts/options:
node-match-path
.fallback
prop onLocalizedLink
instead of relying on thelanguage
prop.