CatalogWorkspaceService.

generate_localized_workspaces

generate_localized_workspaces(workspace_id: str, to_lang: str, to_locale: str, from_lang: str, translator_func: Callable | None, layout_root_path: Path | None, provision_workspace: bool | None, store_layouts: bool | None, place_in_hierarchy: bool) -> None

Generate layouts of new workspaces based on the source workspace. All texts (titles, ...) will be translated to different languages if requested. Translation YAML files are created for each language containing pairs of source and target texts. If translation is not requested, source and target texts are identical. Users must translate it manually We recommend to translate using a third party service and polish the result manually.

Parameters

nametypedescription
workspace_idstrID of source workspace which we clone and translate all texts in it
to_langstrISO lang name (IETF BCP 47)
to_localestrISO lang code and country code (IETF BCP 47, e.g. en-US, cs-CZ, ...). Check GoodData documentation for what codes are supported.
from_langstrfrom which language we are going to translate
translator_funcCallable | None3rd party service capable of translating a batch of strings to various languages
layout_root_pathPath | Nonefolder, where to store all layout YAML files (of new translated workspaces) Also, the translation files are stored there. if empty, they are stored to: /// / else they are stored to /
provision_workspacebool | NoneShould new workspace for the target language be provisioned? Including setting of corresponding locales.
store_layoutsbool | NoneStore declarative layouts of all workspaces to disk
place_in_hierarchyboolFlag if localized workspace should be placed in the hierarchy.

Returns

typedescription
NoneNone