|
55 | 55 | import importlib
|
56 | 56 |
|
57 | 57 | VALID_TKS = [
|
58 |
| - 'en-GB', 'da-DK', 'fi-FI', 'nb-NO', 'sv-SE', 'de-DE', 'fr-FR', 'ar-AR', |
| 58 | + 'en-GB', 'en-US', 'da-DK', 'fi-FI', 'nb-NO', 'sv-SE', 'de-DE', 'is-IS', 'fr-FR', 'ar-AR', |
59 | 59 | 'es-ES', 'it-IT', 'pl-PL', 'en']
|
60 | 60 |
|
61 | 61 | VAR_SUFFIXES = [
|
@@ -1878,7 +1878,7 @@ def parents(self, name):
|
1878 | 1878 | @verify(variables={'x': 'both', 'y': 'both_nested', 'w': 'columns'})
|
1879 | 1879 | def crosstab(self, x, y=[], w=None, f=None, ci='counts', base='auto', stats=False,
|
1880 | 1880 | sig_level=None, rules=False, decimals=1, xtotal=False,
|
1881 |
| - painted=True): |
| 1881 | + painted=True, text_key=None): |
1882 | 1882 | """
|
1883 | 1883 | Return a well formated crosstab. (New version)
|
1884 | 1884 | Parameters
|
@@ -1916,6 +1916,8 @@ def crosstab(self, x, y=[], w=None, f=None, ci='counts', base='auto', stats=Fals
|
1916 | 1916 | regular frequency of the x column.
|
1917 | 1917 | painted: bool, default True
|
1918 | 1918 | Add texts from the meta to the index and columns.
|
| 1919 | + text_key: string, default None |
| 1920 | + What language text key to use when returning the result. |
1919 | 1921 | """
|
1920 | 1922 | def _rounding(x, dec):
|
1921 | 1923 | try:
|
@@ -2014,7 +2016,10 @@ def _rounding(x, dec):
|
2014 | 2016 | folder = 'ct')
|
2015 | 2017 |
|
2016 | 2018 | if painted:
|
2017 |
| - cm.paint_all(totalize=True) |
| 2019 | + if text_key is not None: |
| 2020 | + cm.paint_all(totalize=True, text_key=text_key) |
| 2021 | + else: |
| 2022 | + cm.paint_all(totalize=True) |
2018 | 2023 |
|
2019 | 2024 | dfs = []
|
2020 | 2025 | for chain in cm['ct']:
|
|
0 commit comments