Giter Site home page Giter Site logo

uiwebkit / localize Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.33 MB

Uni Localize

Home Page: https://uiwebkit.com/wgt/loc/2/

License: MIT License

JavaScript 0.65% HTML 48.91% TypeScript 48.56% CSS 1.88%
html web webcomponents custom-elements web-components stencil stenciljs localization localizations widget microfrontend micro-frontend translate languages translation localize javascript typescript

localize's Introduction

Built With Stencil Published on webcomponents.org

<uni-event-load
  url="https://uni.github.io/json/lang-store-flag.json"
  prop="value"
>
  <uni-lang-menu></uni-lang-menu>
</uni-event-load>

<uni-translate>
  This content is localized
</uni-translate>

Uni Localize

Uni Localize is a set of Web Components & Custom Elements for adding multilingual support to your website and customize it in the declarative style.

Uni Localize components have three modes:

  1. Custom Element - 100% convenience;
  2. Web Component - 100% security;
  3. Custom Element with 'only' prop - 100% customization;

Uni Localize takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components & Custom Elements that run in any browser supporting the Custom Elements v1 spec.

Uni Localize components are just HTML Web Components & Custom Elements, so they work in any major framework or with no framework at all.

Getting Started

Clone this repo to a new directory:

git clone https://github.com/uiwebkit/localize.git uni-localize
cd uni-localize

and run:

npm i
npm run serve:dev

To build the component for production, run:

npm run build:prod

Check out our docs here.

Naming Components

When creating new component tags, use uni in the component name (ex: <uni-translate>) or use a prefix that fits your company or any name for a group of related components. For example, all the UiWebKit generated Web Components & Custom Elements use the prefix uni.

Using Components

There are two strategies we recommend for using Uni Localization:

Script tag

  • Put a script tag <script type="module" src="https://cdn.jsdelivr.net/npm/@uiwebkit/loc@latest/dist/loc/loc.esm.js"></script> in the head of your index.html
  • Then you can use web components and custom elements anywhere in your Template, JSX, HTML, etc.;

Node Modules

  • Run npm i @uiwebkit/loc --save;
  • Paste import @uiwebkit/loc; into the main JS/TS file;
  • Then you can use web components and custom elements anywhere in your Template, JSX, HTML, etc.;

localize's People

Contributors

uiregex avatar uiwebkit avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.