https://github.com/snivilised/li18ngo
🌐 i18n helper
https://github.com/snivilised/li18ngo
golang golib i18n
Last synced: about 1 year ago
JSON representation
🌐 i18n helper
- Host: GitHub
- URL: https://github.com/snivilised/li18ngo
- Owner: snivilised
- License: mit
- Created: 2024-08-13T08:34:24.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-10T14:39:47.000Z (over 1 year ago)
- Last Synced: 2025-02-14T23:48:32.018Z (over 1 year ago)
- Topics: golang, golib, i18n
- Language: Go
- Homepage:
- Size: 130 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🌐 li18ngo: ___i18n helper___
[](https://commonflow.org)
[](https://git-scm.com/book/en/v2/Git-Branching-Rebasing)
[](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule)
[](https://pkg.go.dev/github.com/snivilised/li18ngo)
[](https://goreportcard.com/report/github.com/snivilised/li18ngo)
[](https://coveralls.io/github/snivilised/li18ngo?branch=master&kill_cache=1)
[](https://github.com/snivilised/li18ngo/actions/workflows/ci-workflow.yml)
[](https://github.com/pre-commit/pre-commit)
[](https://www.conventionalcommits.org/)
## 🔰 Introduction
This project contains helpers to aid in the development of libraries and programs that require i18n support. It doesn't perform i18n itself, that is delegated to [go-i18n](https://github.com/nicksnyder/go-i18n). Rather it aims to provide functionality that makes using go-i18n easier. For example, implementing localised error messages can be a bit tedious and error prone so included within this module is a cli app, ___lingo___, that can generate all error related code (PS, this has not been implemented yet, so is still in the works).
## 📚 Usage
## 🎀 Features
+ unit testing with [Ginkgo](https://onsi.github.io/ginkgo/)/[Gomega](https://onsi.github.io/gomega/)
+ i18n with [go-i18n](https://github.com/nicksnyder/go-i18n)
+ linting configuration and pre-commit hooks, (see: [linting-golang](https://freshman.tech/linting-golang/)).
### 🌐 l10n Translations
This template has been setup to support localisation. The default language is `en-GB` with support for `en-US`. There is a translation file for `en-US` defined as __src/i18n/deploy/arcadia.active.en-US.json__. This is the initial translation for `en-US` that should be deployed with the app.
Make sure that the go-i18n package has been installed so that it can be invoked as cli, see [go-i18n](https://github.com/nicksnyder/go-i18n) for installation instructions.
To maintain localisation of the application, the user must take care to implement all steps to ensure translate-ability of all user facing messages. Whenever there is a need to add/change user facing messages including error messages, to maintain this state, the user must:
+ define template struct (__xxxTemplData__) in __src/i18n/messages.go__ and corresponding __Message()__ method. All messages are defined here in the same location, simplifying the message extraction process as all extractable strings occur at the same place. Please see [go-i18n](https://github.com/nicksnyder/go-i18n) for all translation/pluralisation options and other regional sensitive content.
For more detailed workflow instructions relating to i18n, please see [i18n README](./resources/doc/i18n-README.md). For details on how defining translate-able content can be achieved consistently, see [Defining Content](./resources/doc/DEFINING-CONTENT.md)


