Skip to content

Commit 1317088

Browse files
committed
add support for translations with "manual-install" for developing
1 parent 48da788 commit 1317088

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,25 @@ run:
5151
.PHONY: register27
5252
register27:
5353
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister ui_example --silent --force || true
54+
docker exec master-stable27-1 rm -rf /tmp/ui_example_l10n && docker cp l10n master-stable27-1:/tmp/ui_example_l10n
5455
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register ui_example manual_install --json-info \
55-
"{\"appid\":\"ui_example\",\"name\":\"UI Example\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9035,\"scopes\":[],\"system_app\":0}" \
56+
"{\"id\":\"ui_example\",\"name\":\"UI Example\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9035,\"scopes\":[],\"system_app\":0, \"translations_folder\":\"\/tmp\/ui_example_l10n\"}" \
5657
--force-scopes --wait-finish
5758

5859
.PHONY: register28
5960
register28:
6061
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:unregister ui_example --silent --force || true
62+
docker exec master-stable28-1 rm -rf /tmp/ui_example_l10n && docker cp l10n master-stable28-1:/tmp/ui_example_l10n
6163
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:register ui_example manual_install --json-info \
62-
"{\"appid\":\"ui_example\",\"name\":\"UI Example\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9035,\"scopes\":[],\"system_app\":0}" \
64+
"{\"id\":\"ui_example\",\"name\":\"UI Example\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9035,\"scopes\":[],\"system_app\":0, \"translations_folder\":\"\/tmp\/ui_example_l10n\"}" \
6365
--force-scopes --wait-finish
6466

6567
.PHONY: register
6668
register:
6769
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister ui_example --silent --force || true
70+
docker exec master-nextcloud-1 rm -rf /tmp/ui_example_l10n && docker cp l10n master-nextcloud-1-1:/tmp/ui_example_l10n
6871
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register ui_example manual_install --json-info \
69-
"{\"appid\":\"ui_example\",\"name\":\"UI Example\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9035,\"scopes\":[],\"system_app\":0}" \
72+
"{\"id\":\"ui_example\",\"name\":\"UI Example\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9035,\"scopes\":[],\"system_app\":0, \"translations_folder\":\"\/tmp\/ui_example_l10n\"}" \
7073
--force-scopes --wait-finish
7174

7275
.PHONY: translation_templates

lib/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# ../locale/<lang>/LC_MESSAGES/<app_id>.(mo|po)
2424
localedir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "locale")
2525
locale.setlocale(locale.LC_ALL)
26-
locale.bindtextdomain(os.getenv("APP_ID"), localedir)
26+
# locale.bindtextdomain(os.getenv("APP_ID"), localedir) - do we need this? It does not work on macOS..
2727
my_l10n = gettext.translation(
2828
os.getenv("APP_ID"), localedir, fallback=True, languages=["en", "uk"]
2929
)

0 commit comments

Comments
 (0)