Skip to content

Commit

Permalink
initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tdamsma committed Jun 4, 2024
1 parent 321fb85 commit 2d2345a
Show file tree
Hide file tree
Showing 16 changed files with 154 additions and 67 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ninja_i18n.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

name: Ninja i18n action

on: pull_request_target

# explicitly configure permissions, in case your GITHUB_TOKEN workflow permissions are set to read-only in repository settings
permissions:
pull-requests: write # Necessary to comment on PRs
issues: read # Necessary to read issue comments
contents: read # Necessary to access the repo content

jobs:
ninja-i18n:
name: Ninja i18n - GitHub Lint Action
runs-on: ubuntu-latest

steps:
- name: Run Ninja i18n
# @main ensures that the latest version of the action is used
uses: opral/ninja-i18n-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"inlang.vs-code-extension"
]
}
Binary file modified bun.lockb
Binary file not shown.
5 changes: 5 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://inlang.com/schema/inlang-message-format",
"hello_world": "Hello World!",
"greetings": "Greetings {name}."
}
5 changes: 5 additions & 0 deletions messages/nl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://inlang.com/schema/inlang-message-format",
"hello_world": "Hallo Wereld!",
"greetings": "Hoi {name}."
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
"svelte-preprocess": "^5.1.4",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3"
"vite": "^5.0.3",
"@inlang/paraglide-js": "1.9.1"
},
"type": "module",
"dependencies": {
"pug": "^3.0.3"
"pug": "^3.0.3",
"@inlang/paraglide-sveltekit": "0.9.2"
}
}
1 change: 1 addition & 0 deletions project.inlang/project_id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
736726dabacb48c231dc277f86538b70f3365d78cf23777d7511263f63d29010
19 changes: 19 additions & 0 deletions project.inlang/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://inlang.com/schema/project-settings",
"sourceLanguageTag": "nl",
"languageTags": [
"nl",
"en"
],
"modules": [
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-empty-pattern@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-missing-translation@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-without-source@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/message-lint-rule-valid-js-identifier@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@latest/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@latest/dist/index.js"
],
"plugin.inlang.messageFormat": {
"pathPattern": "./messages/{languageTag}.json"
}
}
6 changes: 5 additions & 1 deletion src/app.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import type { AvailableLanguageTag } from "../../lib/paraglide/runtime"
import type { ParaglideLocals } from "@inlang/paraglide-sveltekit"
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
interface Locals {
paraglide: ParaglideLocals<AvailableLanguageTag>,
}
// interface PageData {}
// interface PageState {}
// interface Platform {}
Expand Down
2 changes: 1 addition & 1 deletion src/app.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="%paraglide.lang%" dir="%paraglide.textDirection%">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
Expand Down
6 changes: 6 additions & 0 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// file initialized by the Paraglide-SvelteKit CLI - Feel free to edit it
import { sequence } from "@sveltejs/kit/hooks"
import { i18n } from "$lib/i18n"

// add your own hooks as part of the sequence here
export const handle = sequence(i18n.handle())
4 changes: 4 additions & 0 deletions src/hooks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// file initialized by the Paraglide-SvelteKit CLI - Feel free to edit it
import { i18n } from "$lib/i18n"

export const reroute = i18n.reroute()
5 changes: 5 additions & 0 deletions src/lib/i18n.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// file initialized by the Paraglide-SvelteKit CLI - Feel free to edit it
import { createI18n } from "@inlang/paraglide-sveltekit"
import * as runtime from "$lib/paraglide/runtime.js"

export const i18n = createI18n(runtime)
128 changes: 66 additions & 62 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<script>
import { ParaglideJS } from '@inlang/paraglide-sveltekit';
import { i18n } from '$lib/i18n';
import { onMount } from 'svelte';
import 'bootstrap/dist/css/bootstrap.min.css';
import '$lib/scss/custom.scss';
Expand All @@ -14,68 +17,69 @@
</script>

