betty.locale.translation module¶
Manage translations of built-in translatable strings.
- betty.locale.translation.assert_extension_assets_directory_path(extension: type[Extension]) Path [source]¶
Check that the given extension has an assets directory, and return its path.
- betty.locale.translation.assert_extension_has_assets_directory_path(extension: type[ExtensionT]) type[ExtensionT] [source]¶
Check that the given extension has an assets directory, and return it.
- betty.locale.translation.find_source_files(source_directory_path: Path, *exclude_directory_paths: Path) Iterable[Path] [source]¶
Find source files in a directory.
- async betty.locale.translation.new_dev_translation(locale: str) None [source]¶
Create a new translation for Betty itself.
- async betty.locale.translation.new_extension_translation(locale: str, extension: type[Extension]) None [source]¶
Create a new translation for the given extension.
- async betty.locale.translation.new_project_translation(locale: str, project: Project) None [source]¶
Create a new translation for the given project.
- async betty.locale.translation.update_dev_translations(*, _output_assets_directory_path_override: Path | None = None) None [source]¶
Update the translations for Betty itself.
- async betty.locale.translation.update_extension_translations(extension: type[Extension], source_directory_path: Path | None = None, exclude_source_directory_paths: set[Path] | None = None, *, _output_assets_directory_path_override: Path | None = None) None [source]¶
Update the translations for the given extension.
- async betty.locale.translation.update_project_translations(project_directory_path: Path, source_directory_path: Path | None = None, exclude_source_directory_paths: set[Path] | None = None, *, _output_assets_directory_path_override: Path | None = None) None [source]¶
Update the translations for the given project.