Wilbert's website at SocSci

> Computer> ISO for Linux

computer/isoLinux.php 2024-04-26

ISO Linux

https://gist.github.com/bmaupin/d64368e78cd359d309685fecbe2baf23

background

Using international standards (ISO 216 for paper sizes, ISO 8601 for date and time format, ISO 80 000 for units and numbers) used to be done with an impressive number of KDE tabs and settings. Starting from Plasma 5, a more stardard approach is followed. You should install a locale of your liking.

You may think a simple export LC_ALL=en_DK.UTF-8 would do the trick, but this is not the case, unfortunately. First reason is that it will not do for most people. Most likely you do not want your currency symbol set to DKK. If you write English texts, you may not want your decimal separator to be the comma. Second reason is that it simply does not follow all the ISO standards that I want followed. ISO 80 000 does not allow dots as thousands separator for instance.

That's why I created a locale that is a bit more metric, a bit more English and a bit more Dutch than en_DK. I call it en_NL. This is how to install it on Kubuntu. Other Linux flavours differ only little:

Installation

  • Download en_NL (old style en_NL_old)
  • Copy it to the proper location. Go to your downloads directory and:
    sudo cp en_NL /usr/share/i18n/locales/
  • Add it to the list of generatable locales
    sudo sh -c 'echo "en_NL UTF-8" >> /usr/share/i18n/SUPPORTED'
  • Generate it
    sudo locale-gen en_NL 

Now the locale is usable. Use it:

  • For Ubuntu:
    sudo sh -c 'echo "LANG=en_NL.UTF-8" > /etc/default/locale'
  • For KDE4:
    echo "export LANG=en_NL.UTF-8" >> ~/.kde/env/locale.sh
  • For KDE5:
  • For KDE5, for gtk programs:
    echo "export LANG=en_NL.UTF-8" > ~/.config/plasma-workspace/env/locale.sh

You must log in again before it will work.

Content

This is the text of the locale:

comment_char %
escape_char /

% Using the English language in the EU with a maximum use of
% ISO standards (eg 216, 8601 and 10 646, 80 000)
% This locale uses a period as decimal dot and observes
% ISO standards in a stricter sense than en_DK does.
% Except for a few typical Dutch or European settings
% this locale is suitable for the whole English speaking world.

LC_IDENTIFICATION
title      "English locale for the Netherlands"
source     "Wilbert van Ham"
address    "https:////www.wilberth.nl"
contact    ""
email      ""
tel        ""
fax        ""
language   "Dutch English"
territory  "Netherlands"
revision   "1.0"
date       "2021-06-04"

category "i18n:2012";LC_IDENTIFICATION
category "i18n:2012";LC_CTYPE
category "i18n:2012";LC_COLLATE
category "i18n:2012";LC_TIME
category "i18n:2012";LC_NUMERIC
category "i18n:2012";LC_MONETARY
category "i18n:2012";LC_MESSAGES
category "i18n:2012";LC_PAPER
category "i18n:2012";LC_NAME
category "i18n:2012";LC_ADDRESS
category "i18n:2012";LC_TELEPHONE
category "i18n:2012";LC_MEASUREMENT
END LC_IDENTIFICATION

LC_CTYPE
copy "en_GB"
END LC_CTYPE

LC_COLLATE

% Copy the template from ISO/IEC 14651
copy "iso14651_t1"

END LC_COLLATE

LC_MONETARY
int_curr_symbol     "EUR "
currency_symbol     "€"
mon_decimal_point   "."
mon_thousands_sep   ""
mon_grouping        3;3
positive_sign       ""
negative_sign       "-"
int_frac_digits     2
frac_digits         2
p_cs_precedes       1
int_p_sep_by_space  1
p_sep_by_space      1
n_cs_precedes       1
int_n_sep_by_space  1
n_sep_by_space      1
p_sign_posn         1
n_sign_posn         1
%
END LC_MONETARY

LC_NUMERIC
decimal_point   "."
thousands_sep   ""
grouping        3;3
END LC_NUMERIC

LC_TIME
abday	"Sun";"Mon";"Tue";"Wed";"Thu";"Fri";"Sat"
day	"Sunday";/
	"Monday";/
	"Tuesday";/
	"Wednesday";/
	"Thursday";/
	"Friday";/
	"Saturday"

week 7;19971130;1
abmon	"Jan";"Feb";/
	"Mar";"Apr";/
	"May";"Jun";/
	"Jul";"Aug";/
	"Sep";"Oct";/
	"Nov";"Dec"
mon	"January";/
	"February";/
	"March";/
	"April";/
	"May";/
	"June";/
	"July";/
	"August";/
	"September";/
	"October";/
	"November";/
	"December"
% Appropriate date and time representation (%c)
d_t_fmt "%Y-%m-%dT%T %Z"
%
% Appropriate date representation (%x)
d_fmt   "%Y-%m-%d"
%
% Appropriate time representation (%X)
t_fmt   "%T"
%
% Appropriate AM/PM time representation (%r)
t_fmt_ampm ""
%
% Appropriate date and time representation for date(1)
date_fmt "%a %b %e %H:%M:%S %Z %Y"
%
% Strings for AM/PM
%
am_pm	"";""
END LC_TIME

LC_MESSAGES
yesexpr "^[yY].*"
noexpr  "^[nN].*"
yesstr  "yes"
nostr   "no"
END LC_MESSAGES

LC_PAPER
height   297
width    210
END LC_PAPER

LC_NAME
name_fmt    "%s%t%g%t%m%t%f"
name_miss   "Miss."
name_mr     "Mr."
name_mrs    "Mrs."
name_ms     "Ms."
END LC_NAME


LC_ADDRESS
postal_fmt    "%f%N%a%N%d%N%b%N%s %h %e %r%N%z %T%N%c%N"
country_ab2 "NL"
country_ab3 "NLD"
country_num 528
country_car "NL"
country_isbn "97"
country_post ""
country_name ""
lang_name "English"
lang_ab "en"
lang_term "eng"
lang_lib "eng"
END LC_ADDRESS

LC_TELEPHONE
tel_int_fmt    "+%c %a %l"
tel_dom_fmt    "(%a) %l"
int_prefix     "31"
int_select     "00"
END LC_TELEPHONE

LC_MEASUREMENT
% S.I.
measurement 1
END LC_MEASUREMENT