Change translate function
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s
This commit is contained in:
16
dist/sigpro-ui.esm.js
vendored
16
dist/sigpro-ui.esm.js
vendored
@@ -506,20 +506,10 @@ var rand = (r) => `${r}-${Math.random().toString(36).slice(2, 9)}`;
|
||||
var hide = () => document.activeElement?.blur();
|
||||
var i18n = {
|
||||
es: {
|
||||
close: "Cerrar",
|
||||
confirm: "Confirmar",
|
||||
cancel: "Cancelar",
|
||||
search: "Buscar...",
|
||||
loading: "Cargando...",
|
||||
nodata: "Sin datos"
|
||||
uploadFiles: "Arrastrar y soltar o click para seleccionar..."
|
||||
},
|
||||
en: {
|
||||
close: "Close",
|
||||
confirm: "Confirm",
|
||||
cancel: "Cancel",
|
||||
search: "Search...",
|
||||
loading: "Loading...",
|
||||
nodata: "No data"
|
||||
uploadFiles: "DRag and drop or click to select"
|
||||
}
|
||||
};
|
||||
var currentLocale = P("en");
|
||||
@@ -901,7 +891,7 @@ var Fileinput = (p) => {
|
||||
}, [
|
||||
A("div", { class: "flex items-center gap-3 w-full" }, [
|
||||
A("span", { class: "icon-[lucide--upload]" }),
|
||||
A("span", { class: "text-sm opacity-70 truncate grow text-left" }, "Drag and drop..."),
|
||||
A("span", { class: "text-sm opacity-70 truncate grow text-left" }, tt("uploadFiles")),
|
||||
A("span", { class: "text-[10px] opacity-40 shrink-0" }, `Máx ${p.max || 2}MB`)
|
||||
]),
|
||||
A("input", {
|
||||
|
||||
2
dist/sigpro-ui.esm.min.js
vendored
2
dist/sigpro-ui.esm.min.js
vendored
File diff suppressed because one or more lines are too long
16
dist/sigpro-ui.js
vendored
16
dist/sigpro-ui.js
vendored
@@ -536,20 +536,10 @@
|
||||
var hide = () => document.activeElement?.blur();
|
||||
var i18n = {
|
||||
es: {
|
||||
close: "Cerrar",
|
||||
confirm: "Confirmar",
|
||||
cancel: "Cancelar",
|
||||
search: "Buscar...",
|
||||
loading: "Cargando...",
|
||||
nodata: "Sin datos"
|
||||
uploadFiles: "Arrastrar y soltar o click para seleccionar..."
|
||||
},
|
||||
en: {
|
||||
close: "Close",
|
||||
confirm: "Confirm",
|
||||
cancel: "Cancel",
|
||||
search: "Search...",
|
||||
loading: "Loading...",
|
||||
nodata: "No data"
|
||||
uploadFiles: "DRag and drop or click to select"
|
||||
}
|
||||
};
|
||||
var currentLocale = P("en");
|
||||
@@ -931,7 +921,7 @@
|
||||
}, [
|
||||
A("div", { class: "flex items-center gap-3 w-full" }, [
|
||||
A("span", { class: "icon-[lucide--upload]" }),
|
||||
A("span", { class: "text-sm opacity-70 truncate grow text-left" }, "Drag and drop..."),
|
||||
A("span", { class: "text-sm opacity-70 truncate grow text-left" }, tt("uploadFiles")),
|
||||
A("span", { class: "text-[10px] opacity-40 shrink-0" }, `Máx ${p.max || 2}MB`)
|
||||
]),
|
||||
A("input", {
|
||||
|
||||
4
dist/sigpro-ui.min.js
vendored
4
dist/sigpro-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -789,6 +789,6 @@ Displays an 8×8 grid of preset colours.
|
||||
|
||||
## Utility Functions
|
||||
|
||||
- **`Locale(lang)`** – Signal to read/set the current language (`"es"` or `"en"`).
|
||||
- **`tt(key)`** – Returns a reactive translation string from the built‑in dictionary based on current locale.
|
||||
- **`Locale(lang)`** – Signal to read/set the current language (`"en"` or `"es"`).
|
||||
- **`t(key)`** – Returns a reactive translation string from the built‑in dictionary based on current locale.
|
||||
```
|
||||
4
docs/sigpro-ui.min.js
vendored
4
docs/sigpro-ui.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sigpro-ui",
|
||||
"version": "1.2.6",
|
||||
"version": "1.2.8",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
|
||||
48
sigpro-ui.js
48
sigpro-ui.js
@@ -10,28 +10,18 @@ const rand = (r) => `${r}-${Math.random().toString(36).slice(2, 9)}`
|
||||
export const hide = () => document.activeElement?.blur()
|
||||
|
||||
// Locales
|
||||
export const i18n = {
|
||||
export const lang = {
|
||||
es: {
|
||||
close: "Cerrar",
|
||||
confirm: "Confirmar",
|
||||
cancel: "Cancelar",
|
||||
search: "Buscar...",
|
||||
loading: "Cargando...",
|
||||
nodata: "Sin datos"
|
||||
uploadFiles: "Arrastrar y soltar o click para seleccionar...",
|
||||
},
|
||||
en: {
|
||||
close: "Close",
|
||||
confirm: "Confirm",
|
||||
cancel: "Cancel",
|
||||
search: "Search...",
|
||||
loading: "Loading...",
|
||||
nodata: "No data"
|
||||
uploadFiles: "Drag and drop or click to select",
|
||||
}
|
||||
};
|
||||
|
||||
export const currentLocale = $("en");
|
||||
export const Locale = t => currentLocale(t);
|
||||
export const tt = t => () => i18n[currentLocale()][t] || t;
|
||||
export const t = t => () => lang[currentLocale()][t] || t;
|
||||
|
||||
// Components
|
||||
export const Accordion = (p) => {
|
||||
@@ -344,7 +334,7 @@ export const Fileinput = (p) => {
|
||||
}, [
|
||||
h('div', { class: 'flex items-center gap-3 w-full' }, [
|
||||
h('span', { class: 'icon-[lucide--upload]' }),
|
||||
h('span', { class: 'text-sm opacity-70 truncate grow text-left' }, 'Drag and drop...'),
|
||||
h('span', { class: 'text-sm opacity-70 truncate grow text-left' }, t("uploadFiles")),
|
||||
h('span', { class: 'text-[10px] opacity-40 shrink-0' }, `Máx ${p.max || 2}MB`)
|
||||
]),
|
||||
h('input', {
|
||||
@@ -608,34 +598,6 @@ export const Toast = (message, type = "alert-success", duration = 3500) => {
|
||||
export const Toggle = (p) => h("input", { ...p, type: "checkbox", class: cls("toggle", p.class) });
|
||||
export const Tooltip = (p, c) => h("div", { ...p, class: cls("tooltip", p.class), "data-tip": p.tip }, c);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Editor
|
||||
export const Editor = (p) => {
|
||||
const { value, class: extraClass } = p
|
||||
|
||||
Reference in New Issue
Block a user