-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added links to the english version for easier navigation (#94)
* Added links to the english version - In the "the main version of the wiki is the english one" info message - In the "this wiki is not yet translated in your locale" info message * Update src/lib/translations/fr/wiki.json Co-authored-by: ix0rai <[email protected]> * Add missing period wiki.json --------- Co-authored-by: ix0rai <[email protected]>
- Loading branch information
Showing
10 changed files
with
58 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { locale, locales } from "./translations"; | ||
|
||
import { derived } from "svelte/store"; | ||
|
||
import { page } from "$app/stores"; | ||
|
||
// Removes the current locale from the current route | ||
// (only if the current route does contain the locale) | ||
export const current_route = derived([page, locale, locales], ([$page, $locale, $locales], set) => { | ||
const routeExtractor = new RegExp(`^(/${$locale})?(/.+)?$`); | ||
|
||
const routeMatch = $page.url.pathname.match(routeExtractor); | ||
// prettier-ignore | ||
if ( | ||
routeMatch && | ||
( | ||
// We match the locale | ||
routeMatch[1] || | ||
// We don't match the locale and a locale isn't in the route | ||
routeMatch[2] && !$locales.includes(routeMatch[2].replace(/^\/([^/]+)(\/.+)?$/, "$1")) | ||
) | ||
) { | ||
set(routeMatch[2] || ""); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script> | ||
export let href = ""; | ||
export let title = ""; | ||
export let text = ""; | ||
</script> | ||
|
||
<a {href} {title} data-sveltekit-preload-data="false"> | ||
{text} | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26f6b2d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See preview on Cloudflare Pages: https://0cd02a83.developer-wiki.pages.dev