Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8db90b0
Update README.md
Daandamhuis Jan 31, 2023
39d932f
Merge branch 'Curts0:master' into master
Daandamhuis Feb 6, 2023
e82f137
Update README.md
Daandamhuis Feb 7, 2023
b9f8359
Update README.md
Daandamhuis Feb 7, 2023
adb0541
Update README.md
Daandamhuis Feb 7, 2023
e9e8215
Merge branch 'Curts0:master' into master
Daandamhuis Feb 9, 2023
238da72
Update document.py
Daandamhuis Feb 10, 2023
fd37dbc
Update README.md
Daandamhuis Feb 10, 2023
6e140ce
Update document.py
Daandamhuis Feb 10, 2023
b7d014b
Update README.md
Daandamhuis Feb 10, 2023
e1e3b6a
Update README.md
Daandamhuis Feb 10, 2023
74a1dae
Update README.md
Daandamhuis Feb 10, 2023
a94f98b
Merge branch 'Curts0:master' into master
Daandamhuis Feb 12, 2023
9f8ea61
Refactored the documenting part, need to clean some more up.
Daandamhuis Feb 12, 2023
f06967b
Tables and Colums, Need to do Measures
Daandamhuis Feb 12, 2023
c4056a9
Refactored Document.py
Daandamhuis Feb 13, 2023
ead9548
Bugfix: CalculationGroupSource in Partitions
Daandamhuis Feb 13, 2023
5c6513f
Bugfix: CalculationGroup Source.
Daandamhuis Feb 13, 2023
05f786b
Added Docstrings (docs / cult)
Feb 15, 2023
4768339
Merge branch 'Curts0:master' into master
Daandamhuis Feb 15, 2023
44b4572
Updated the docstring requirements.
Daandamhuis Feb 15, 2023
c33b4df
Adjusted some more errors
Daandamhuis Feb 15, 2023
36e3aaa
Adjusted last flake8 errors
Daandamhuis Feb 15, 2023
fa1ae19
Adjusted last flake8 errors
Daandamhuis Feb 15, 2023
9fda043
Removed whitespace
Daandamhuis Feb 15, 2023
dfa0b6f
Typing Error for anything before python 3.9
Feb 15, 2023
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
23 changes: 20 additions & 3 deletions pytabular/culture.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,21 @@ def __init__(self, object, model) -> None:
self.ObjectTranslations = self.set_translation()

def set_translation(self) -> List[dict]:
"""Based on the culture, it creates a list of dicts with available translations."""
"""Based on the culture, it creates a list of dicts with available translations.

The model object doesn't have a Parent object. So that will stay
empty.

Returns:
List[dict]: Translations per object.
"""
return [
{
"object_translation": translation.Value,
"object_name": translation.Object.Name,
"object_parent_name": translation.Object.Parent.Name,
"object_parent_name": translation.Object.Parent.Name
if translation.Object.Parent
else "",
"object_type": str(translation.Property),
}
for translation in self._object.ObjectTranslations
Expand All @@ -35,9 +44,17 @@ def get_translation(

By default it will search for the "Caption" object type, due to fact that a
Display folder and Description can also have translations.

Args:
object_name (str): Object name that you want to translate.
object_parent_name (str): Parent Object name that you want to translate.
object_type (str, optional): The Display Folders can also have translations.
Defaults to "Caption" > Object translation.

Returns:
dict: With translation of the object.
"""
try:
# Removed walrus operator so it can be compatible with with python versions before 3.8
translations = [
d
for d in self.ObjectTranslations
Expand Down
Loading