{"id":37200755,"url":"https://github.com/zuiwuchang/revel-i18n","last_synced_at":"2026-01-14T23:09:10.367Z","repository":{"id":57583747,"uuid":"134514202","full_name":"zuiwuchang/revel-i18n","owner":"zuiwuchang","description":"revel i18n tools","archived":false,"fork":false,"pushed_at":"2018-06-05T06:24:58.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-22T16:03:28.566Z","etag":null,"topics":["go","i18n","revel","web"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zuiwuchang.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":"2018-05-23T04:39:35.000Z","updated_at":"2018-06-05T06:24:59.000Z","dependencies_parsed_at":"2022-09-10T12:01:50.233Z","dependency_job_id":null,"html_url":"https://github.com/zuiwuchang/revel-i18n","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zuiwuchang/revel-i18n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuiwuchang%2Frevel-i18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuiwuchang%2Frevel-i18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuiwuchang%2Frevel-i18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuiwuchang%2Frevel-i18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zuiwuchang","download_url":"https://codeload.github.com/zuiwuchang/revel-i18n/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuiwuchang%2Frevel-i18n/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28437930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: 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","i18n","revel","web"],"created_at":"2026-01-14T23:09:09.611Z","updated_at":"2026-01-14T23:09:10.278Z","avatar_url":"https://github.com/zuiwuchang.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discard\n因為 microsoft的原因 此項目 已經被轉移到 [gitlab.com/king011/revel-i18n](https://gitlab.com/king011/revel-i18n)\n\ngithub上的 版本將不在進行 任何維護\n\n# revel-i18n\nrevel i18n tools\n\nrevel-i18n 是孤為 go web 框架 [revel](http://revel.github.io/) 開發的一個 i18n 工具 revel-i18n 可以自動 從 views 中使用正則將 所有 待翻譯的 條目 整理出來 並和 已經存在的翻譯檔案 進行合併\n\n# Rules\n因為是 是使用 正則匹配 且 為了實現上的簡單 revel-i18n 對 views 中的 模板 和 翻譯進行了一些 限制 項目必需符合這些規則 revel-i18n 才能正常 工作\n1. 傳入 msg 的 待翻譯條目 key 不可以含有 一些特殊符號 比如 \\[ \" = ... 但 允許 使用 . - _ ... (具體請查看 cmd/cmdnew/Context.go 中的 MatchKey) 你應該儘量使用 英文字符作為key 而使用 . 或 - 來區分作用域 (比如 /app/about 頁面的 title 你可以將其key定義為 App.About.title 或 App-About-title)\n2. 如果 你的 go template 使用 {{}} 則 key 也不能包含 { } 同理 如果你自定義了 模板 使用 '' '' 則 ' 也不能作為 key\n3. 翻譯的 key value 開始和結尾的空格 會被忽略\n4. 對於 翻譯 檔案 messages 檔案 全部使用 locale.xx locale-XX.xx 來命名 比如 zh 的翻譯檔案 為 locale.zh zh-TW 的翻譯檔案 為 locale-TW.zh\n\n# Install\n1. go get -u -d github.com/zuiwuchang/revel-i18n\n2. cd $GOPATH/src/github.com/zuiwuchang/revel-i18n\n3. ./build-go.sh\n4. go install\n\n# How To Use\n1. cd ${yourProject}\n2. revel-i18n new -l zh-TW --no-line\n3. revel-i18n new -l zh --no-line\n\n```bash\n$ revel-i18n new -h\nnew message file\n\trevel-i18n new -v app/views -m messages -l zh-TW\n\nUsage:\n  revel-i18n new [flags]\n\nFlags:\n      --delimiters string   go template delimiters (default \"{{ }}\")\n  -h, --help                help for new\n  -l, --locale string       locale zh zh-TW zh-HK de ... (default \"zh\")\n  -m, --messages string     revel messages directory (default \"messages\")\n      --no-line             if true not write key file:line\n  -t, --touch               true (Coverage file) false (Merge file)\n  -v, --views string        revel views directory (default \"app/views\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuiwuchang%2Frevel-i18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzuiwuchang%2Frevel-i18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuiwuchang%2Frevel-i18n/lists"}