English in Finland on Ubuntu

English in Finland on Ubuntu

English language in Finland: all messages in English, but using Finnish locales, such as metric system, A4 paper size.

Some of these settings are required for computer to work in Finland. For example, many printers only print when paper size is set to A4.

I wrote this to collect my toughts and provide more details in an Ubuntu bug report. This text is a work in progress.


What Should be Changed

If user chooses “Location: Finland” in Ubuntu installer, these settings should be used:

  • LC_* locale settings, below. Essential for normal working are A4 paper, metric system and comma as decimal separator
  • Keyboard: Finnish as default in installer
  • Timezone: Helsinki/Finland as default in installer (is this allready set?)
  • OpenOffice.org spell check off by default (users seem to keep writing with red underlining)
  • Store location in a world readable text file under /etc/, can be used as default setting for programs, eg. gnome-weather, evolution

This far, I have figured out how to set correct LC_* locale settings, and setting the keyboard and timezone is probably easy too.


Settings


Short version – just the files

/etc/environment

Should it be without quotes? For example: LC_MESSAGES=en_DK.UTF-8

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"
LC_MESSAGES="en_DK.UTF-8" # language
LANG="en_DK.UTF-8"      # fallback if LC_specific not set
LC_PAPER="fi_FI.UTF-8"   # a4, can't print without this
LC_MEASUREMENT="fi_FI.UTF-8" # metric system
LC_NUMERIC="fi_FI.UTF-8" # 100 000,02 fi keyboard numpad has comma not dot
LC_MONETARY="fi_FI.UTF-8" # EUR
LC_TIME="en_DK.UTF-8"   # iso-8601, 24h + weeks start Mon + format yyyy-mm-dd HH:MM
LC_CTYPE="fi_FI.UTF-8"  # which characters are letter
LC_COLLATE="fi_FI.UTF-8" # sort order, eg. a" ä is after z
LC_NAME="fi_FI.UTF-8"
LC_ADDRESS="fi_FI.UTF-8"
LC_TELEPHONE="fi_FI.UTF-8"

/etc/locale.gen

fi_FI.UTF-8 UTF-8
en_DK.UTF-8 UTF-8

$ sudo locale-gen

Log out and back in.


enfi.cf – Tero’s cfengine setup

$ grep actionseq conterol/cf/conterol.cf
     actionsequence = (  editfiles directories shellcommands files )
$ grep enfi.cf conterol/cf/conterol.cf
        $(pwd)/enfi.cf
$ cat conterol/cf/enfi.cf
# enfi - English in Finland, locale and other settings
# No GUI exists to set these
# (c) 2006 Tero Karvinen www.iki.fi/karvinen
editfiles:
        { /etc/locale.gen
                AutoCreate
                AppendIfNoSuchLine "# enfi.cf - English language in Finland"
                AppendIfNoSuchLine "# Metric system, euro, A4"
                AppendIfNoSuchLine "fi_FI.UTF-8 UTF-8"
                AppendIfNoSuchLine "# English messages + ISO-8601 time"
                AppendIfNoSuchLine "en_DK.UTF-8 UTF-8"
                # not removing unneeded en_* locales
        }
        { /etc/environment
                AutoCreate
                AppendIfNoSuchLinesFromFile "$(pwd)/../var/lib/conterol/lc.inc"
        }
shellcommands:
        # Only run locale-gen when /etc/locale.gen is newer than 1 min
        "/usr/bin/find /etc/locale.gen -mmin -1 |/bin/grep locale.gen -q &&     /usr/sbin/locale-gen"
# TODO: Test in normal use. Set all LC_something? Test if user can change language. Install Finnish  packages?
$ cat conterol/var/lib/conterol/lc.inc
### English language, Finnish location - enfi.cf
LC_MESSAGES="en_DK.UTF-8" # language
LANG="en_DK.UTF-8"      # fallback if LC_specific not set
# essential
LC_PAPER="fi_FI.UTF-8"   # a4, can't print without this
LC_MEASUREMENT="fi_FI.UTF-8" # metric system
LC_NUMERIC="fi_FI.UTF-8" # 100 000,02 fi keyboard numpad has comma not dot
# nice
LC_MONETARY="fi_FI.UTF-8" # EUR
LC_TIME="en_DK.UTF-8"   # iso-8601, 24h + weeks start Mon + format yyyy-mm-dd HH:MM
# testing
LC_CTYPE="fi_FI.UTF-8"  # which characters are letter
LC_COLLATE="fi_FI.UTF-8" # sort order, eg. a" ä is after z
LC_NAME="fi_FI.UTF-8"
LC_ADDRESS="fi_FI.UTF-8"
LC_TELEPHONE="fi_FI.UTF-8"
# LC_IDENTIFICATION # Metadata about the locale information.
#LANGUAGE="en_DK:en" # what's this?
# Note: Space is not allowed around equal sign "="
# LC_* settings override GDM login screen language selection,
# which seems to set LANG.
# (c) 2006 Tero Karvinen www.iki.fi/karvinen


