Skip to content

Commit

Permalink
extension: Add translations for prefs ui and switch to makefile/bluep…
Browse files Browse the repository at this point in the history
…rint

* Replace the template.ui xml by template.blp, which generates
  template.ui on build (template.ui is still pushed to make manual
  install easier)

* Use a makefile to run the commands instead of a single script

* Add translations for the "preferences" page

Signed-off-by: Woomymy <woomy@woomy.be>
  • Loading branch information
Woomymy committed Jul 19, 2023
1 parent 41da2be commit 119d534
Show file tree
Hide file tree
Showing 14 changed files with 430 additions and 132 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ gschemas.compiled

# L10N
*.mo

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "subprojects/blueprint-compiler"]
path = subprojects/blueprint-compiler
url = https://gitlab.gnome.org/jwestman/blueprint-compiler.git
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
EXTENSION_ZIP := ideapad-controls@azzamalsharafi.gmail.com.shell-extension.zip

subprojects:
@git submodule update --resursive

template.ui: subprojects
@./subprojects/blueprint-compiler/blueprint-compiler.py compile template.blp > template.ui

$(EXTENSION_ZIP): template.ui
@gnome-extensions pack ./ \
--extra-source=template.ui \
--extra-source=optionsUtils.js \
--extra-source=aggregateMenu.js \
--extra-source=quickSettingsMenu.js \
--extra-source=common.js \
--extra-source=icons/ \
--extra-source=LICENSE.md \
--podir=po \
--force

translations:
@xgettext \
--files-from=po/POTFILES \
--output=po/ideapat-controls.pot \
--from-code=UTF-8 \
--add-comments \
--keyword=_ \
--keyword=C_:1c,2

install: $(EXTENSION_ZIP)
@echo "Installing extension"
gnome-extensions install --force $(EXTENSION_ZIP)
@echo "Extension installed"

clean:
rm -f $(EXTENSION_ZIP)

all: install

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ GNOME Shell extension for controling Lenovo IdeaPad laptops options.
Install from [GNOME Extensions](https://extensions.gnome.org/extension/5260/ideapad-controls/).

## Manual
Clone the repo then execute `install.sh` script.
Clone the repo then execute `make install`


# Password-less setup
Expand Down
21 changes: 0 additions & 21 deletions install.sh

This file was deleted.

7 changes: 7 additions & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
template.blp
aggregateMenu.js
common.js
extension.js
optionsUtils.js
prefs.js
quickSettingsMenu.js
104 changes: 88 additions & 16 deletions po/en.po
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Translations for Ideapad Controls gnome extension
# Copyright (C) 2022-23
# This file is distributed under the same license as the Ideapad Controls package.
# Azzamalsharafi <ideapad-controls@azzamalsharafi.gmail.com>, 2022-23
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-07-19 13:39+0200\n"
"PO-Revision-Date: 2023-07-19 13:46+0200\n"
"POT-Creation-Date: 2023-07-19 18:19+0200\n"
"PO-Revision-Date: 2023-07-19 22:06+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: en\n"
Expand All @@ -17,39 +17,111 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.3.2\n"

#: common.js:41
#: template.blp:6
msgid "Extension Menu"
msgstr "Extension Menu"

#: template.blp:9
msgid "Sysfs path of the ideapad_laptop dir"
msgstr "Sysfs path of the ideapad_laptop dir"

#: template.blp:13
msgid "Extension menu location"
msgstr "Extension menu location"

#: template.blp:14
msgid "Choose where to place the extension menu."
msgstr "Choose where to place the extension menu."

#: template.blp:19
msgid "Tray"
msgstr "Tray"

#: template.blp:20
msgid "System Menu"
msgstr "System Menu"

#: template.blp:26
msgid "Settings button"
msgstr "Settings button"

#: template.blp:27
msgid "Enable to show Extension Settings button."
msgstr "Enable to show Extension Settings button."

#: template.blp:35
msgid "Use pkexec"
msgstr "Use pkexec"

#: template.blp:36
msgid ""
"Enable to make ideapad_laptop wrap its write commands with pkexec to request "
"root privileges. Disable only if you have a proper permissions setup (see "
"README for more details)"
msgstr ""
"Enable to make ideapad_laptop wrap its write commands with pkexec to request "
"root privileges. Disable only if you have a proper permissions setup (see "
"README for more details)"

#: template.blp:44
msgid "Send success notifications"
msgstr "Send success notifications"

#: template.blp:45
msgid ""
"Enable to make the extension send notifications when it enables an option "
"successfully"
msgstr ""
"Enable to make the extension send notifications when it enables an option "
"successfully"

#: template.blp:54
msgid "Options"
msgstr "Options"

#: template.blp:55
msgid "Choose which options to keep in the extension menu."
msgstr "Choose which options to keep in the extension menu."

#: common.js:47
msgid "Extension Settings"
msgstr "Extension Settings"

#: optionsUtils.js:14
#. All options that the extension can support, regardless of the current device running the extension.
#: optionsUtils.js:17
msgid "Conservation Mode"
msgstr "Conversation Mode"
msgstr "Conservation Mode"

#: optionsUtils.js:14
#: optionsUtils.js:17
msgid "Camera"
msgstr "Camera"

#: optionsUtils.js:14
#: optionsUtils.js:17
msgid "Fn Lock"
msgstr "Fn Lock"

#: optionsUtils.js:14
#: optionsUtils.js:17
msgid "Touchpad"
msgstr "Touchpad"

#: optionsUtils.js:14
#: optionsUtils.js:17
msgid "USB Charging"
msgstr "USB Charging"

#: optionsUtils.js:40 optionsUtils.js:97
#: optionsUtils.js:44 optionsUtils.js:111
msgid "Ideapad Controls"
msgstr "Ideapad Controls"

#: optionsUtils.js:97
#: optionsUtils.js:45
#, javascript-format
msgid "Can't write %s to %s. See journalctl logs for more details"
msgstr "Can't write %s to %s. See journalctl logs for more details"

#: optionsUtils.js:111
msgid "Enabled"
msgstr "Enabled"

#: optionsUtils.js:97
#: optionsUtils.js:111
msgid "Disabled"
msgstr "Disabled"

Expand Down
59 changes: 0 additions & 59 deletions po/example.pot

This file was deleted.

Loading

0 comments on commit 119d534

Please sign in to comment.