Skip to content

locale support #24

Open
Open

Description

@nvdk

Unfortunately the alpine base image does not support different locales and for some projects we do have a need of localizing date formats. Currently it seems using musl-locale seems the most straightforward way to support this.

I'm creating this issue so it's easier to find a solution for people running into the same thing + perhaps consider adding musl_locale to the base javascript template?

See also https://grrr.tech/posts/2020/add-locales-to-alpine-linux-docker-image/

For basic locale support, add the following to your docker file

ENV MUSL_LOCALE_DEPS cmake make musl-dev gcc gettext-dev libintl 
ENV MUSL_LOCPATH /usr/share/i18n/locales/musl

RUN apk add --no-cache \
    $MUSL_LOCALE_DEPS \
    && wget https://gitlab.com/rilian-la-te/musl-locales/-/archive/master/musl-locales-master.zip \
    && unzip musl-locales-master.zip \
      && cd musl-locales-master \
      && cmake -DLOCALE_PROFILE=OFF -D CMAKE_INSTALL_PREFIX:PATH=/usr . && make && make install \
      && cd .. && rm -r musl-locales-master

Activity

  1. added
    Q&AQuestions and answers; tips for other users.
    on Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Q&AQuestions and answers; tips for other users.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions