Skip to content

Commit

Permalink
feat: add interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
ashour committed May 22, 2023
1 parent 4f0c760 commit bab8d57
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
9 changes: 9 additions & 0 deletions components/Notification.vue
@@ -0,0 +1,9 @@
<template>
<div
class="mb-4 rounded-md border border-amber-300 bg-amber-100 px-3 py-2 text-slate-950 shadow-sm shadow-slate-950"
>
<slot />
</div>
</template>

<script setup lang="ts"></script>
3 changes: 3 additions & 0 deletions lang/ar-EG.ts
Expand Up @@ -13,4 +13,7 @@ export default {
title: "نبذة عنا",
body: "أندورَبل هو موقع عن كل شيء متعلق بعروض بث حرب النجوم. بدأ الموقع كمشروع شغف ونما إلى ما هو عليه اليوم.",
},
notifications: {
new_episode: "أهلاً {username}، حلقة جديدة من {show} نزلت!",
},
}
3 changes: 3 additions & 0 deletions lang/en-CA.ts
Expand Up @@ -13,4 +13,7 @@ export default {
title: "About",
body: "Andorable is all about streaming Star Wars shows. The site started as a passion project and grew into what it is today.",
},
notifications: {
new_episode: "Hello, {username}. A new esposide of {show} just landed!",
},
}
15 changes: 9 additions & 6 deletions layouts/default.vue
Expand Up @@ -13,19 +13,19 @@
</Head>
<Body>
<header class="bg-slate-900 text-purple-100 shadow-sm shadow-slate-900">
<nav class="flex gap-8 items-baseline py-1 px-2 max-w-[1200px] mx-auto">
<LocLink to="/" class="shrink-0 flex items-baseline text-xl font-bold"
<nav class="mx-auto flex max-w-[1200px] items-baseline gap-8 px-2 py-1">
<LocLink to="/" class="flex shrink-0 items-baseline text-xl font-bold"
><span class="logo-container"
><img src="/img/brand-logo.svg" alt="Andorable logo"
/></span>
<span class="block relative -top-5">{{
<span class="relative -top-5 block">{{
$t("app_title")
}}</span></LocLink
>
<div
class="w-full flex relative -top-5 items-baseline justify-between"
class="relative -top-5 flex w-full items-baseline justify-between"
>
<ul class="flex grow-1 gap-6 text-lg">
<ul class="grow-1 flex gap-6 text-lg">
<li>
<LocLink to="/">{{ $t("nav.shows") }}</LocLink>
</li>
Expand All @@ -42,7 +42,10 @@
</nav>
</header>

<main class="px-4 py-6 max-w-[1200px] mx-auto">
<main class="mx-auto max-w-[1200px] px-4 py-6">
<Notification>{{
$t("notifications.new_episode", { username: "Mary", show: "Andor" })
}}</Notification>
<slot />
</main>
</Body>
Expand Down

0 comments on commit bab8d57

Please sign in to comment.