Skip to content

Repository files navigation

@magic-modules/language-switch

this is the @magic-modules LanguageSwitch component. It provides a dynamic language switch menu

it redirects your current page to any of the other language versions that exist, but also assumes that there are alternatives for every language.

html docs

NPM versionLinux Build StatusWindows Build StatusCoverage StatusGreenkeeper badgeKnown Vulnerabilities

install:

npm install --save-exact @magic-modules/language-switch

usage:

// in any component ViewexportconstView=state=>div({class: 'page'},LanguageSwitch(state)),}
language pages

create your languages in the pages directory, for example:

/pages/
index.js // english page
/de/
index.js // german page
required app state'),

LanguageSwitch needs to know about the languages in your app.

// /assets/app.jsexportconststate={// ... other app statelanguages: [// the first language is the default fallback{code: 'en',to: '/',text: 'english'},{code: 'de',to: '/de/',text: 'deutsch'},],}

thats it, your magic app now knows about your languages

changelog

0.0.1

first release

0.0.2

bump required node version to 14.2.0

0.0.3

bump required node version to 14.15.4

0.0.4

do not use root to build language link to value

0.0.5
  • allow multiple languages to be shown correctly
0.0.6

update dependencies

0.0.7 - unreleased

...

About

@magic languageswitcher. dynamically links to the current page in all other configured languages.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages