{
    "mode": "perldoc",
    "parameter": "Locale::Maketext::Simple",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Locale%3A%3AMaketext%3A%3ASimple/json",
    "generated": "2026-06-11T13:22:32Z",
    "synopsis": "Minimal setup (looks for auto/Foo/*.po and auto/Foo/*.mo):\npackage Foo;\nuse Locale::Maketext::Simple;       # exports 'loc'\nloclang('fr');                     # set language to French\nsub hello {\nprint loc(\"Hello, [1]!\", \"World\");\n}\nMore sophisticated example:\npackage Foo::Bar;\nuse Locale::Maketext::Simple (\nClass       => 'Foo',       # search in auto/Foo/\nStyle       => 'gettext',   # %1 instead of [1]\nExport      => 'maketext',  # maketext() instead of loc()\nSubclass    => 'L10N',      # Foo::L10N instead of Foo::I18N\nDecode      => 1,           # decode entries to unicode-strings\nEncoding    => 'locale',    # but encode lexicons in current locale\n# (needs Locale::Maketext::Lexicon 0.36)\n);\nsub japh {\nprint maketext(\"Just another %1 hacker\", \"Perl\");\n}",
    "sections": {
        "NAME": {
            "content": "Locale::Maketext::Simple - Simple interface to Locale::Maketext::Lexicon\n",
            "subsections": []
        },
        "VERSION": {
            "content": "This document describes version 0.18 of Locale::Maketext::Simple, released Septermber 8, 2006.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "Minimal setup (looks for auto/Foo/*.po and auto/Foo/*.mo):\n\npackage Foo;\nuse Locale::Maketext::Simple;       # exports 'loc'\nloclang('fr');                     # set language to French\nsub hello {\nprint loc(\"Hello, [1]!\", \"World\");\n}\n\nMore sophisticated example:\n\npackage Foo::Bar;\nuse Locale::Maketext::Simple (\nClass       => 'Foo',       # search in auto/Foo/\nStyle       => 'gettext',   # %1 instead of [1]\nExport      => 'maketext',  # maketext() instead of loc()\nSubclass    => 'L10N',      # Foo::L10N instead of Foo::I18N\nDecode      => 1,           # decode entries to unicode-strings\nEncoding    => 'locale',    # but encode lexicons in current locale\n# (needs Locale::Maketext::Lexicon 0.36)\n);\nsub japh {\nprint maketext(\"Just another %1 hacker\", \"Perl\");\n}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module is a simple wrapper around Locale::Maketext::Lexicon, designed to alleviate the need\nof creating *Language Classes* for module authors.\n\nThe language used is chosen from the loclang call. If a lookup is not possible, the i-default\nlanguage will be used. If the lookup is not in the i-default language, then the key will be\nreturned.\n\nIf Locale::Maketext::Lexicon is not present, it implements a minimal localization function by\nsimply interpolating \"[1]\" with the first argument, \"[2]\" with the second, etc. Interpolated\nfunction like \"[quant,1]\" are treated as \"[1]\", with the sole exception of \"[tense,1,X]\",\nwhich will append \"ing\" to \"1\" when X is \"present\", or appending \"ed\" to <1> otherwise.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "All options are passed either via the \"use\" statement, or via an explicit \"import\".\n",
            "subsections": [
                {
                    "name": "Class",
                    "content": "By default, Locale::Maketext::Simple draws its source from the calling package's auto/\ndirectory; you can override this behaviour by explicitly specifying another package as \"Class\".\n"
                },
                {
                    "name": "Path",
                    "content": "If your PO and MO files are under a path elsewhere than \"auto/\", you may specify it using the\n\"Path\" option.\n"
                },
                {
                    "name": "Style",
                    "content": "By default, this module uses the \"maketext\" style of \"[1]\" and \"[quant,1]\" for interpolation.\nAlternatively, you can specify the \"gettext\" style, which uses %1 and \"%quant(%1)\" for\ninterpolation.\n\nThis option is case-insensitive.\n"
                },
                {
                    "name": "Export",
                    "content": "By default, this module exports a single function, \"loc\", into its caller's namespace. You can\nset it to another name, or set it to an empty string to disable exporting.\n"
                },
                {
                    "name": "Subclass",
                    "content": "By default, this module creates an \"::I18N\" subclass under the caller's package (or the package\nspecified by \"Class\"), and stores lexicon data in its subclasses. You can assign a name other\nthan \"I18N\" via this option.\n"
                },
                {
                    "name": "Decode",
                    "content": "If set to a true value, source entries will be converted into utf8-strings (available in Perl\n5.6.1 or later). This feature needs the Encode or Encode::compat module.\n"
                },
                {
                    "name": "Encoding",
                    "content": "Specifies an encoding to store lexicon entries, instead of utf8-strings. If set to \"locale\", the\nencoding from the current locale setting is used. Implies a true value for \"Decode\".\n"
                }
            ]
        },
        "ACKNOWLEDGMENTS": {
            "content": "Thanks to Jos I. Boumans for suggesting this module to be written.\n\nThanks to Chia-Liang Kao for suggesting \"Path\" and \"loclang\".\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Locale::Maketext, Locale::Maketext::Lexicon\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Audrey Tang <cpan@audreyt.org>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright 2003, 2004, 2005, 2006 by Audrey Tang <cpan@audreyt.org>.\n\nThis software is released under the MIT license cited below. Additionally, when this software is\ndistributed with Perl Kit, Version 5, you may also redistribute it and/or modify it under the\nsame terms as Perl itself.\n\nThe \"MIT\" License\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software\nand associated documentation files (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or\nsubstantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING\nBUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
            "subsections": []
        }
    },
    "summary": "Locale::Maketext::Simple - Simple interface to Locale::Maketext::Lexicon",
    "flags": [],
    "examples": [],
    "see_also": []
}