mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
Extracting default locale to a global constant
This commit is contained in:
parent
e09f71e481
commit
b72e668705
@ -16,7 +16,7 @@ import usertypes
|
||||
import relabeling
|
||||
import table
|
||||
import moment
|
||||
from schema import RecalcWhen
|
||||
from schema import RecalcWhen, DEFAULT_LOCALE
|
||||
|
||||
# pylint:disable=redefined-outer-name
|
||||
|
||||
@ -66,7 +66,7 @@ class MetaTableExtras(object):
|
||||
return {}
|
||||
|
||||
def locale(rec, table):
|
||||
return rec.parsed_settings.get("locale", "en-US")
|
||||
return rec.parsed_settings.get("locale", DEFAULT_LOCALE)
|
||||
|
||||
def friendly_traceback_set_lang(rec, table):
|
||||
try:
|
||||
|
@ -802,7 +802,7 @@ def migration22(tdset):
|
||||
def migration23(tdset):
|
||||
return tdset.apply_doc_actions([
|
||||
add_column('_grist_DocInfo', 'documentSettings', 'Text'),
|
||||
actions.UpdateRecord('_grist_DocInfo', 1, {'documentSettings': '{"locale":"en-US"}'})
|
||||
actions.UpdateRecord('_grist_DocInfo', 1, {'documentSettings': '{"locale":"' + schema.DEFAULT_LOCALE + '"}'})
|
||||
])
|
||||
|
||||
|
||||
|
@ -16,6 +16,7 @@ import six
|
||||
import actions
|
||||
|
||||
SCHEMA_VERSION = 33
|
||||
DEFAULT_LOCALE = "en-US"
|
||||
|
||||
def make_column(col_id, col_type, formula='', isFormula=False):
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user