Not yet working settings

English Spellcheck off by Default in OpenOffice.org

$HOME/.openoffice.org2/user/registry/data/org/openoffice/Office/Linguistic.xcu

 <node oor:name="SpellChecking">
  <prop oor:name="IsSpellAuto" oor:type="xs:boolean">
   <value>false</value>
  </prop>

Local date in Gnome Clock Applet

iso-8601-date-plus-extra-data-on-gnome-2-6-clock.jpg

Partially quoting myself in Ubuntu Bug “Clock can’t display international date format” below.

Gnome Bug Add possibility to format the hour using a gconf key and strftime

Can set a custom date format with $ gconf-editor search: applet_ Find clock applet among about 5 applets. Change for example 2006-04-16 16:39 Sun w15 custom_format: “%x %H:%M %a w%V” format: “custom” Clock format changes immidiately.

When format is “custom”, Clock applet, right click: Preferences shows a dialog to edit custom format. This only works once, after that it must be edited in gconf-editor.

Copy date does not work.

I did not yet find a way to put short localized date in it: “%x %X” shows seconds, even if show seconds is not selected, and even if ‘ls’ shows only minutes with the same LC_DATE.

Week numbers

According to ‘man date’:

  • %U week number of year with Sunday as first day of week (00..53)
  • %V week number of year with Monday as first day of week (01..53)
  • %W week number of year with Monday as first day of week (00..53)

%U is wrong because in Finland and in ISO-8601, week starts from Monday. %W is wrong, because in Finland and in ISO-8601, week numbers vary from 1 to 53 inclusive.

%V seems to be correct.


Testing


Dapper Flight 6

Test on 2006-04-13 after enfi.cf

Checking on Dapper Flight 6 that stuff works after my settings
- command line tools (opened gnome-terminal from X)
        - sort - ok (LC_COLLATE)
        - ls -l - ok (LC_TIME)
        - euro sign, echo - ok
        - date +"%x %X" - ok (LC_TIME)
- openoffice.org writer
        - print: paper size: a4 - ok (LC_PAPER)
        - metric system: rulers use cm - ok (LC_MEASUREMENT)
        - sort - ok (LC_COLLATE)
        - type EUR sign - ok
- openoffice.org calc
        - comma in decimal numbers - ok (LC_NUMERIC)
        - space as thousands separator - no (is not set so in the locale, bug?)
        - EUR sign - 200 € + 200 € = 400 € - ok
        - A4, export PDF, pdfinfo foo.pdf - ok (LC_PAPER)
- gnome calendar applet (topright) - US date - bug filed earlier
- firefox
        - print - wrong! "Letter (8.5x11 inch)", units in fields are inches  (LC_PAPER) (bug)
                File: Print: Properties: Paper Size
                - rm -rf ~/.mozilla does not help
- nautilus
        - view as list: uses too complex version of date (w TZ), should use same as ls (LC_TIME) - ok
                - can change this. Edit:Preferences:Display:Date:Format:2006-04-13 14:10:19 (would not need seconds)
During this testing, I did not see a word of Finnish in the interface. Thus,
it seems that these settings can be done safely when user chooses Location: Finnish.


Notes on Gutsy

Quickly tested this on Gutsy (2008-02-11). Contents of locale.gen now goes to /var/lib/locales/supported.d/enfi.


See also


Loosely related

English and Māori with Debian GNU/Linux http://homepages.ihug.co.nz/~trmusson/maori.html


Lyhyesti suomeksi

Tämä dokumentti kuvailee asetukset Ubuntu Linuxin käyttämisestä englanninkielisenä, mutta suomalaisilla asetuksilla. Tämä tarkoittaa, että kaikki tekstit ovat englanniksi, mutta esimerkiksi paperi, mittajärjestelmä ja numeroiden esitys on suomalainen. Paperina on A4, jolloin tulostus onnistuu muuttamatta ohjelmakohtaisia asetuksia. Mittajärjestelmänä on metrijärjestelmä eli SI-järjestelmä vanhahtavien tuumien ja jalkojen sijaan. Numerot esitetään desimaalipilkulla, ei amerikkalaisella hitaasti näppäiltävällä desimaalipisteellä. Näppäimistönä on suomalainen (Finnish, fi) pc-105. Aikavyöhyke on Suomen aikavyöhyke EET. Tulevaisuudessa myös OpenOfficen englanninkielinen oikoluku on oletuksena pois päältä. Kirjaimisto on Ubuntussa valmiiksi oikea unicode eli UTF-8. Tässä artikkelissa kiinnostuksen kohteena on siis lokalisointi (l10n, localization), ei kielen kääntäminen.



Posted in Old Site | Tagged , , , , , , , | Comments Off on English in Finland on Ubuntu

Comments are closed.