CatalogWorkspaceService.
generate_localized_workspaces
generate_localized_workspaces(
workspace_id: <nil>, to_lang: <nil>, to_locale: <nil>, from_lang: <nil>, translator_func: <nil>, layout_root_path: <nil>, provision_workspace: <nil>, store_layouts: <nil>
) ->
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
name | type | description |
---|---|---|
workspace_id | ID of source workspace which we clone and translate all texts in it | |
to_lang | ISO lang name (IETF BCP 47) | |
to_locale | ISO lang code and country code (IETF BCP 47, e.g. en-US, cs-CZ, ...). Check GoodData documentation for what codes are supported. | |
from_lang | from which language we are going to translate | |
translator_func | 3rd party service capable of translating a batch of strings to various languages | |
layout_root_path | folder, where to store all layout YAML files (of new translated workspaces)
Also, the translation files are stored there.
if empty, they are stored to:
| |
provision_workspace | Should new workspace for the target language be provisioned? Including setting of corresponding locales. | |
store_layouts | Store declarative layouts of all workspaces to disk |