gin

Differences between revisions 6 and 7
Revision 6 as of 2006-03-25 16:53:53
Size: 5859
Editor: montpeliervt-cuda1-24-50-146-184
Comment:
Revision 7 as of 2006-03-30 19:14:07
Size: 5899
Editor: pool-138-88-136-140
Comment:
Deletions are marked like this. Additions are marked like this.
Line 48: Line 48:
Gins accepts zero or more arguments, with zero arguments gins prints out the following: '''gin''' accepts zero or more arguments, with zero arguments gins prints out the following:
Line 54: Line 54:
If gins is executed with a -q option this information is suppressed. If '''gin''' is executed with a -q option this information is suppressed.
Line 56: Line 56:
If gins is executed as root... If '''gin''' is executed as root...
Line 58: Line 58:
 0. and the fist and only variable is a user name for the system, gins prints out the current language settings for this user.  0. and the fist and only variable is a user name for the system, '''gin''' prints out the current language settings for this user.
Line 60: Line 60:
 0. and the first variable is the user name and the second variable is a language identifier, then gins sets all related user language elements to this locale.  0. 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.
Line 66: Line 66:
gins reports variables and options and exits '''gin''' reports variables and options and exits
Line 68: Line 68:
if not run as root gin reports options and the fact it is not root. if not run as root '''gin''' reports options and the fact it is not root.
Line 100: Line 100:
The Jeff Elkner memorial "gin" Script The Jeff Elkner memorial '''gin''' Script

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.

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 [WWW] https://docbox.flint.com/~flint/bazaar/gin/gin.sh, 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)