{"id":18582918,"url":"https://github.com/messageformat/po-loader","last_synced_at":"2025-11-01T21:30:26.317Z","repository":{"id":57295239,"uuid":"111025989","full_name":"messageformat/po-loader","owner":"messageformat","description":"Webpack loader for messageformat data in gettext po/pot/mo files","archived":false,"fork":false,"pushed_at":"2018-03-23T15:51:40.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T23:58:18.662Z","etag":null,"topics":["gettext","messageformat","webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/messageformat.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-11-16T21:46:59.000Z","updated_at":"2018-03-30T17:16:24.000Z","dependencies_parsed_at":"2022-08-30T18:21:46.547Z","dependency_job_id":null,"html_url":"https://github.com/messageformat/po-loader","commit_stats":null,"previous_names":["eemeli/messageformat-po-loader"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messageformat%2Fpo-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messageformat%2Fpo-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messageformat%2Fpo-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/messageformat%2Fpo-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/messageformat","download_url":"https://codeload.github.com/messageformat/po-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239317605,"owners_count":19619201,"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","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":["gettext","messageformat","webpack"],"created_at":"2024-11-07T00:16:33.935Z","updated_at":"2025-11-01T21:30:26.276Z","avatar_url":"https://github.com/messageformat.png","language":"JavaScript","readme":"# Gettext loader for Webpack\n\nLoads gettext .po/.pot/.mo files into JavaScript as precompiled functions using\n[gettext-to-messageformat] and [messageformat].\n\nFor loading ICU MessageFormat content, see [messageformat-loader].\n\n## Installation\n\n```sh\nnpm install messageformat messageformat-po-loader\n```\n\n\n## Usage\n\nFor a working demo of the following, run `npm install` in the `example/`\ndirectory, and then open `example/dist/index.html` in a browser.\n\n\n#### Webpack configuration\n\n```js\n{\n  test: [/\\.pot?$/, /\\.mo$/],\n  loader: require.resolve('messageformat-po-loader'),\n  options: {\n    biDiSupport: false,\n    defaultCharset: null,\n    defaultLocale: 'en',\n    forceContext: false,\n    pluralFunction: null,\n    verbose: false\n  }\n}\n```\n\nThe default option values are shown, and are not required. Most options are\npassed on to [gettext-to-messageformat] (see there for their documentation);\n`defaultLocale` is the fallback used by [messageformat] if not set in the .po\nfile `language` header comment, and `biDiSupport` enables bi-directional text\nsupport in messageformat.\n\n\n#### messages.po\n\n```pot\n# Examples from http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html\nmsgid \"\"\nmsgstr \"\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Language: pl\\n\"\n\"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10\u003e=2 \u0026\u0026 n%10\u003c=4 \u0026\u0026 (n%100\u003c10 || n%100\u003e=20) ? 1 : 2);\\n\"\n\nmsgid \"Time: %1 second\"\nmsgid_plural \"Time: %1 seconds\"\nmsgstr[0] \"Czas: %1 sekunda\"\nmsgstr[1] \"Czas: %1 sekundy\"\nmsgstr[2] \"Czas: %1 sekund\"\n\nmsgid \"%1 took %2 ms to complete.\"\nmsgstr \"Trebalo je %2 ms da se %1 završi.\"\n\nmsgid \"%s took %d ms to complete.\"\nmsgstr \"Trebalo je %2$d ms da se %1$s završi.\"\n\nmsgid \"No star named %(starname)s found.\"\nmsgstr \"Nema zvezde po imenu %(starname)s.\"\n```\n\n\n#### example.js\n\n```js\nimport messages from './messages.po'\n\nmessages['%s took %d ms to complete.'](['TASK', 42])\n// 'Trebalo je 42 ms da se TASK završi.'\n\nmessages['No star named %(starname)s found.']({ starname: 'Chi Draconis' })\n// 'Nema zvezde po imenu Chi Draconis.'\n```\n\n\n[gettext-to-messageformat]: https://github.com/eemeli/gettext-to-messageformat\n[messageformat]: https://messageformat.github.io/\n[messageformat-loader]: https://github.com/messageformat/loader\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessageformat%2Fpo-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmessageformat%2Fpo-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessageformat%2Fpo-loader/lists"}