forked from linuxmint/cinnamon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_additional_files.py
executable file
·64 lines (51 loc) · 1.85 KB
/
generate_additional_files.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/python
import os, gettext
DOMAIN = "cinnamon"
PATH = "/usr/share/cinnamon/locale"
def generate(filename, prefix, name, comment, suffix):
gettext.install(DOMAIN, PATH)
desktopFile = open(filename, "w")
desktopFile.writelines(prefix)
desktopFile.writelines("Name=%s\n" % name)
for directory in sorted(os.listdir(PATH)):
if os.path.isdir(os.path.join(PATH, directory)):
try:
language = gettext.translation(DOMAIN, PATH, languages=[directory])
language.install()
desktopFile.writelines("Name[%s]=%s\n" % (directory, _(name)))
except:
pass
desktopFile.writelines("Comment=%s\n" % comment)
for directory in sorted(os.listdir(PATH)):
if os.path.isdir(os.path.join(PATH, directory)):
try:
language = gettext.translation(DOMAIN, PATH, languages=[directory])
language.install()
desktopFile.writelines("Comment[%s]=%s\n" % (directory, _(comment)))
except:
pass
desktopFile.writelines(suffix)
os.environ['LANG'] = "en"
gettext.install(DOMAIN, PATH)
prefix = """[Desktop Entry]
Exec=cinnamon-settings
Icon=preferences-system
Terminal=false
Type=Application
Categories=Settings;
StartupNotify=false
OnlyShowIn=GNOME;
Keywords=Preferences;Settings;
"""
generate("files/usr/share/applications/cinnamon-settings.desktop", prefix, _("System Settings"), _("Control Center"), "")
prefix = """[Desktop Entry]
Exec=cinnamon-settings-users
Icon=system-users
Terminal=false
Type=Application
Categories=System;Settings;
StartupNotify=false
OnlyShowIn=GNOME;
Keywords=Preferences;Settings;
"""
generate("files/usr/share/applications/cinnamon-settings-users.desktop", prefix, _("Users and Groups"), _("Add or remove users and groups"), "")