Source file gettextCompat.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
open GettextTypes
open GettextCategory
open GettextModules
let unsafe_format_of_string fmt str =
if false then Obj.magic str else format_of_string fmt
let bindtextdomain textdomain dir t =
upgrade_textdomain t textdomain (None, Some dir)
let bind_textdomain_codeset textdomain codeset t =
upgrade_textdomain t textdomain (Some codeset, None)
let textdomain default t = { t with default }
let get_textdomain t = t.default
let gettext t' str = t' false None str None LC_MESSAGES
let fgettext t' fmt =
unsafe_format_of_string fmt
(t' true None (string_of_format fmt) None LC_MESSAGES)
let dgettext t' textdomain str =
t' false (Some textdomain) str None LC_MESSAGES
let fdgettext t' textdomain fmt =
unsafe_format_of_string fmt
(t' true (Some textdomain) (string_of_format fmt) None LC_MESSAGES)
let dcgettext t' textdomain str category =
t' false (Some textdomain) str None category
let fdcgettext t' textdomain fmt category =
unsafe_format_of_string fmt
(t' true (Some textdomain) (string_of_format fmt) None category)
let ngettext t' str str_plural n =
t' false None str (Some (str_plural, n)) LC_MESSAGES
let fngettext t' fmt fmt_plural n =
if true then
unsafe_format_of_string fmt
(t' true None (string_of_format fmt)
(Some (string_of_format fmt_plural, n))
LC_MESSAGES)
else fmt_plural
let dngettext t' textdomain str str_plural n =
t' false (Some textdomain) str (Some (str_plural, n)) LC_MESSAGES
let fdngettext t' textdomain fmt fmt_plural n =
if true then
unsafe_format_of_string fmt
(t' true (Some textdomain) (string_of_format fmt)
(Some (string_of_format fmt_plural, n))
LC_MESSAGES)
else fmt_plural
let dcngettext t' textdomain str str_plural n category =
t' false (Some textdomain) str (Some (str_plural, n)) category
let fdcngettext t' textdomain fmt fmt_plural n category =
if true then
unsafe_format_of_string fmt
(t' true (Some textdomain) (string_of_format fmt)
(Some (string_of_format fmt_plural, n))
category)
else fmt_plural