(core) Simple localization support and currency selector.

Summary:
- Grist document has a associated "locale" setting that affects how currency is formatted.
- Currency selector for number format.

Test Plan: not done

Reviewers: dsagal

Reviewed By: dsagal

Subscribers: paulfitz

Differential Revision: https://phab.getgrist.com/D2977
This commit is contained in:
George Gevoian
2021-08-26 09:35:11 -07:00
parent e492dfdb22
commit a6e08883e0
36 changed files with 405 additions and 84 deletions

View File

@@ -193,13 +193,14 @@ class UserActions(object):
#----------------------------------------
@useraction
def InitNewDoc(self, timezone):
def InitNewDoc(self, timezone, locale):
creation_actions = schema.schema_create_actions()
self._engine.out_actions.stored.extend(creation_actions)
self._engine.out_actions.direct += [True] * len(creation_actions)
self._do_doc_action(actions.AddRecord("_grist_DocInfo", 1,
{'schemaVersion': schema.SCHEMA_VERSION,
'timezone': timezone}))
'timezone': timezone,
'documentSettings': json.dumps({'locale': locale})}))
# Set up initial ACL data.
# NOTE The special records below are not actually used. They were intended for obsolete ACL