0.0.12 • Published 4 years ago
gnextia-util v0.0.12
gnextia-util
To start
npm run make
npm test
Image version
import { Img, img } from "gnextia"
<Img src="/img/logo.svg" />
// to html
<img src="/img/logo.svg?<VERSION>" />
const myImg = img("/img/logo.svg")
// to
const myImg = "/img/logo.svg?<VERSION>"
background: img('/img/logo.svg') no-repeat fixed center;
/* to css */
background: url('/img/logo.svg?<VERSION>') no-repeat fixed center;
i18n (Internationalization and localization)
# env.yml
i18n:
default: en
locales:
- en
- es
# i18n.yml
user:
name:
- My name is {0} {1} {2}
- Mi nombre es {0} {1} {2}
import { I18n, i18n } from 'gnextia'
// jsx
<I18n name="user.name" args={['Sinuhe', 'Maceda', 'Bouchan']} />
// js
i18n('user.name', ['Sinuhe', 'Maceda', 'Bouchan'])