<template lang="pug">
div
nav.navbar.navbar-expand-lg.navbar-light.bg-light
.container.d-flex.justify-content-between
a.navbar-brand(href="/")
enhanced:img.ml-2(src="/static/images/Logo-Yep-300x122.png", alt="yeptrainingen")
button.navbar-toggler.mr-2(type="button", data-toggle="collapse", data-target="#nav-collapse", aria-controls="nav-collapse", aria-expanded="false", aria-label="Toggle navigation")
span.navbar-toggler-icon
#nav-collapse.collapse.navbar-collapse
ul.navbar-nav.ml-4
li.nav-item
a.nav-link(href="/") Yep
li.nav-item
a.nav-link(href="/team") Ons team
li.nav-item
a.nav-link(href="/trainingen") Trainingen
li.nav-item
a.nav-link(href="/coaching") Coaching
li.nav-item
a.nav-link(href="/onze-aanpak") Onze aanpak
li.nav-item
a.nav-link(href="/blog") Blog
slot
.jumbotron.jumbotron-fluid(style="background-color: #807d7d")
.container
.row
.col-md-4.text-light
h2 Site-map
.row
.col-sm-6
| &gt;&nbsp; #[a.link-geel(href="/") Yep] #[br]
| &gt;&nbsp; #[a.link-geel(href="/team") Ons team] #[br]
| &gt;&nbsp; #[a.link-geel(href="/trainingen") Trainingen] #[br]
| &gt;&nbsp; #[a.link-geel(href="/coaching") Coaching] #[br]
.col-sm-6
| &gt;&nbsp; #[a.link-geel(href="/blog") Blog] #[br]
| &gt;&nbsp; #[a.link-geel(href="/tarieven") Tarieven] #[br]
| &gt;&nbsp; #[a.link-geel(href="/klachten") Klachten] #[br]
| &gt;&nbsp; #[a.link-geel(href="/contact") Contact] #[br]
.col-md-1
.col-md-3.text-light
h2.mb-4 Gegevens
p
| Yep Trainingen #[br]
| Koningin Wilhelminalaan 84 #[br]
| 2274 AL Voorburg #[br] #[br]
| KvK: 58989463 #[br]
| BTW: NL001795751B66 #[br]
| IBAN: NL49TRIO0254729886 #[br]
.col-md-1
.col-md-3.text-light
enhanced:img(src="/static/images/Logo-Yep-300x122.png", alt="yeptrainingen")
p
a(href="mailto:info@yeptrainingen.nl", target="_blank")
enhanced:img(src="/static/images/email.png", alt="email")
a(href="https://www.facebook.com/Yeptrainingen", target="_blank")
enhanced:img(src="/static/images/facebook.png", alt="facebook")
a(href="https://twitter.com/yeptrainingen", target="_blank")
enhanced:img(src="/static/images/twitter.png", alt="twitter")
a(href="https://www.linkedin.com/company/marijn-blaisse-trainingen", target="_blank")
enhanced:img(src="/static/images/linkedin.png", alt="linkedin")
p
| Telefoon: 06-14477347
ParaglideJS( {i18n} )
div
nav.navbar.navbar-expand-lg.navbar-light.bg-light
.container.d-flex.justify-content-between
a.navbar-brand(href="/")
enhanced:img.ml-2(src="/static/images/Logo-Yep-300x122.png", alt="yeptrainingen")
button.navbar-toggler.mr-2(type="button", data-toggle="collapse", data-target="#nav-collapse", aria-controls="nav-collapse", aria-expanded="false", aria-label="Toggle navigation")
span.navbar-toggler-icon
#nav-collapse.collapse.navbar-collapse
ul.navbar-nav.ml-4
li.nav-item
a.nav-link(href="/") Yep
li.nav-item
a.nav-link(href="/team") Ons team
li.nav-item
a.nav-link(href="/trainingen") Trainingen
li.nav-item
a.nav-link(href="/coaching") Coaching
li.nav-item
a.nav-link(href="/onze-aanpak") Onze aanpak
li.nav-item
a.nav-link(href="/blog") Blog
slot
.jumbotron.jumbotron-fluid(style="background-color: #807d7d")
.container
.row
.col-md-4.text-light
h2 Site-map
.row
.col-sm-6
| &gt;&nbsp; #[a.link-geel(href="/") Yep] #[br]
| &gt;&nbsp; #[a.link-geel(href="/team") Ons team] #[br]
| &gt;&nbsp; #[a.link-geel(href="/trainingen") Trainingen] #[br]
| &gt;&nbsp; #[a.link-geel(href="/coaching") Coaching] #[br]
.col-sm-6
| &gt;&nbsp; #[a.link-geel(href="/blog") Blog] #[br]
| &gt;&nbsp; #[a.link-geel(href="/tarieven") Tarieven] #[br]
| &gt;&nbsp; #[a.link-geel(href="/klachten") Klachten] #[br]
| &gt;&nbsp; #[a.link-geel(href="/contact") Contact] #[br]
.col-md-1
.col-md-3.text-light
h2.mb-4 Gegevens
p
| Yep Trainingen #[br]
| Koningin Wilhelminalaan 84 #[br]
| 2274 AL Voorburg #[br] #[br]
| KvK: 58989463 #[br]
| BTW: NL001795751B66 #[br]
| IBAN: NL49TRIO0254729886 #[br]
.col-md-1
.col-md-3.text-light
enhanced:img(src="/static/images/Logo-Yep-300x122.png", alt="yeptrainingen")
p
a(href="mailto:info@yeptrainingen.nl", target="_blank")
enhanced:img(src="/static/images/email.png", alt="email")
a(href="https://www.facebook.com/Yeptrainingen", target="_blank")
enhanced:img(src="/static/images/facebook.png", alt="facebook")
a(href="https://twitter.com/yeptrainingen", target="_blank")
enhanced:img(src="/static/images/twitter.png", alt="twitter")
a(href="https://www.linkedin.com/company/marijn-blaisse-trainingen", target="_blank")
enhanced:img(src="/static/images/linkedin.png", alt="linkedin")
p
| Telefoon: 06-14477347
</template>

<style lang="scss">
Expand Down
3 changes: 3 additions & 0 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { BlogModule, ImageModule, Blog } from '$lib/types';
import Opdrachtgevers from '$lib/components/Opdrachtgevers.svelte';
import SpringestReviews from '$lib/components/SpringestReviews.svelte';
import * as m from '$lib/paraglide/messages.js';
const imageModules = import.meta.glob(
'$content/blog/*.{avif,gif,heif,jpeg,jpg,png,tiff,webp,svg}',
{
Expand Down Expand Up @@ -46,6 +47,8 @@
alt="Training Image"
)
.col-md-6.pt-4
p {m.greetings({ name: 'param' })}
p {m.hello_world()}
h2
| Inzicht, durf en vaardigheid
br
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { paraglide } from '@inlang/paraglide-sveltekit/vite'
import { sveltekit } from '@sveltejs/kit/vite';
import { enhancedImages } from '@sveltejs/enhanced-img';
import { defineConfig } from 'vite';

export default defineConfig({
plugins: [
plugins: [paraglide({ project: './project.inlang', outdir: './src/lib/paraglide' }),
enhancedImages(),
sveltekit()
],
Expand Down

0 comments on commit 2d2345a

Please sign in to comment.