summaryrefslogtreecommitdiff
path: root/lib/naming/lang.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/naming/lang.ml')
-rw-r--r--lib/naming/lang.ml14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/naming/lang.ml b/lib/naming/lang.ml
index 92c8a9a..2301513 100644
--- a/lib/naming/lang.ml
+++ b/lib/naming/lang.ml
@@ -10,6 +10,7 @@ type t = {
celebration : table;
weekday : table;
month : table;
+ month_abbr : table;
season : table;
rank : table;
colour : table;
@@ -54,13 +55,17 @@ let month t n =
if n < 1 || n > 12 then string_of_int n
else match lookup t (fun x -> x.month) (string_of_int n) with Some v -> v | None -> string_of_int n
+let month_abbr t n =
+ if n < 1 || n > 12 then string_of_int n
+ else match lookup t (fun x -> x.month_abbr) (string_of_int n) with Some v -> v | None -> string_of_int n
+
let code t = t.code
let fallback_code t = t.fallback_code
let raw =
{ code = "raw"; fallback_code = None; celebration = empty_table; weekday = empty_table;
- month = empty_table; season = empty_table; rank = empty_table; colour = empty_table;
- term = empty_table; rite = empty_table; chain = None }
+ month = empty_table; month_abbr = empty_table; season = empty_table; rank = empty_table;
+ colour = empty_table; term = empty_table; rite = empty_table; chain = None }
let with_fallback t base = { t with chain = Some base }
@@ -96,6 +101,7 @@ let of_string text =
celebration = find "celebration";
weekday = find "weekday";
month = find "month";
+ month_abbr = find "month_abbr";
season = find "season";
rank = find "rank";
colour = find "colour";
@@ -107,6 +113,6 @@ let keys t =
let qualify prefix m = SM.bindings m |> List.map (fun (k, v) -> (prefix ^ "." ^ k, v)) in
List.concat
[ qualify "celebration" t.celebration; qualify "weekday" t.weekday;
- qualify "month" t.month; qualify "season" t.season; qualify "rank" t.rank;
- qualify "colour" t.colour; qualify "term" t.term; qualify "rite" t.rite ]
+ qualify "month" t.month; qualify "month_abbr" t.month_abbr; qualify "season" t.season;
+ qualify "rank" t.rank; qualify "colour" t.colour; qualify "term" t.term; qualify "rite" t.rite ]
|> List.sort compare