-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/nuxeo/nuxeo-drive into wip-…
…NXDRIVE-2929-upgrade-python-from-3.9.5-to-3.12.3
- Loading branch information
Showing
10 changed files
with
161 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from ..translator import Translator | ||
|
||
|
||
def get_known_types_translations() -> dict: | ||
KNOWN_FOLDER_TYPES = { | ||
"OrderedFolder": Translator.get("ORDERED_FOLDER"), | ||
"Folder": Translator.get("FOLDER"), | ||
} | ||
KNOWN_FILE_TYPES = { | ||
"Audio": Translator.get("AUDIO"), | ||
"File": Translator.get("FILE"), | ||
"Picture": Translator.get("PICTURE"), | ||
"Video": Translator.get("VIDEO"), | ||
} | ||
DEFAULT_TYPES = { | ||
"Automatic": Translator.get("AUTOMATICS"), | ||
"Create": Translator.get("CREATE"), | ||
} | ||
|
||
return { | ||
"FOLDER_TYPES": KNOWN_FOLDER_TYPES, | ||
"FILE_TYPES": KNOWN_FILE_TYPES, | ||
"DEFAULT": DEFAULT_TYPES, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from pathlib import Path | ||
|
||
from nxdrive.gui.constants import get_known_types_translations | ||
from nxdrive.translator import Translator | ||
|
||
|
||
def get_folder(folder) -> Path: | ||
return Path(__file__).parent.parent / "resources" / folder | ||
|
||
|
||
def test_get_known_types_translations(): | ||
Translator(get_folder("i18n")) | ||
assert Translator.locale() == "en" | ||
res = get_known_types_translations() | ||
|
||
known_folder_types = res.get("FOLDER_TYPES", {}) | ||
known_file_types = res.get("FILE_TYPES", {}) | ||
default_types = res.get("DEFAULT", {}) | ||
|
||
assert known_folder_types["Folder"] == Translator.get("FOLDER") | ||
assert known_file_types["Audio"] == Translator.get("AUDIO") | ||
assert default_types["Automatic"] == Translator.get("AUTOMATICS") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.