Speedcubing-Canada / speedcubing-canada-web

https://speedcubingcanada.org
2 stars 3 forks source link

Support localization #30

Closed JonEsparaz closed 1 year ago

JonEsparaz commented 1 year ago

With the addition of #29, we need to support localization. This is a simple implementation that could be improved upon in the future. Parts of the implementation are dependent on there only being two languages (English and French).

On the home page, there is a link/button to switch language:

image

The user's choice is cached locally. The website's routes now support localization (e.g., /fr/about) and the old, non-localized routes (e.g., just /about). The user can also change language via the URL.

We always fallback to English if an unsupported locale is supplied in the URL param.