{"id":34659956,"url":"https://github.com/liblxn/lxn-go","last_synced_at":"2026-05-27T15:02:31.629Z","repository":{"id":57603898,"uuid":"107179828","full_name":"liblxn/lxn-go","owner":"liblxn","description":"An lxn implementation for Go","archived":false,"fork":false,"pushed_at":"2024-03-13T14:47:03.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T12:52:38.352Z","etag":null,"topics":["l10n","localization","lxn"],"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/liblxn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-16T20:32:59.000Z","updated_at":"2024-01-29T20:18:56.000Z","dependencies_parsed_at":"2024-02-04T07:34:48.427Z","dependency_job_id":"be00a3f6-16e5-4026-b5a2-7201b32e7e9e","html_url":"https://github.com/liblxn/lxn-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/liblxn/lxn-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liblxn%2Flxn-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liblxn%2Flxn-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liblxn%2Flxn-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liblxn%2Flxn-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liblxn","download_url":"https://codeload.github.com/liblxn/lxn-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liblxn%2Flxn-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33570993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"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":["l10n","localization","lxn"],"created_at":"2025-12-24T18:51:49.600Z","updated_at":"2026-05-27T15:02:31.625Z","avatar_url":"https://github.com/liblxn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lxn-go\n`lxn-go` is an [lxn](https://github.com/liblxn/lxn) client library for the\nGo programming language.\n\n## Translating Text\nTo translate text, a dictionary has to be loaded:\n```golang\nfunc ReadDictionary(r io.Reader) (*Dictionary, error)\n```\nThis function reads a binary dictionary from `r` and returns the dictionary\nwith all messages and the locale information needed to format these messages.\nOnce a dictionary is obtained, it can be used to translate messages.\n\nA message can contain variable parts which can be replaced during runtime.\nIn order to render a message correctly all of the variables need to be\npassed into the translation method of the dictionary. The following variable\ntypes are currently supported:\n\n* [`Int`](https://godoc.org/github.com/liblxn/lxn-go#Int) for signed integer values\n* [`Uint`](https://godoc.org/github.com/liblxn/lxn-go#Uint) for unsigned integer values\n* [`Float`](https://godoc.org/github.com/liblxn/lxn-go#Float) for floating-point numbers\n* [`String`](https://godoc.org/github.com/liblxn/lxn-go#String) for strings\n\n## Example\n```golang\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\tlxn \"github.com/liblxn/lxn-go\"\n)\n\nfunc main() {\n\tdic := loadDictionary(\"en\")\n\tmsg := dic.Translate(\"the-section\", \"the-message-key\", lxn.Context{\n\t\t\"key1\": lxn.Float(3.1415),\n\t\t\"key2\": lxn.Uint(7),\n\t})\n\n\tfmt.Println(\"message for 'hello.lxn':\", msg)\n}\n\nfunc loadDictionary(lang string) *lxn.Dictionary {\n\tdic, err := lxn.FromFile(lxn.ReadDictionary, fmt.Sprintf(\"translations/%s.lxnc\", lang))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn dic\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliblxn%2Flxn-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliblxn%2Flxn-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliblxn%2Flxn-go/lists"}