every locale not listed (and uncommented) in /etc/locale.gen.įor a web application, it might be better to use setlocale() inside the program, rather than requiring that the system default locale be set appropriately outside. Sudo localedef -i en_GB -f UTF-8 en_GB.UTF-8īut this was not a permanent solution: I found that running locale-gen without the -keep-existing option will delete all such manually-generated locales, i.e. I was also able to generate locales manually like this: sudo localedef -i en_US -f UTF-8 en_US.UTF-8 However, when I modified that file manually and uncommented the locales that I wanted, then locale-gen started working properly: $ sudo locale-gen Running dpkg-reconfigure locales and selecting some locales did not update /etc/locale.gen as I expected it to. Generating locales (this might take a while). not generating any locales (none listed): $ sudo locale-gen I always got the following output from locale-gen, i.e. None of these answers worked for me, on an LXC container installed with: lxc-create -n sse-master -t download -n sse-master - \ There were a lot of Q&A entries regarding this subject but only a few were actually helpful. You can check that locale has been configured correctly by invoking locale. On the same shell, you will need to do source ~/.bashrc for the env vars to take effect immediately. # Uncomment en_US.UTF-8 for inclusion in generation The ff accomplished what I need but it should work just fine in an interactive shell. non-interactively) installed in a docker container. In my case I needed en_US.UTF-8 programmatically (i.e. After piecing together information from a few places, what worked for me was to (1) make sure the locale I wanted was available (generate it if it wasn't) then (2) set locale related environment variables to desired locale. If it's already installed, then dpkg-reconfigure locales will let you generate more locales.Īnswers here are incomplete as with most elsewhere. This will ask you which locales to generate. You may need to install the locales package. There is more information available on the Debian wiki. You can find a list of supported locales in /usr/share/i18n/SUPPORTED Then you can generate them by running the command: locale-gen 18 Answers Sorted by: 287 Put in your Dockerfile something adapted from Set the locale RUN sed -i '/enUS.UTF-8/s/ //g' /etc/locale.gen & \ locale-gen ENV LANG enUS.UTF-8 ENV LANGUAGE enUS:en ENV LCALL enUS. You can generate more by editing /etc/locale.gen and uncommenting the lines for the locales that you want to enable. You can check which locales you currently have generated using: locale -a Edit /etc/default/locale and set the contents to: LANG="nl_NL.UTF-8"
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |