Skip to content

Instantly share code, notes, and snippets.

@LeviSnoot
Created June 19, 2025 16:41
Show Gist options
  • Save LeviSnoot/857e77c72f8d5d633222f0ba76b38ae0 to your computer and use it in GitHub Desktop.
Save LeviSnoot/857e77c72f8d5d633222f0ba76b38ae0 to your computer and use it in GitHub Desktop.
en_SE - English Locale for Sweden
comment_char %
escape_char /
% Based on glibc locale definitions:
% sv_SE - Source: RAP <[email protected]>
% https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=localedata/locales/sv_SE
% en_US - Source: Free Software Foundation, Inc. <[email protected]>
% https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=localedata/locales/en_US
% This file is licensed under the
% GNU Lesser General Public License v2.1 or later (LGPL-2.1+)
% See: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
LC_IDENTIFICATION
title "English locale for Sweden"
source "LeviSnoot"
address ""
contact "https:////gist.github.com//LeviSnoot"
email ""
tel ""
fax ""
language "English"
territory "Sweden"
revision "1.0"
date "2025-06-19"
category "i18n:2012";LC_IDENTIFICATION
category "i18n:2012";LC_CTYPE
category "i18n:2012";LC_COLLATE
category "i18n:2012";LC_MESSAGES
category "i18n:2012";LC_MONETARY
category "i18n:2012";LC_NUMERIC
category "i18n:2012";LC_TIME
category "i18n:2012";LC_ADDRESS
category "i18n:2012";LC_MEASUREMENT
category "i18n:2012";LC_NAME
category "i18n:2012";LC_PAPER
category "i18n:2012";LC_TELEPHONE
END LC_IDENTIFICATION
LC_CTYPE
copy "i18n"
% Swedish transliteration rules
translit_start
include "translit_combining";""
<U00C4> "<U0041><U0308>";"<U0041><U0045>"
<U00C5> "<U0041><U030A>";"<U0041><U0041>"
<U00C6> "<U0041><U0045>"
<U00D6> "<U004F><U0308>";"<U004F><U0045>"
<U00D8> "<U004F><U0338>";"<U004F><U0045>"
<U00E4> "<U0061><U0308>";"<U0061><U0065>"
<U00E5> "<U0061><U030A>";"<U0061><U0061>"
<U00E6> "<U0061><U0065>"
<U00F6> "<U006F><U0308>";"<U006F><U0065>"
<U00F8> "<U006F><U0338>";"<U006F><U0065>"
translit_end
END LC_CTYPE
LC_COLLATE
copy "iso14651_t1"
% Swedish collation rules
collating-symbol <aring>
collating-symbol <a-diaresis>
collating-symbol <o-diaresis>
reorder-after <AFTER-Z>
<aring>
<a-diaresis>
<o-diaresis>
<U0110> <S0064>;"<BASE><BARRE>";"<CAP><MIN>";IGNORE % Đ
<U0111> <S0064>;"<BASE><BARRE>";"<MIN><MIN>";IGNORE % đ
<U00D0> <S0064>;"<BASE><VRNT1>";"<COMPATCAP><COMPAT>";IGNORE % Ð
<U00F0> <S0064>;"<BASE><VRNT1>";"<COMPAT><COMPAT>";IGNORE % ð
<U00DE> "<S0074><S0068>";"<BASE><BASE>";"<COMPATCAP><COMPATCAP>";IGNORE % Þ
<U00FE> "<S0074><S0068>";"<BASE><BASE>";"<COMPAT><COMPAT>";IGNORE % þ
<U00DC> <S0079>;"<BASE><TREMA>";"<CAP><MIN>";IGNORE % Ü
<U00FC> <S0079>;"<BASE><TREMA>";"<MIN><MIN>";IGNORE % ü
<U0170> <S0079>;"<BASE><2AIGU>";"<CAP><MIN>";IGNORE % Ű
<U0171> <S0079>;"<BASE><2AIGU>";"<MIN><MIN>";IGNORE % ű
<U00C5> <aring>;"<BASE><BASE>";"<COMPATCAP><COMPATCAP>";IGNORE % Å
<U00E5> <aring>;"<BASE><BASE>";"<COMPAT><COMPAT>";IGNORE % å
<U00C4> <a-diaresis>;"<BASE><BASE>";"<CAP><MIN>";IGNORE % Ä
<U00E4> <a-diaresis>;"<BASE><BASE>";"<MIN><MIN>";IGNORE % ä
<U00C6> <a-diaresis>;"<BASE><VRNT1>";"<COMPATCAP><COMPATCAP>";IGNORE % Æ
<U00E6> <a-diaresis>;"<BASE><VRNT1>";"<COMPAT><COMPAT>";IGNORE % æ
<U0118> <a-diaresis>;"<BASE><VRNT2>";"<CAP><MIN>";IGNORE % Ę
<U0119> <a-diaresis>;"<BASE><VRNT2>";"<MIN><MIN>";IGNORE % ę
<U00D6> <o-diaresis>;"<BASE><BASE>";"<CAP><MIN>";IGNORE % Ö
<U00F6> <o-diaresis>;"<BASE><BASE>";"<MIN><MIN>";IGNORE % ö
<U00D8> <o-diaresis>;"<BASE><VRNT1>";"<COMPATCAP><COMPATCAP>";IGNORE % Ø
<U00F8> <o-diaresis>;"<BASE><VRNT1>";"<COMPAT><COMPAT>";IGNORE % ø
<U0150> <o-diaresis>;"<BASE><VRNT2>";"<CAP><MIN>";IGNORE % Ő
<U0151> <o-diaresis>;"<BASE><VRNT2>";"<MIN><MIN>";IGNORE % ő
<U0152> <o-diaresis>;"<BASE><VRNT3>";"<CAP><MIN>";IGNORE % Œ
<U0153> <o-diaresis>;"<BASE><VRNT3>";"<MIN><MIN>";IGNORE % œ
<U00D4> <o-diaresis>;"<BASE><VRNT4>";"<CAP><MIN>";IGNORE % Ô
<U00F4> <o-diaresis>;"<BASE><VRNT4>";"<MIN><MIN>";IGNORE % ô
reorder-end
END LC_COLLATE
LC_MESSAGES
% English messaging rules
yesexpr "^[+1yY]"
noexpr "^[-0nN]"
yesstr "yes"
nostr "no"
END LC_MESSAGES
LC_MONETARY
% Swedish currency rules
int_curr_symbol "SEK "
currency_symbol "kr"
mon_decimal_point ","
mon_thousands_sep " "
mon_grouping 3
positive_sign ""
negative_sign "-"
int_frac_digits 2
frac_digits 2
p_cs_precedes 0
p_sep_by_space 1
n_cs_precedes 0
n_sep_by_space 1
p_sign_posn 1
n_sign_posn 1
END LC_MONETARY
LC_NUMERIC
% Swedish numeric rules
decimal_point ","
thousands_sep " "
grouping 3
END LC_NUMERIC
LC_TIME
% Swedish rules with English language
abday "Sun";"Mon";/
"Tue";"Wed";/
"Thu";"Fri";/
"Sat"
day "Sunday";/
"Monday";/
"Tuesday";/
"Wednesday";/
"Thursday";/
"Friday";/
"Saturday"
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"
d_t_fmt "%a %e %b %Y %H:%M:%S"
date_fmt "%a %e %b %Y %H:%M:%S %Z"
d_fmt "%Y-%m-%d"
t_fmt "%H:%M:%S"
am_pm "";""
t_fmt_ampm ""
week 7;19971130;4
first_weekday 2
END LC_TIME
LC_ADDRESS
% Swedish rules with English language
postal_fmt "%f%N%a%N%d%N%b%N%s %h %e %r%N%z %T%N%c%N"
country_name "Sweden"
country_ab2 "SE"
country_ab3 "SWE"
country_num 752
country_car "S"
lang_name "English"
lang_ab "en"
lang_term "eng"
lang_lib "eng"
END LC_ADDRESS
LC_MEASUREMENT
copy "i18n"
END LC_MEASUREMENT
LC_NAME
% Swedish rules
name_fmt "%d%t%g%t%m%t%f"
END LC_NAME
LC_PAPER
copy "i18n"
END LC_PAPER
LC_TELEPHONE
tel_int_fmt "+%c-%a-%l"
tel_dom_fmt "0%a-%l"
int_select "00"
int_prefix "46"
END LC_TELEPHONE
#!/usr/bin/env bash
set -e
LOCALE_FILE="en_SE"
LOCALE_NAME="en_SE.UTF-8"
INSTALL_DIR="/usr/share/i18n/locales"
CHARMAP="UTF-8"
echo "Copying $LOCALE_FILE to $INSTALL_DIR (requires root)..."
sudo cp "$LOCALE_FILE" "$INSTALL_DIR/"
echo "Generating locale $LOCALE_NAME (requires root)..."
sudo localedef -i "$LOCALE_FILE" -f "$CHARMAP" "$LOCALE_NAME"
if locale -a | grep -q "^en_SE.utf8$"; then
echo "Locale $LOCALE_NAME successfully installed!"
else
echo "ERROR: Locale $LOCALE_NAME was not installed correctly."
exit 1
fi
# Credit https://gist.github.com/bmaupin
# Locale install for Ubuntu/Debian
if [ -d /var/lib/locales/supported.d ]; then
echo "Registering locale in /var/lib/locales/supported.d/local (Debian/Ubuntu)..."
echo "$LOCALE_NAME UTF-8" | sudo tee /var/lib/locales/supported.d/local
echo "Running locale-gen..."
sudo locale-gen
fi
cat <<EOF
To use this locale for your current shell session:
export LANG=$LOCALE_NAME
To make it your default locale, add the above line to your ~/.profile or ~/.bashrc.
To set system-wide (requires root):
sudo localectl set-locale LANG=$LOCALE_NAME
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment