An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# 🌐 li18ngo: ___i18n helper___

[![A B](https://img.shields.io/badge/branching-commonflow-informational?style=flat)](https://commonflow.org)
[![A B](https://img.shields.io/badge/merge-rebase-informational?style=flat)](https://git-scm.com/book/en/v2/Git-Branching-Rebasing)
[![A B](https://img.shields.io/badge/branch%20history-linear-blue?style=flat)](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule)
[![Go Reference](https://pkg.go.dev/badge/github.com/snivilised/li18ngo.svg)](https://pkg.go.dev/github.com/snivilised/li18ngo)
[![Go report](https://goreportcard.com/badge/github.com/snivilised/li18ngo)](https://goreportcard.com/report/github.com/snivilised/li18ngo)
[![Coverage Status](https://coveralls.io/repos/github/snivilised/li18ngo/badge.svg?branch=master)](https://coveralls.io/github/snivilised/li18ngo?branch=master&kill_cache=1)
[![Li18ngo Continuous Integration](https://github.com/snivilised/li18ngo/actions/workflows/ci-workflow.yml/badge.svg)](https://github.com/snivilised/li18ngo/actions/workflows/ci-workflow.yml)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![A B](https://img.shields.io/badge/commit-conventional-commits?style=flat)](https://www.conventionalcommits.org/)


go dev

## 🔰 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


ginkgo
gomega

+ 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)