aboutsummaryrefslogtreecommitdiff
path: root/lib/configuration/importConf.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/configuration/importConf.ml')
-rw-r--r--lib/configuration/importConf.ml12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/configuration/importConf.ml b/lib/configuration/importConf.ml
index 3406a11..aa0e2f3 100644
--- a/lib/configuration/importConf.ml
+++ b/lib/configuration/importConf.ml
@@ -5,6 +5,8 @@ module Path = ImportDataTypes.Path
module T = Read_conf
module Expression = ImportExpression.T
+external set_locale : string -> unit = "set_locale"
+
let current_syntax = 1
let t_of_yojson : Yojson.Safe.t -> Syntax.t =
@@ -39,7 +41,14 @@ let t_of_toml : Otoml.t -> (Syntax.t, string) result =
[ "version" ]
in
match version with
- | n when n = latest_version -> TomlReader.read toml
+ | n when n = latest_version ->
+ let conf = TomlReader.read toml in
+ let () =
+ Result.iter
+ (fun conf -> set_locale (Option.value ~default:"" conf.Syntax.locale))
+ conf
+ in
+ conf
| _ ->
Printf.eprintf "Unsuported version : %d\n" version;
exit 1
@@ -49,6 +58,7 @@ let dummy_conf =
{
source = { file = ""; tab = 0; name = "" };
version = 1;
+ locale = Some "C";
externals = [];
columns = [];
filters = [];