diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2020-09-14 20:34:51 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2020-09-14 20:34:51 +0100 |
commit | a1d24974e808c3a0fb6072d010ccabbc38703232 (patch) | |
tree | 051c17969fc7ff3458232406431d3127d23cad2b /scripts | |
parent | 822a4fb7d2645a4167b987995a190169133cff42 (diff) |
SL-13705 - lock all columns except C in the excel file (apparently google sheets does not respect this setting on import)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/code_tools/modified_strings.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/scripts/code_tools/modified_strings.py b/scripts/code_tools/modified_strings.py index b77115ed46..c259a0f984 100644 --- a/scripts/code_tools/modified_strings.py +++ b/scripts/code_tools/modified_strings.py @@ -235,14 +235,18 @@ def save_as_excel(data, lang): workbook = writer.book worksheet = writer.sheets['Sheet1'] - cell_format = workbook.add_format({'text_wrap': True}) - - # Translators primarily care about columns A-C - worksheet.set_column('A:C', 100, cell_format) - worksheet.set_column('D:D', 50, cell_format, {'hidden': True}) - worksheet.set_column('E:F', 30, cell_format, {'hidden': True}) - - # Lock the column header in place while scrolling + wrap_format = workbook.add_format({'text_wrap': True}) + wrap_unlocked_format = workbook.add_format({'text_wrap': True, 'locked': False}) + + # Translators primarily care about columns A-C, and should write + # only in column C. Can hide the others. Set widths. + worksheet.protect() + worksheet.set_column('A:B', 100, wrap_format) + worksheet.set_column('C:C', 100, wrap_unlocked_format) + worksheet.set_column('D:D', 50, wrap_format, {'hidden': True}) + worksheet.set_column('E:F', 30, wrap_format, {'hidden': True}) + + # Lock the top row (column headers) in place while scrolling worksheet.freeze_panes(1, 0) writer.save() |