gin
Launchpad Entry: https://docbox.flint.com/~flint/bazaar/gin/
Created: 2006-03-20 by flint@flint.com
Contributors: flint
Packages affected:
Summary
gin
Gnome Instant Nationalization Service
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 perfers English logs in there is an English screen, and when a Spanish user logs in the system is delivered in Spanish.
An educator haa 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:
Gins accepts zero or more arguments, with zero arguements gins prints out the following:
- if the the status of the executer is root
- the language variables as they stand
- the abbreviated help page for this product
If gins is executed with a -q option this information is suppressed.
If gins is executed as root...
- and the fist and ony variable is a user name for the system, gins prints out the current language settings for this user.
- 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.
How It Works
such as userid and language as an and prints out either status, help must be run as root
gins 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 efffected are:
- $HOME/.dmrc
- /etc/environment
- /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
# # 3/03/2006 # (c) Jeff Elkner & Paul Flint # Version 0.001 of this remarkably sad and sorry code # was flagrantly attacked in an editor by flint, # who relied on the million monkeys and million keyboards approach to # software development, and this code proves that the INS is our friend... # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA# # This code resports and lets you switch languages... # # this must be run as root... # sudo bash somebody make this part work... # # this is a prototype of the check for stuff... # make gottahave the name of the thing you are looking for: #
Data preservation and migration
All calls in this code must be explicit. This should be refactored in python to allow seamless attachment to the Glade thingy by someone who likes gui.
Outstanding issues
Someone really needs to write this dog.
BoF agenda and discussion
flint will be at Linuxworld, April 4-7 2006