(**************************************************************************) (* ocaml-gettext: a library to translate messages *) (* *) (* Copyright (C) 2003-2008 Sylvain Le Gall *) (* *) (* This library is free software; you can redistribute it and/or *) (* modify it under the terms of the GNU Lesser General Public *) (* License as published by the Free Software Foundation; either *) (* version 2.1 of the License, or (at your option) any later version; *) (* with the OCaml static compilation exception. *) (* *) (* This library is distributed in the hope that it will be useful, *) (* but WITHOUT ANY WARRANTY; without even the implied warranty of *) (* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *) (* Lesser General Public License for more details. *) (* *) (* You should have received a copy of the GNU Lesser General Public *) (* License along with this library; if not, write to the Free Software *) (* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *) (* USA *) (**************************************************************************) (** PPX dumper to extract strings. @author Richard W.M. Jones @author Sylvain Le Gall *) (* Extract the string which should be used for a gettext translation. Output a po_content list through the function Marshal.to_channel Functions that are looked for : Functions Arg 1 Arg 2 Arg 3 Arg 4 Arg 5 Arg 6 ... s_ singular f_ singular sn_ singular plural _ fn_ singular plural _ gettext _ singular fgettext _ singular dgettext _ domain singular fdgettext _ domain singular dcgettext _ domain singular _ fdcgettext _ domain singular _ ngettext _ singular plural _ fngettext _ singular plural _ dngettext _ domain singular plural _ fdngettext _ domain singular plural _ dcngettext _ domain singular plural _ _ fdcngettext _ domain singular plural _ _ All this function name should also be matched when they are called using a module. *) let visit_expr (iterator : Ast_iterator.iterator) expr = () let ast_iterator () = { Ast_iterator.default_iterator with expr = visit_expr } let transform hook_info structure = let astm = ast_iterator () in astm.structure astm structure let () = Pparse.ImplementationHooks.add_hook "ocaml-gettext" transform