i18n for AUR desktop entries

This commit is contained in:
Vinicius Moreira
2019-09-17 15:52:08 -03:00
parent 27c6e7b1cb
commit 01ca7414e2
2 changed files with 31 additions and 5 deletions

View File

@@ -1,13 +1,23 @@
# Generates a .desktop file based on the current python version. Used for AUR installation
import os
import sys
import locale
system_locale = locale.getdefaultlocale()[0].split('_')[0]
if system_locale == 'pt':
comment = "Gerencie seus aplicativos Flatpak / Snap / AUR "
elif system_locale == 'es':
comment = "Administre sus aplicaciones Flatpak / Snap / AUR"
else:
comment = "Manage your Flatpak / Snap / AUR applications"
desktop_file = """
[Desktop Entry]
Type = Application
Name = bauh
Categories = System;
Comment = Manage your Flatpak / Snap / AUR applications
Comment = {comment}
Exec = {path}
Icon = {lib_path}/python{version}/site-packages/bauh/resources/img/logo.svg
"""
@@ -19,4 +29,5 @@ app_cmd = os.getenv('BAUH_PATH', '/usr/bin/bauh')
with open('bauh.desktop', 'w+') as f:
f.write(desktop_file.format(lib_path=os.getenv('BAUH_LIB_PATH', '/usr/lib'),
version=py_version,
path=app_cmd))
path=app_cmd,
comment=comment))

View File

@@ -1,13 +1,26 @@
# Generates a .desktop file based on the current python version. Used for AUR installation
import locale
import os
import sys
system_locale = locale.getdefaultlocale()[0].split('_')[0]
if system_locale == 'pt':
comment = "Gerencie seus aplicativos Flatpak / Snap / AUR "
tray = 'bandeja'
elif system_locale == 'es':
comment = "Administre sus aplicaciones Flatpak / Snap / AUR"
tray = 'bandeja'
else:
comment = "Manage your Flatpak / Snap / AUR applications"
tray = 'tray'
desktop_file = """
[Desktop Entry]
Type = Application
Name = bauh ( tray )
Name = bauh ( {tray} )
Categories = System;
Comment = Manage your Flatpak / Snap / AUR applications
Comment = {comment}
Exec = {path}
Icon = {lib_path}/python{version}/site-packages/bauh/resources/img/logo.svg
"""
@@ -19,7 +32,9 @@ app_cmd = os.getenv('BAUH_PATH', '/usr/bin/bauh') + ' --tray=1'
with open('bauh_tray.desktop', 'w+') as f:
f.write(desktop_file.format(lib_path=os.getenv('BAUH_LIB_PATH', '/usr/lib'),
version=py_version,
path=app_cmd))
path=app_cmd,
comment=comment,
tray=tray))
with open('bauh-tray', 'w') as f: