~edubuntu-italc-devel/italc/italc-jaunty

« back to all changes in this revision

Viewing changes to debian/italc-launcher

  • Committer: Stéphane Graber
  • Date: 2009-02-12 19:03:16 UTC
  • Revision ID: stgraber@ubuntu.com-20090212190316-byo3fqipu1uov11v
Fix utf-8 issues and add gettext support

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
# Written by Stéphane Graber <stgraber@ubuntu.com>
6
6
 
7
7
from xml.dom import minidom
8
 
import md5, subprocess, re, socket, os, sys, urllib2
 
8
import md5, subprocess, re, socket, os, sys, urllib2, gettext
 
9
 
 
10
# gettext
 
11
gettext.textdomain('italc')
 
12
_ = gettext.gettext
9
13
 
10
14
# Store the old environment
11
15
lang=os.environ["LANG"]
130
134
 
131
135
# Scan for an existing classroom and delete it
132
136
for classroom in classrooms:
133
 
        if classroom.getAttribute("name") == "Auto-detected computers":
 
137
        if classroom.getAttribute("name") == _("Auto-detected computers"):
134
138
                body.removeChild(classroom)
135
139
 
136
140
# Create the Auto-detected computers classroom
137
141
avahi=xmldoc.createElement("classroom")
138
 
avahi.setAttribute("name","Auto-detected computers")
 
142
avahi.setAttribute("name",_("Auto-detected computers"))
139
143
avahi.setAttribute("forcevisible","yes")
140
144
body.appendChild(avahi)
141
145
 
186
190
 
187
191
try:
188
192
        file=open(confdir+"globalconfig.xml","w")
189
 
        xmldoc.writexml(file)
 
193
        file.write(xmldoc.documentElement.toxml( "utf-8"))
190
194
        file.close()
191
195
except:
192
196
        exit('Failed to save updated config')