{"id":37169089,"url":"https://github.com/durudex/go-polylang","last_synced_at":"2026-01-14T19:58:13.753Z","repository":{"id":65187898,"uuid":"584789915","full_name":"durudex/go-polylang","owner":"durudex","description":"Implementation of the Polylang language in Go.","archived":false,"fork":false,"pushed_at":"2023-05-31T20:59:17.000Z","size":48,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-22T18:15:54.635Z","etag":null,"topics":["go","parser","polylang"],"latest_commit_sha":null,"homepage":"","language":"Go","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/durudex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-01-03T14:21:12.000Z","updated_at":"2024-09-19T09:16:38.000Z","dependencies_parsed_at":"2023-02-14T08:17:22.367Z","dependency_job_id":null,"html_url":"https://github.com/durudex/go-polylang","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/durudex/go-polylang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durudex%2Fgo-polylang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durudex%2Fgo-polylang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durudex%2Fgo-polylang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durudex%2Fgo-polylang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/durudex","download_url":"https://codeload.github.com/durudex/go-polylang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/durudex%2Fgo-polylang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28433877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","parser","polylang"],"created_at":"2026-01-14T19:58:12.964Z","updated_at":"2026-01-14T19:58:13.746Z","avatar_url":"https://github.com/durudex.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `go-polylang`\n\nImplementation of the [Polylang](https://github.com/polybase/polylang) in Go programming language.\n\n## Setup\n\nTo get the [`go-polylang`](https://github.com/durudex/go-polylang) module, you need to have or install [Go version \u003e= 1.19](https://go.dev/dl/). To check your current version of Go, use the `go version` command.\n\n**The command to get the module:**\n\n```bash\ngo get github.com/durudex/go-polylang@latest\n```\n\n## Parser\n\nYou can use the [`parser`](https://pkg.go.dev/github.com/durudex/go-polylang/parser) package to parse your code. It can be used follow:\n\n### Parsing files\n\nTo parse a file or directory of files, you can use the [`parser.Parse()`](https://pkg.go.dev/github.com/durudex/go-polylang/parser#Parse) function by passing the required file or directory path to its arguments.\n\n```go\nimport \"github.com/durudex/go-polylang/parser\"\n\nfunc main() {\n    ast, err := parser.Parse(\"filename.polylang\")\n    if err != nil { /* ... */ }\n}\n```\n\n### Custom parser\n\nCurrently, we are using the [`participle`](github.com/alecthomas/participle) library for code parsing. However, you can create your own parser by configuring it to meet your specific needs.\n\n```go\nimport (\n    \"github.com/durudex/go-polylang\"\n    \"github.com/durudex/go-polylang/ast\"\n\n    \"github.com/alecthomas/participle/v2\"\n)\n\nfunc main() {\n    parser := participle.MustBuild[ast.Program](\n        participle.Lexer(polylang.Lexer),\n    )\n\n    // ...\n}\n```\n\n\u003e **Note:**\n\u003e If you want to use all the features of the library, you can use our ready-made variable [`Must`](https://pkg.go.dev/github.com/durudex/go-polylang/parser#Must), which contains all of the necessary settings for using the library.\n\n## Metadata\n\nTo starting using [metadata](https://pkg.go.dev/github.com/durudex/go-polylang/metadata), you need to install the module.\n\n\u003e **Note:**\n\u003e The data of the metadata that you want to parse must be JSON.\n\n**The command to get the module:**\n\n```\ngo get github.com/durudex/go-polylang/metadata@latest\n```\n\n### Parsing Metadata\n\n```go\nimport \"github.com/durudex/go-polylang/metadata\"\n\nfunc main() {\n    rawJsonData := []byte(\"...\")\n\n    root, err := metadata.Parse(rawJsonData)\n    if err != nil { /* ... */ }\n\n    // ...\n}\n```\n\n### Parsing Metadata File\n\n```go\nimport \"github.com/durudex/go-polylang/metadata\"\n\nfunc main() {\n    root, err := metadata.ParseFile(\"path/to/file.json\")\n    if err != nil { /* ... */ }\n\n    // ...\n}\n```\n\n## License\n\nCopyright © 2022-2023 [Durudex](https://github.com/durudex). Released under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurudex%2Fgo-polylang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdurudex%2Fgo-polylang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdurudex%2Fgo-polylang/lists"}