@turnipxenon/pineapple 4.5.0-alpha.5 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{paraglide/messages/example_message.d.ts → external/paraglide/messages/_index.d.ts} +3 -0
- package/dist/external/paraglide/messages/_index.js +53 -0
- package/dist/external/paraglide/messages/en.d.ts +4 -0
- package/dist/external/paraglide/messages/en.js +10 -0
- package/dist/external/paraglide/messages/fr.d.ts +4 -0
- package/dist/external/paraglide/messages/fr.js +10 -0
- package/dist/external/paraglide/messages/tl.d.ts +4 -0
- package/dist/external/paraglide/messages/tl.js +7 -0
- package/dist/{paraglide → external/paraglide}/runtime.d.ts +3 -1
- package/dist/{paraglide → external/paraglide}/runtime.js +22 -12
- package/dist/{paraglide → external/paraglide}/server.d.ts +3 -2
- package/dist/{paraglide → external/paraglide}/server.js +16 -3
- package/dist/ui/elements/pinya-combobox/PinyaCombobox.svelte +3 -4
- package/dist/ui/modules/NavigationMenu/NavigationMenu.svelte +1 -1
- package/dist/ui/modules/modals/general-settings/GeneralSettingsModal.svelte +2 -2
- package/dist/ui/modules/modals/general-settings/LanguagePicker.svelte +2 -2
- package/dist/ui/modules/projects/Soulwork.svelte +2 -2
- package/dist/ui/modules/projects/ThisWebpage.svelte +2 -2
- package/dist/ui/templates/PinyaBase.svelte +1 -1
- package/dist/ui/templates/PinyaPageLayout/PinyaPageLayout.svelte +3 -3
- package/package.json +20 -18
- package/dist/paraglide/messages/_index.d.ts +0 -2
- package/dist/paraglide/messages/_index.js +0 -3
- package/dist/paraglide/messages/example_message.js +0 -39
- package/dist/paraglide/messages/settings.d.ts +0 -3
- package/dist/paraglide/messages/settings.js +0 -38
- /package/dist/{paraglide → external/paraglide}/.prettierignore +0 -0
- /package/dist/{paraglide → external/paraglide}/messages.d.ts +0 -0
- /package/dist/{paraglide → external/paraglide}/messages.js +0 -0
- /package/dist/{paraglide → external/paraglide}/registry.d.ts +0 -0
- /package/dist/{paraglide → external/paraglide}/registry.js +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// eslint-disable
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from "../runtime.js"
|
|
3
|
+
import * as en from "./en.js"
|
|
4
|
+
import * as fr from "./fr.js"
|
|
5
|
+
import * as tl from "./tl.js"
|
|
6
|
+
/**
|
|
7
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
8
|
+
*
|
|
9
|
+
* - Changing this function will be over-written by the next build.
|
|
10
|
+
*
|
|
11
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
12
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
13
|
+
*
|
|
14
|
+
* @param {{ username: NonNullable<unknown> }} inputs
|
|
15
|
+
* @param {{ locale?: "en" | "fr" | "tl" }} options
|
|
16
|
+
* @returns {string}
|
|
17
|
+
*/
|
|
18
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
19
|
+
export const example_message = (inputs, options = {}) => {
|
|
20
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
21
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.example_message(inputs)
|
|
22
|
+
}
|
|
23
|
+
const locale = options.locale ?? getLocale()
|
|
24
|
+
trackMessageCall("example_message", locale)
|
|
25
|
+
if (locale === "en") return en.example_message(inputs)
|
|
26
|
+
if (locale === "fr") return fr.example_message(inputs)
|
|
27
|
+
if (locale === "tl") return tl.example_message(inputs)
|
|
28
|
+
return "example_message"
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
32
|
+
*
|
|
33
|
+
* - Changing this function will be over-written by the next build.
|
|
34
|
+
*
|
|
35
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
36
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
37
|
+
*
|
|
38
|
+
* @param {{}} inputs
|
|
39
|
+
* @param {{ locale?: "en" | "fr" | "tl" }} options
|
|
40
|
+
* @returns {string}
|
|
41
|
+
*/
|
|
42
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
43
|
+
export const settings = (inputs = {}, options = {}) => {
|
|
44
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
45
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.settings(inputs)
|
|
46
|
+
}
|
|
47
|
+
const locale = options.locale ?? getLocale()
|
|
48
|
+
trackMessageCall("settings", locale)
|
|
49
|
+
if (locale === "en") return en.settings(inputs)
|
|
50
|
+
if (locale === "fr") return fr.settings(inputs)
|
|
51
|
+
if (locale === "tl") return tl.settings(inputs)
|
|
52
|
+
return "settings"
|
|
53
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// eslint-disable
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const example_message = /** @type {(inputs: { username: NonNullable<unknown> }) => string} */ (i) => {
|
|
5
|
+
return `Hello world ${i.username}`
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const settings = /** @type {(inputs: {}) => string} */ () => {
|
|
9
|
+
return `Settings`
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// eslint-disable
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const example_message = /** @type {(inputs: { username: NonNullable<unknown> }) => string} */ (i) => {
|
|
5
|
+
return `Bonjour ${i.username}`
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const settings = /** @type {(inputs: {}) => string} */ () => {
|
|
9
|
+
return `Paramètres`
|
|
10
|
+
};
|
|
@@ -260,6 +260,8 @@ export const baseLocale: "en";
|
|
|
260
260
|
export const locales: readonly ["en", "fr", "tl"];
|
|
261
261
|
/** @type {string} */
|
|
262
262
|
export const cookieName: string;
|
|
263
|
+
/** @type {number} */
|
|
264
|
+
export const cookieMaxAge: number;
|
|
263
265
|
/** @type {string} */
|
|
264
266
|
export const localStorageKey: string;
|
|
265
267
|
/**
|
|
@@ -332,7 +334,7 @@ export const overwriteGetLocale: (fn: () => Locale) => void;
|
|
|
332
334
|
*
|
|
333
335
|
* Set locale reloads the site by default on the client. Reloading
|
|
334
336
|
* can be disabled by passing \`reload: false\` as an option. If
|
|
335
|
-
* reloading is
|
|
337
|
+
* reloading is disabled, you need to ensure that the UI is updated
|
|
336
338
|
* to reflect the new locale.
|
|
337
339
|
*
|
|
338
340
|
* @example
|
|
@@ -23,6 +23,8 @@ export const baseLocale = "en";
|
|
|
23
23
|
export const locales = /** @type {const} */ (["en", "fr", "tl"]);
|
|
24
24
|
/** @type {string} */
|
|
25
25
|
export const cookieName = "PARAGLIDE_LOCALE";
|
|
26
|
+
/** @type {number} */
|
|
27
|
+
export const cookieMaxAge = 34560000;
|
|
26
28
|
/** @type {string} */
|
|
27
29
|
export const localStorageKey = "PARAGLIDE_LOCALE";
|
|
28
30
|
/**
|
|
@@ -143,7 +145,10 @@ export let getLocale = () => {
|
|
|
143
145
|
else if (strat === "baseLocale") {
|
|
144
146
|
locale = baseLocale;
|
|
145
147
|
}
|
|
146
|
-
else if (TREE_SHAKE_URL_STRATEGY_USED &&
|
|
148
|
+
else if (TREE_SHAKE_URL_STRATEGY_USED &&
|
|
149
|
+
strat === "url" &&
|
|
150
|
+
!isServer &&
|
|
151
|
+
typeof window !== "undefined") {
|
|
147
152
|
locale = extractLocaleFromUrl(window.location.href);
|
|
148
153
|
}
|
|
149
154
|
else if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED &&
|
|
@@ -215,14 +220,14 @@ function negotiatePreferredLanguageFromNavigator() {
|
|
|
215
220
|
*/
|
|
216
221
|
export const overwriteGetLocale = (fn) => {
|
|
217
222
|
getLocale = fn;
|
|
218
|
-
};
|
|
223
|
+
};
|
|
219
224
|
|
|
220
225
|
/**
|
|
221
226
|
* Set the locale.
|
|
222
227
|
*
|
|
223
228
|
* Set locale reloads the site by default on the client. Reloading
|
|
224
229
|
* can be disabled by passing \`reload: false\` as an option. If
|
|
225
|
-
* reloading is
|
|
230
|
+
* reloading is disabled, you need to ensure that the UI is updated
|
|
226
231
|
* to reflect the new locale.
|
|
227
232
|
*
|
|
228
233
|
* @example
|
|
@@ -257,11 +262,11 @@ export let setLocale = (newLocale, options) => {
|
|
|
257
262
|
_locale = newLocale;
|
|
258
263
|
}
|
|
259
264
|
else if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === "cookie") {
|
|
260
|
-
if (isServer) {
|
|
265
|
+
if (isServer || typeof document === "undefined") {
|
|
261
266
|
continue;
|
|
262
267
|
}
|
|
263
268
|
// set the cookie
|
|
264
|
-
document.cookie = `${cookieName}=${newLocale}; path
|
|
269
|
+
document.cookie = `${cookieName}=${newLocale}; path=/; max-age=${cookieMaxAge}`;
|
|
265
270
|
}
|
|
266
271
|
else if (strat === "baseLocale") {
|
|
267
272
|
// nothing to be set here. baseLocale is only a fallback
|
|
@@ -409,11 +414,7 @@ export const extractLocaleFromRequest = (request) => {
|
|
|
409
414
|
.find((c) => c.startsWith(cookieName + "="))
|
|
410
415
|
?.split("=")[1];
|
|
411
416
|
}
|
|
412
|
-
else if (TREE_SHAKE_URL_STRATEGY_USED &&
|
|
413
|
-
strat === "url" &&
|
|
414
|
-
// only process url strategy if request is a document
|
|
415
|
-
// else it's api requests, etc.
|
|
416
|
-
request.headers.get("Sec-Fetch-Dest") === "document") {
|
|
417
|
+
else if (TREE_SHAKE_URL_STRATEGY_USED && strat === "url") {
|
|
417
418
|
locale = extractLocaleFromUrl(request.url);
|
|
418
419
|
}
|
|
419
420
|
else if (TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED &&
|
|
@@ -783,8 +784,15 @@ function fillMissingUrlParts(url, match) {
|
|
|
783
784
|
* @returns {URL} - The constructed URL with named groups filled.
|
|
784
785
|
*/
|
|
785
786
|
function fillPattern(pattern, values, origin) {
|
|
787
|
+
// Pre-process the pattern to handle explicit port numbers
|
|
788
|
+
// This detects patterns like "http://localhost:5173" and protects the port number
|
|
789
|
+
// from being interpreted as a parameter
|
|
790
|
+
let processedPattern = pattern.replace(/(https?:\/\/[^:/]+):(\d+)(\/|$)/g, (_, protocol, port, slash) => {
|
|
791
|
+
// Replace ":5173" with "#PORT-5173#" to protect it from parameter replacement
|
|
792
|
+
return `${protocol}#PORT-${port}#${slash}`;
|
|
793
|
+
});
|
|
786
794
|
// First, handle group delimiters with curly braces
|
|
787
|
-
let processedGroupDelimiters =
|
|
795
|
+
let processedGroupDelimiters = processedPattern.replace(/\{([^{}]*)\}([?+*]?)/g, (_, content, modifier) => {
|
|
788
796
|
// For optional group delimiters
|
|
789
797
|
if (modifier === "?") {
|
|
790
798
|
// For optional groups, we'll include the content
|
|
@@ -794,7 +802,7 @@ function fillPattern(pattern, values, origin) {
|
|
|
794
802
|
return content;
|
|
795
803
|
});
|
|
796
804
|
// Then handle named groups
|
|
797
|
-
|
|
805
|
+
let filled = processedGroupDelimiters.replace(/(\/?):([a-zA-Z0-9_]+)(\([^)]*\))?([?+*]?)/g, (_, slash, name, __, modifier) => {
|
|
798
806
|
const value = values[name];
|
|
799
807
|
if (value === null) {
|
|
800
808
|
// If value is null, remove the entire segment including the preceding slash
|
|
@@ -817,6 +825,8 @@ function fillPattern(pattern, values, origin) {
|
|
|
817
825
|
}
|
|
818
826
|
return `${slash}${value}`;
|
|
819
827
|
});
|
|
828
|
+
// Restore port numbers
|
|
829
|
+
filled = filled.replace(/#PORT-(\d+)#/g, ":$1");
|
|
820
830
|
return new URL(filled, origin);
|
|
821
831
|
}
|
|
822
832
|
/**
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* This middleware performs several key functions:
|
|
5
5
|
*
|
|
6
6
|
* 1. Determines the locale for the incoming request using configured strategies
|
|
7
|
-
* 2. Handles URL localization and redirects
|
|
7
|
+
* 2. Handles URL localization and redirects (only for document requests)
|
|
8
8
|
* 3. Maintains locale state using AsyncLocalStorage to prevent request interference
|
|
9
9
|
*
|
|
10
10
|
* When URL strategy is used:
|
|
11
11
|
*
|
|
12
|
-
* -
|
|
12
|
+
* - The locale is extracted from the URL for all request types
|
|
13
|
+
* - If URL doesn't match the determined locale, redirects to localized URL (only for document requests)
|
|
13
14
|
* - De-localizes URLs before passing to server (e.g., `/fr/about` → `/about`)
|
|
14
15
|
*
|
|
15
16
|
* @template T - The return type of the resolve function
|
|
@@ -8,12 +8,13 @@ import * as runtime from "./runtime.js";
|
|
|
8
8
|
* This middleware performs several key functions:
|
|
9
9
|
*
|
|
10
10
|
* 1. Determines the locale for the incoming request using configured strategies
|
|
11
|
-
* 2. Handles URL localization and redirects
|
|
11
|
+
* 2. Handles URL localization and redirects (only for document requests)
|
|
12
12
|
* 3. Maintains locale state using AsyncLocalStorage to prevent request interference
|
|
13
13
|
*
|
|
14
14
|
* When URL strategy is used:
|
|
15
15
|
*
|
|
16
|
-
* -
|
|
16
|
+
* - The locale is extracted from the URL for all request types
|
|
17
|
+
* - If URL doesn't match the determined locale, redirects to localized URL (only for document requests)
|
|
17
18
|
* - De-localizes URLs before passing to server (e.g., `/fr/about` → `/about`)
|
|
18
19
|
*
|
|
19
20
|
* @template T - The return type of the resolve function
|
|
@@ -77,7 +78,7 @@ export async function paraglideMiddleware(request, resolve) {
|
|
|
77
78
|
if (request.headers.get("Sec-Fetch-Dest") === "document" &&
|
|
78
79
|
runtime.strategy.includes("url")) {
|
|
79
80
|
const localizedUrl = runtime.localizeUrl(request.url, { locale });
|
|
80
|
-
if (localizedUrl.href !== request.url) {
|
|
81
|
+
if (normalizeURL(localizedUrl.href) !== normalizeURL(request.url)) {
|
|
81
82
|
return Response.redirect(localizedUrl, 307);
|
|
82
83
|
}
|
|
83
84
|
}
|
|
@@ -123,6 +124,18 @@ export async function paraglideMiddleware(request, resolve) {
|
|
|
123
124
|
}
|
|
124
125
|
return response;
|
|
125
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Normalize url for comparison.
|
|
129
|
+
* Strips trailing slash
|
|
130
|
+
* @param {string} url
|
|
131
|
+
* @returns {string} normalized url string
|
|
132
|
+
*/
|
|
133
|
+
function normalizeURL(url) {
|
|
134
|
+
const urlObj = new URL(url);
|
|
135
|
+
// // strip trailing slash from pathname
|
|
136
|
+
urlObj.pathname = urlObj.pathname.replace(/\/$/, "");
|
|
137
|
+
return urlObj.href;
|
|
138
|
+
}
|
|
126
139
|
/**
|
|
127
140
|
* Creates a mock AsyncLocalStorage implementation for environments where
|
|
128
141
|
* native AsyncLocalStorage is not available or disabled.
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<script lang="ts" generics="T extends string">
|
|
2
|
-
import { Combobox } from '@skeletonlabs/skeleton-svelte';
|
|
3
|
-
import { getLocale, localizeHref } from '../../../paraglide/runtime';
|
|
4
2
|
import type { PinyaComboboxProps, ValueChangeDetails } from "./PinyaComboboxProps";
|
|
3
|
+
import { Combobox } from "@skeletonlabs/skeleton-svelte";
|
|
5
4
|
|
|
6
5
|
let {
|
|
7
|
-
contentZIndex =
|
|
6
|
+
contentZIndex = "auto",
|
|
8
7
|
value = $bindable(),
|
|
9
8
|
onValueChange = () => {},
|
|
10
9
|
onValueChangeBase = undefined,
|
|
@@ -32,4 +31,4 @@
|
|
|
32
31
|
onValueChange={onValueChangeBase ?? onValueChangeBaseImpl}
|
|
33
32
|
{value}
|
|
34
33
|
{...props}
|
|
35
|
-
/>
|
|
34
|
+
/>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
type ParsePageMetaCompareFn
|
|
9
9
|
} from "./PageMeta";
|
|
10
10
|
import { PinyaCard } from "../../elements/index";
|
|
11
|
-
import { localizeHref } from "../../../paraglide/runtime.js";
|
|
11
|
+
import { localizeHref } from "../../../external/paraglide/runtime.js";
|
|
12
12
|
|
|
13
13
|
interface Props {
|
|
14
14
|
fileList: Record<string, unknown>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { ModalProps } from 'svelte-modals';
|
|
3
3
|
import { setMode, userPrefersMode } from 'mode-watcher';
|
|
4
4
|
|
|
5
|
-
import { m } from '../../../../paraglide/messages';
|
|
5
|
+
import { m } from '../../../../external/paraglide/messages';
|
|
6
6
|
import ModalBase from '../../../components/ModalBase.svelte';
|
|
7
7
|
import DarkIcon from '../../../../assets/icons/icon-dark-mode.svg';
|
|
8
8
|
import LightIcon from '../../../../assets/icons/icon-light-mode.svg';
|
|
@@ -107,4 +107,4 @@
|
|
|
107
107
|
text-align: start;
|
|
108
108
|
gap: 1lh;
|
|
109
109
|
}
|
|
110
|
-
</style>
|
|
110
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { deLocalizeHref, getLocale, localizeHref } from "../../../../paraglide/runtime";
|
|
2
|
+
import { deLocalizeHref, getLocale, localizeHref } from "../../../../external/paraglide/runtime";
|
|
3
3
|
import PinyaCombobox from "../../../elements/pinya-combobox/PinyaCombobox.svelte";
|
|
4
4
|
import { appState } from "../../../templates/PinyaPageLayout/runes.svelte";
|
|
5
5
|
|
|
@@ -40,4 +40,4 @@
|
|
|
40
40
|
placeholder="Select Language"
|
|
41
41
|
{onValueChange}
|
|
42
42
|
{disabled}
|
|
43
|
-
/>
|
|
43
|
+
/>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { page } from "$app/state";
|
|
3
|
-
import { locales, localizeHref } from "../../paraglide/runtime";
|
|
3
|
+
import { locales, localizeHref } from "../../external/paraglide/runtime";
|
|
4
4
|
import "../../styles/global.css";
|
|
5
5
|
import WebThumbnailImage from "../../assets/placeholder/placeholder_circle.png";
|
|
6
6
|
import type { PinyaHead } from "./runes.svelte";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from "svelte";
|
|
3
3
|
import { modals } from "svelte-modals";
|
|
4
|
-
import { m } from "../../../paraglide/messages";
|
|
5
|
-
import { localizeHref } from "../../../paraglide/runtime";
|
|
4
|
+
import { m } from "../../../external/paraglide/messages";
|
|
5
|
+
import { localizeHref } from "../../../external/paraglide/runtime";
|
|
6
6
|
|
|
7
7
|
import AresLogo from "../../../assets/characters/ares/ares_logo.webp";
|
|
8
8
|
import SettingsLogo from "../../../assets/icons/icon-settings.svg";
|
|
@@ -121,4 +121,4 @@
|
|
|
121
121
|
width: 100%;
|
|
122
122
|
height: calc(var(--dialog-box-height) + 3.5lh);
|
|
123
123
|
}
|
|
124
|
-
</style>
|
|
124
|
+
</style>
|
package/package.json
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turnipxenon/pineapple",
|
|
3
3
|
"description": "personal package for base styling for other personal projects",
|
|
4
|
-
"version": "4.5.
|
|
4
|
+
"version": "4.5.1",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "vite dev",
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"package": "svelte-kit sync && svelte-package && publint",
|
|
9
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
10
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
11
|
+
"lint": "eslint .",
|
|
12
|
+
"format": "prettier --plugin-search-dir . --write .",
|
|
13
|
+
"generate": "npx vite-node src/routes/blogs/blog_list_data_generator.ts && npx vite-node src/routes/toyay/toya_files_generator.ts && npm run generate-yarn",
|
|
14
|
+
"generate-yarn": "npx vite-node src/lib/scripts/pineapple_fiber/PineappleWeaver.ts",
|
|
15
|
+
"custom-check": "npx vite-node src/lib/scripts/util/ManualCheckRun.ts",
|
|
16
|
+
"preview": "pnpm run build && wrangler dev",
|
|
17
|
+
"prepublishOnly": "pnpm package",
|
|
18
|
+
"prepare": "husky",
|
|
19
|
+
"deploy": "pnpm run build && wrangler deploy",
|
|
20
|
+
"cf-typegen": "wrangler types ./src/worker-configuration.d.ts"
|
|
21
|
+
},
|
|
5
22
|
"devDependencies": {
|
|
6
23
|
"@commitlint/cli": "^19.8.0",
|
|
7
24
|
"@commitlint/config-conventional": "^19.8.0",
|
|
@@ -88,20 +105,5 @@
|
|
|
88
105
|
"license": "MIT",
|
|
89
106
|
"svelte": "./dist/index.js",
|
|
90
107
|
"types": "./dist/index.d.ts",
|
|
91
|
-
"type": "module"
|
|
92
|
-
|
|
93
|
-
"dev": "vite dev",
|
|
94
|
-
"build": "vite build",
|
|
95
|
-
"package": "svelte-kit sync && svelte-package && publint",
|
|
96
|
-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
97
|
-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
98
|
-
"lint": "eslint .",
|
|
99
|
-
"format": "prettier --plugin-search-dir . --write .",
|
|
100
|
-
"generate": "npx vite-node src/routes/blogs/blog_list_data_generator.ts && npx vite-node src/routes/toyay/toya_files_generator.ts && npm run generate-yarn",
|
|
101
|
-
"generate-yarn": "npx vite-node src/lib/scripts/pineapple_fiber/PineappleWeaver.ts",
|
|
102
|
-
"custom-check": "npx vite-node src/lib/scripts/util/ManualCheckRun.ts",
|
|
103
|
-
"preview": "pnpm run build && wrangler dev",
|
|
104
|
-
"deploy": "pnpm run build && wrangler deploy",
|
|
105
|
-
"cf-typegen": "wrangler types ./src/worker-configuration.d.ts"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
+
"type": "module"
|
|
109
|
+
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// eslint-disable
|
|
2
|
-
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
-
|
|
4
|
-
const en_example_message = /** @type {(inputs: { username: NonNullable<unknown> }) => string} */ (i) => {
|
|
5
|
-
return `Hello world ${i.username}`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const fr_example_message = /** @type {(inputs: { username: NonNullable<unknown> }) => string} */ (i) => {
|
|
9
|
-
return `Bonjour ${i.username}`
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const tl_example_message = /** @type {(inputs: { username: NonNullable<unknown> }) => string} */ (i) => {
|
|
13
|
-
return `Kamusta ${i.username}`
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
18
|
-
*
|
|
19
|
-
* - Changing this function will be over-written by the next build.
|
|
20
|
-
*
|
|
21
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
22
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
23
|
-
*
|
|
24
|
-
* @param {{ username: NonNullable<unknown> }} inputs
|
|
25
|
-
* @param {{ locale?: "en" | "fr" | "tl" }} options
|
|
26
|
-
* @returns {string}
|
|
27
|
-
*/
|
|
28
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
29
|
-
export const example_message = (inputs, options = {}) => {
|
|
30
|
-
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
31
|
-
return /** @type {any} */ (globalThis).__paraglide_ssr.example_message(inputs)
|
|
32
|
-
}
|
|
33
|
-
const locale = options.locale ?? getLocale()
|
|
34
|
-
trackMessageCall("example_message", locale)
|
|
35
|
-
if (locale === "en") return en_example_message(inputs)
|
|
36
|
-
if (locale === "fr") return fr_example_message(inputs)
|
|
37
|
-
if (locale === "tl") return tl_example_message(inputs)
|
|
38
|
-
return "example_message"
|
|
39
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// eslint-disable
|
|
2
|
-
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
-
|
|
4
|
-
const en_settings = /** @type {(inputs: {}) => string} */ () => {
|
|
5
|
-
return `Settings`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const fr_settings = /** @type {(inputs: {}) => string} */ () => {
|
|
9
|
-
return `Paramètres`
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/** @type {(inputs: {}) => string} */
|
|
13
|
-
const tl_settings = en_settings;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
17
|
-
*
|
|
18
|
-
* - Changing this function will be over-written by the next build.
|
|
19
|
-
*
|
|
20
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
21
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
22
|
-
*
|
|
23
|
-
* @param {{}} inputs
|
|
24
|
-
* @param {{ locale?: "en" | "fr" | "tl" }} options
|
|
25
|
-
* @returns {string}
|
|
26
|
-
*/
|
|
27
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
28
|
-
export const settings = (inputs = {}, options = {}) => {
|
|
29
|
-
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
30
|
-
return /** @type {any} */ (globalThis).__paraglide_ssr.settings(inputs)
|
|
31
|
-
}
|
|
32
|
-
const locale = options.locale ?? getLocale()
|
|
33
|
-
trackMessageCall("settings", locale)
|
|
34
|
-
if (locale === "en") return en_settings(inputs)
|
|
35
|
-
if (locale === "fr") return fr_settings(inputs)
|
|
36
|
-
if (locale === "tl") return tl_settings(inputs)
|
|
37
|
-
return "settings"
|
|
38
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|