{"id":19648650,"url":"https://github.com/bestpractical/locale-maketext-lexicon","last_synced_at":"2025-07-24T23:42:07.526Z","repository":{"id":66697583,"uuid":"173913","full_name":"bestpractical/locale-maketext-lexicon","owner":"bestpractical","description":null,"archived":false,"fork":false,"pushed_at":"2010-03-11T12:28:19.000Z","size":217,"stargazers_count":3,"open_issues_count":0,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-28T16:48:25.941Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://search.cpan.org/dist/Locale-Maketext-Lexicon","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bestpractical.png","metadata":{"files":{"readme":"README","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-04-12T05:52:12.000Z","updated_at":"2024-12-11T02:08:17.000Z","dependencies_parsed_at":"2023-02-20T09:30:43.310Z","dependency_job_id":null,"html_url":"https://github.com/bestpractical/locale-maketext-lexicon","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/bestpractical/locale-maketext-lexicon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestpractical%2Flocale-maketext-lexicon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestpractical%2Flocale-maketext-lexicon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestpractical%2Flocale-maketext-lexicon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestpractical%2Flocale-maketext-lexicon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bestpractical","download_url":"https://codeload.github.com/bestpractical/locale-maketext-lexicon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestpractical%2Flocale-maketext-lexicon/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266923038,"owners_count":24006996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T14:49:23.297Z","updated_at":"2025-07-24T23:42:07.501Z","avatar_url":"https://github.com/bestpractical.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n    Locale::Maketext::Lexicon - Use other catalog formats in Maketext\n\nVERSION\n    This document describes version 0.71 of Locale::Maketext::Lexicon,\n    released October 5, 2008.\n\nSYNOPSIS\n    As part of a localization class, automatically glob for available\n    lexicons:\n\n        package Hello::I18N;\n        use base 'Locale::Maketext';\n        use Locale::Maketext::Lexicon {\n            '*' =\u003e [Gettext =\u003e '/usr/local/share/locale/*/LC_MESSAGES/hello.mo'],\n            ### Uncomment to decode lexicon entries into Unicode strings\n            # _decode =\u003e 1,\n            ### Uncomment to fallback when a key is missing from lexicons\n            # _auto   =\u003e 1,\n            ### Uncomment to use %1 / %quant(%1) instead of [_1] / [quant, _1]\n            # _style  =\u003e 'gettext',\n        };\n\n    Explicitly specify languages, during compile- or run-time:\n\n        package Hello::I18N;\n        use base 'Locale::Maketext';\n        use Locale::Maketext::Lexicon {\n            de =\u003e [Gettext =\u003e 'hello_de.po'],\n            fr =\u003e [\n                Gettext =\u003e 'hello_fr.po',\n                Gettext =\u003e 'local/hello/fr.po',\n            ],\n        };\n        # ... incrementally add new lexicons\n        Locale::Maketext::Lexicon-\u003eimport({\n            de =\u003e [Gettext =\u003e 'local/hello/de.po'],\n        })\n\n    Alternatively, as part of a localization subclass:\n\n        package Hello::I18N::de;\n        use base 'Hello::I18N';\n        use Locale::Maketext::Lexicon (Gettext =\u003e \\*DATA);\n        __DATA__\n        # Some sample data\n        msgid \"\"\n        msgstr \"\"\n        \"Project-Id-Version: Hello 1.3.22.1\\n\"\n        \"MIME-Version: 1.0\\n\"\n        \"Content-Type: text/plain; charset=iso8859-1\\n\"\n        \"Content-Transfer-Encoding: 8bit\\n\"\n\n        #: Hello.pm:10\n        msgid \"Hello, World!\"\n        msgstr \"Hallo, Welt!\"\n\n        #: Hello.pm:11\n        msgid \"You have %quant(%1,piece) of mail.\"\n        msgstr \"Sie haben %quant(%1,Poststueck,Poststuecken).\"\n\nDESCRIPTION\n    This module provides lexicon-handling modules to read from other\n    localization formats, such as *Gettext*, *Msgcat*, and so on.\n\n    If you are unfamiliar with the concept of lexicon modules, please\n    consult Locale::Maketext and \u003chttp://www.autrijus.org/webl10n/\u003e first.\n\n    A command-line utility xgettext.pl is also installed with this module,\n    for extracting translatable strings from source files.\n\n  The \"import\" function\n    The \"import()\" function accepts two forms of arguments:\n\n    (*format* =\u003e *source* ... )\n        This form takes any number of argument pairs (usually one); *source*\n        may be a file name, a filehandle, or an array reference.\n\n        For each such pair, it pass the contents specified by the second\n        argument to Locale::Maketext::Lexicon::*format*-\u003eparse as a plain\n        list, and export its return value as the %Lexicon hash in the\n        calling package.\n\n        In the case that there are multiple such pairs, the lexicon defined\n        by latter ones overrides earlier ones.\n\n    { *language* =\u003e [ *format*, *source* ... ] ... }\n        This form accepts a hash reference. It will export a %Lexicon into\n        the subclasses specified by each *language*, using the process\n        described above. It is designed to alleviate the need to set up a\n        separate subclass for each localized language, and just use the\n        catalog files.\n\n        This module will convert the *language* arguments into lowercase,\n        and replace all \"-\" with \"_\", so \"zh_TW\" and \"zh-tw\" will both map\n        to the \"zh_tw\" subclass.\n\n        If *language* begins with \"_\", it is taken as an option that\n        controls how lexicons are parsed. See \"Options\" for a list of\n        available options.\n\n        The \"*\" is a special *language*; it must be used in conjunction with\n        a filename that also contains \"*\"; all matched files with a valid\n        language code in the place of \"*\" will be automatically prepared as\n        a lexicon subclass. If there is multiple \"*\" in the filename, the\n        last one is used as the language name.\n\n  Options\n    \"_auto\"\n        If set to a true value, missing lookups on lexicons are handled\n        silently, as if an \"Auto\" lexicon has been appended on all language\n        lexicons.\n\n    \"_decode\"\n        If set to a true value, source entries will be converted into\n        utf8-strings (available in Perl 5.6.1 or later). This feature needs\n        the Encode or Encode::compat module.\n\n        Currently, only the \"Gettext\" backend supports this option.\n\n    \"_encoding\"\n        This option only has effect when \"_decode\" is set to true. It\n        specifies an encoding to store lexicon entries, instead of\n        utf8-strings.\n\n        If \"_encoding\" is set to \"locale\", the encoding from the current\n        locale setting is used.\n\n  Subclassing format handlers\n    If you wish to override how sources specified in different data types\n    are handled, please use a subclass that overrides \"lexicon_get_*TYPE*\".\n\n    XXX: not documented well enough yet. Patches welcome.\n\nNOTES\n    When you attempt to localize an entry missing in the lexicon, Maketext\n    will throw an exception by default. To inhibit this behaviour, override\n    the \"_AUTO\" key in your language subclasses, for example:\n\n        $Hello::I18N::en::Lexicon{_AUTO} = 1; # autocreate missing keys\n\n    If you want to implement a new \"Lexicon::*\" backend module, please note\n    that \"parse()\" takes an array containing the source strings from the\n    specified filehandle or filename, which are *not* \"chomp\"ed. Although if\n    the source is an array reference, its elements will probably not contain\n    any newline characters anyway.\n\n    The \"parse()\" function should return a hash reference, which will be\n    assigned to the *typeglob* (*Lexicon) of the language module. All it\n    amounts to is that if the returned reference points to a tied hash, the\n    %Lexicon will be aliased to the same tied hash if it was not initialized\n    previously.\n\nACKNOWLEDGMENTS\n    Thanks to Jesse Vincent for suggesting this module to be written.\n\n    Thanks also to Sean M. Burke for coming up with Locale::Maketext in the\n    first place, and encouraging me to experiment with alternative Lexicon\n    syntaxes.\n\n    Thanks also to Yi Ma Mao for providing the MO file parsing subroutine,\n    as well as inspiring me to implement file globbing and transcoding\n    support.\n\n    See the AUTHORS file in the distribution for a list of people who have\n    sent helpful patches, ideas or comments.\n\nSEE ALSO\n    xgettext.pl for extracting translatable strings from common template\n    systems and perl source files.\n\n    Locale::Maketext, Locale::Maketext::Lexicon::Auto,\n    Locale::Maketext::Lexicon::Gettext, Locale::Maketext::Lexicon::Msgcat,\n    Locale::Maketext::Lexicon::Tie\n\nAUTHORS\n    Audrey Tang \u003ccpan@audreyt.org\u003e\n\nCOPYRIGHT\n    Copyright 2002-2008 by Audrey Tang \u003ccpan@audreyt.org\u003e.\n\n    This software is released under the MIT license cited below.\n\n  The \"MIT\" License\n    Permission is hereby granted, free of charge, to any person obtaining a\n    copy of this software and associated documentation files (the\n    \"Software\"), to deal in the Software without restriction, including\n    without limitation the rights to use, copy, modify, merge, publish,\n    distribute, sublicense, and/or sell copies of the Software, and to\n    permit persons to whom the Software is furnished to do so, subject to\n    the following conditions:\n\n    The above copyright notice and this permission notice shall be included\n    in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestpractical%2Flocale-maketext-lexicon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbestpractical%2Flocale-maketext-lexicon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestpractical%2Flocale-maketext-lexicon/lists"}