Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions machine/corpora/paratext_project_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class ParatextProjectSettings:
biblical_terms_file_name: str
language_code: Optional[str]
translation_type: str
normalization_form: str
language: str
visibility: Optional[str] = None
parent_guid: Optional[str] = None
parent_name: Optional[str] = None
Expand Down
5 changes: 5 additions & 0 deletions machine/corpora/paratext_project_settings_parser_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def parse(self) -> ParatextProjectSettings:
parent_guid = translation_info_setting_parts[2] if translation_info_setting_parts[2] != "" else None

visibility: Optional[str] = settings_tree.getroot().findtext("Visibility")
normalization_form: str = settings_tree.getroot().findtext("NormalizationForm", "Undefined")

language: str = settings_tree.getroot().findtext("Language", "")

settings = ParatextProjectSettings(
guid,
Expand All @@ -116,6 +119,8 @@ def parse(self) -> ParatextProjectSettings:
parts[2],
language_code,
translation_type,
normalization_form,
language,
visibility,
parent_guid,
parent_name,
Expand Down
2 changes: 2 additions & 0 deletions tests/corpora/test_paratext_project_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,7 @@ def _create_settings(file_name_form: str) -> ParatextProjectSettings:
"BiblicalTerms.xml",
"en",
"Standard",
"Undefined",
"English",
"Public",
)
6 changes: 6 additions & 0 deletions tests/corpora/test_paratext_project_settings_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ def test_translation_info_specified() -> None:
assert settings.parent_guid == "22222222222222222222222222222222"


def test_normalization_form_default() -> None:
settings = _create_settings()

assert settings.normalization_form == "Undefined"


def _create_settings(additional_settings_xml: str = ""):
files = {
"Settings.xml": (
Expand Down
4 changes: 4 additions & 0 deletions tests/testutils/memory_paratext_project_file_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def __init__(
biblical_terms_file_name: str = "ProjectBiblicalTerms.xml",
language_code: str = "en",
translation_type: str = "Standard",
normalization_form: str = "Undefined",
language: str = "",
parent_guid: Optional[str] = None,
parent_name: Optional[str] = None,
):
Expand All @@ -69,6 +71,8 @@ def __init__(
biblical_terms_file_name,
language_code,
translation_type,
normalization_form,
language,
parent_guid,
parent_name,
)
Loading