gin

Summary

gin

  • Gnome Instant Nationalization

GIN allows superuser to determine and adjust language settings for individuals logging into any gnome based (*untu) along the development line. Slo-gin checks for the lang packs, gin.sh does not check. This will soon be a switch in the code. Note that if the user is logged in when gin is invoked, the user account effected must log off and log back in for this to reset the variables involved.

News Flash

Mr. Kevin Cole, the DCLOCO chief cat herder, has completely re-factored this program and replaced gin.sh with gin.py. This will be posted shortly. Flint wishes to thank Nick Wheeler and Kevin Cole for their efforts to "un-cruft" this and make it work well. I would describe his results as sensational. Please refer to http://docbox.flint.com/~flint/gin/index.html

Rationale

Teachers need to assign and set language variables to allow for unified teaching in multi lingual environments. This is a script to report and set language variables.

Use cases

The Edubuntu Lab has 30 workstations and 120 user accounts, some in Spanish some in English. When a user who prefers English logs in there is an English screen, and when a Spanish user logs in the system is delivered in Spanish.

An educator has a running Edubuntu Breezy installation which was installed with English as the default language. I want to be able (as system administrator) to change the default language of some of the users to Spanish, leaving others with a default language of English. This needs to work on a user by user basis.

The educator wants users who have their default language changed to Spanish to have all applications that support this to appear to them with Spanish menus, including the gnome desktop environment itself.

Scope

Any of the GNOME based *buntu distributions, such as Ubuntu and Edubuntu. It will be tested on Edubuntu, Ubuntu and Ubuntu server Warty, Hoary, Breezy and Dapper versions.

Design

This is initially a bash script. It should change to a Python script. Finally this will be added into Dapper +1.

usage:

gin accepts zero or more arguments, with zero arguments gins prints out the following:

  1. If the the status of the executer is root
  2. the language variables as they stand
  3. the abbreviated help page for this product

If gin is executed with a -q option this information is suppressed.

If gin is executed as root...

  1. and the fist and only variable is a user name for the system, gin prints out the current language settings for this user.

  2. and the first variable is the user name and the second variable is a language identifier, then gin sets all related user language elements to this locale.

How It Works

such as userid and language as an and prints out either status, help must be run as root

gin reports variables and options and exits

if not run as root gin reports options and the fact it is not root.

This program changes three areas and these environment variables

Three areas effected are:

  1. $HOME/.dmrc
  2. /etc/environment
  3. /etc/default/gdm

The Variables effected are shown below in their English state:

GDM_LANG=en_US.UTF-8
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8

Here are the Variables in their Spanish state:

GDM_LANG=es_ES.UTF-8
LANG=es_ES.UTF-8
LANGUAGE=es_ES.UTF-8

Implementation

Again, the first shot of this would be a shell script, and then we refactor to a python script, and finally we plug into whatever gui someone wants...

Code

The Jeff Elkner memorial gin Script

by Paul Flint

This script actually works. Download the script from this site, next chmod +X it, become root, and torch it off. Optionally rename "gin.sh" to "gin" and maybe move to /usr/bin. It appears that Version 0.081 is worth testing with.

Testing

Testing has begun with Version .081 and at this time the program appears to do no damage however, see the following limitations and be careful. Remember the 5 most hated words in the world of computers are:

  1. Did
  2. You
  3. Back
  4. It
  5. Up?

Check version with the -v switch, not documented... (hm...:^)

Design Objectives

  • The script must be completely self sustained, no other files are needed, or if needed the script manufactures them. This should be refactored in python to allow seamless attachment to the Glade thingy by someone who likes gui. The architecture is a central case statement that is argument driven All calls in this code must be explicit.

Data preservation and migration

If all else fails, the original files are saved in the home directory of the runner in the files:

  1. safe.dmrc
  2. safe.environment
  3. safe.gdm

restore these and all will be as it was.

Outstanding issues and Limitations

Limitations discovered in this testing process include:

  1. Version 0.081 of this program does not yet test whether it is running on a non Gnome system (e.g. KDE) the next version will. Do not attempt to run this on KDE or other windowing systems, as this will create unpredicatble results.
  2. Version 0.081 of this program does not check whether the <username> is a legitimate user on the system, and running this program with bogus user names will also, no doubt, create erratic results.

  3. Need review of the debs required for the Spanish language, and have concerns / questions about this (boy do we need a faq).
  4. Need to add documentation of -v (outputs version and stops)
  5. Need to write a man page, would be neat if the script when first run creates this...
  6. Need to add a -r or --restore feature to this script
  7. This method (and script) has been tested and will operate in a Dapper or a Breezy environment.
  8. This method (and script) has not been tested in a Hoary environment
  9. This method (and script) will not function in a Warty environment

testing performed April 2006 in the "flint linux candy lab", Montpelier, Vermont

BoF agenda and discussion

flint will be at Linuxworld, April 4-7 2006


CategorySpec

gin (last edited 2008-08-06 16:33:12 by localhost)