Skip to content

Commit

Permalink
Fix language build script.
Browse files Browse the repository at this point in the history
This include the following changes:
- Remove qt5-default dependency from language script
- Regenerate the messages and translations

Additionally,
The PR also includes a minor refactoring.
  • Loading branch information
xoriole committed Jul 20, 2023
1 parent 55c2661 commit 4afbf0c
Show file tree
Hide file tree
Showing 9 changed files with 351 additions and 359 deletions.
Binary file modified src/tribler/gui/i18n/es_ES.qm
Binary file not shown.
174 changes: 87 additions & 87 deletions src/tribler/gui/i18n/es_ES.ts

Large diffs are not rendered by default.

177 changes: 86 additions & 91 deletions src/tribler/gui/i18n/pt_BR.ts

Large diffs are not rendered by default.

Binary file modified src/tribler/gui/i18n/ru_RU.qm
Binary file not shown.
174 changes: 87 additions & 87 deletions src/tribler/gui/i18n/ru_RU.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/tribler/gui/i18n/update_translations.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#sudo apt install qtchooser qt5-default qttools5-dev-tools
#sudo apt install qtchooser qttools5-dev-tools
lrelease *.ts
Binary file modified src/tribler/gui/i18n/zh_CN.qm
Binary file not shown.
174 changes: 87 additions & 87 deletions src/tribler/gui/i18n/zh_CN.ts

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions src/tribler/gui/tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from urllib.parse import unquote_plus

import pytest
from pytest_asyncio import fixture

from tribler.gui.utilities import TranslatedString, compose_magnetlink, create_api_key, dict_item_is_any_of, \
duration_to_string, \
Expand Down Expand Up @@ -221,24 +222,20 @@ def test_missed_key_in_both_translated_and_original_strings(warning: Mock):


@patch("tribler.gui.utilities.get_base_path")
def test_i18n_file_path(mock_get_base_path, tmp_path):
def test_i18n_file_path_and_languages_content(mock_get_base_path, tmp_path):
mock_get_base_path.return_value = tmp_path

filename = "languages.json"
expected_path = Path(tmp_path) / I18N_DIR / filename

assert get_i18n_file_path(filename) == expected_path


@patch("tribler.gui.utilities.get_base_path")
def test_get_languages_file_content(mock_get_base_path, tmp_path):
mock_get_base_path.return_value = tmp_path

languages_json = {
"unknown": "Unknown",
"en": "English",
"nl": "Dutch"
}

language_path = get_i18n_file_path(LANGUAGES_FILE)
language_path.parents[0].mkdir(parents=True, exist_ok=True)
language_path.write_text(json.dumps(languages_json))
Expand Down

0 comments on commit 4afbf0c

Please sign in to comment.