diff --git a/install_files/ansible-base/roles/tails-config/tasks/install_shell_extension.yml b/install_files/ansible-base/roles/tails-config/tasks/install_shell_extension.yml index e592b331170..ec352caf3cd 100644 --- a/install_files/ansible-base/roles/tails-config/tasks/install_shell_extension.yml +++ b/install_files/ansible-base/roles/tails-config/tasks/install_shell_extension.yml @@ -157,6 +157,16 @@ - "{{ _securedrop_extension_info }}" - "{{ tails_config_extension_directories }}" +- name: Add extension translations in Persistent Storage + synchronize: + src: "{{ tails_config_amnesia_persistent }}/securedrop/securedrop/translations/" + dest: "{{ tails_config_live_dotfiles }}/.local/share/gnome-shell/extensions/securedrop@securedrop.freedom.press/po/" + +- name: Add extension translations in the running system + synchronize: + src: "{{ tails_config_amnesia_persistent }}/securedrop/securedrop/translations/" + dest: "/home/amnesia/.local/share/gnome-shell/extensions/securedrop@securedrop.freedom.press/po/" + - name: Enable the new GNOME Shell extension become: no command: gnome-extensions enable securedrop@securedrop.freedom.press diff --git a/securedrop/babel.cfg b/securedrop/babel.cfg index 52ae100b04a..061374b5b65 100644 --- a/securedrop/babel.cfg +++ b/securedrop/babel.cfg @@ -10,3 +10,6 @@ silent=False [jinja2: */*.html] silent=False extensions=jinja2.ext.autoescape,jinja2.ext.with_,jinja2.ext.do + +[javascript: **.js.in] +extract_messages = $._, jQuery._ diff --git a/securedrop/i18n_tool.py b/securedrop/i18n_tool.py index e8bbb631fc6..09b0fe5db47 100755 --- a/securedrop/i18n_tool.py +++ b/securedrop/i18n_tool.py @@ -27,6 +27,7 @@ LOCALE_DIR = { "securedrop": "securedrop/translations", "desktop": "install_files/ansible-base/roles/tails-config/templates", + "extension": "install_files/ansible-base/roles/tails-config/templates", } @@ -236,7 +237,8 @@ def set_translate_messages_parser(self, subps: _SubParsersAction) -> None: "translate-messages", help=("Update and compile " "source and template translations") ) translations_dir = join(dirname(realpath(__file__)), "translations") - sources = ".,source_templates,journalist_templates" + extension_location = join(dirname(realpath(__file__)), "..", LOCALE_DIR["extension"]) + sources = join(".,source_templates,journalist_templates,",extension_location) self.set_translate_parser(parser, translations_dir, sources) mapping = "babel.cfg" parser.add_argument(