valeriobelli / langua Goto Github PK
View Code? Open in Web Editor NEWA tiny i18n library for every need.
License: MIT License
A tiny i18n library for every need.
License: MIT License
As of now, this repository does not have Issues templates. This situation means that contributors would not follow a precise standard when opening feature requests or bug tickets, making the maintainers' lives harder.
Is your feature request related to a problem? Please describe.
Currently, Langua offers only a simple integration that does not fit React.
Describe the solution you'd like
A new library called @langua/react
.
A context LanguaProvider
to share the current translation status to the React tree. We use LanguaProvider
to clarify that this provider belongs to the scope @langua
.
A hook useTranslation
that, given a key and some values, returns the related interpolated translation.
A hook useLangua
that permits access to the Langua's primitives (e.g., setLocale
, translate
, etc.).
A component Translation
that, given a key and some values, returns the related interpolated translation.
A High Order Component withLangua
that acts as useLangua
.
Describe alternatives you've considered
https://react.i18next.com/
Additional context
None.
Most of the time, having to go through trivial Pull Requests (e.g., Dependabot's PRs that add minor and patch versions) wastes maintainers' time.
Adopting Kodiak would alleviate this problem. The auto-merge feature it offers could reduce the friction that maintainers have during the maintenance of this repository. In this light, for example, only major versions could require a deep analysis done by maintainers.
SSIA
Is your feature request related to a problem? Please describe.
The translate
function is loosely typed. The usage is unclear most of the time. This behaviour produces the following wrong usage:
const i18n = langua({ en: { foo: 'Hello, world!' }, 'en')
i18n.translate({ id: 'foo', values: { 'unknown-value': 'bar' } }) // Having the translation values here means do a no-op uselessy.
Describe the solution you'd like
Explicitly requiring the types of the values when a translation must take some values to be correctly interpolated would force a conscious use.
Describe alternatives you've considered
Treat the translation associated with a translation id as a string literal. This characteristic would permit the extraction of the translation values automatically. This is an alternative to be explored.
Additional context
None.
Describe the bug
Dependabot does not work well with Yarn Berry. Every time it updates a dependency it breaks up the yarn.lock
.
Describe the bug
The main
, module
, typings
and exports
fields are missing in the package.json
of @langua/core
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.