let realize t =
let map_translate =
MapTextdomain.fold (
fun textdomain _ m ->
add_textdomain t m textdomain
) t.textdomains MapTranslate.empty
in
let dummy_translate =
GettextTranslate.Dummy.create t "(none)" ( fun s -> s )
in
fun printf_format opt str plural_form category ->
(
let textdomain =
match opt with
Some textdomain -> textdomain
| None -> t.default
in
try
Translate.translate (
MapTranslate.find (textdomain,category) map_translate
) printf_format str plural_form
with Not_found ->
GettextTranslate.Dummy.translate
dummy_translate
printf_format str plural_form
)