File tree 5 files changed +37
-0
lines changed
5 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1
1
{
2
+ "version" : 0 ,
2
3
"root.description" : " Et alternativ til Nix økosystemet" ,
3
4
4
5
"header.community" : " Community" ,
Original file line number Diff line number Diff line change 1
1
{
2
+ "version" : 0 ,
3
+ "i18n-outdated.title" : " Outdated Translation" ,
4
+ "i18n-outdated.description" : " This translation has not been updated to the latest version yet." ,
5
+
2
6
"root.description" : " An alternative to the Nix ecosystem" ,
3
7
4
8
"header.community" : " Community" ,
Original file line number Diff line number Diff line change @@ -3,11 +3,21 @@ import Hero from "./Hero.astro";
3
3
import Values from " ./Values.astro" ;
4
4
import Goals from " ./Goals.astro" ;
5
5
import Roadmap from " ./Roadmap.astro" ;
6
+ import I18nOutdated from " ../i18n/Outdated.astro" ;
7
+
8
+ const { lang } = Astro .params as Params ;
9
+ import { isOutdated as i18nIsOutdated } from " ../../i18n/utils" ;
6
10
---
7
11
8
12
<main class =" grid place-items-center" >
9
13
<Hero />
10
14
15
+ { i18nIsOutdated (lang ) &&
16
+ <div class = " prose prose-invert py-16 px-4 max-w-4xl" >
17
+ <I18nOutdated />
18
+ </div >
19
+ }
20
+
11
21
<div class =" prose prose-invert py-16 px-4 max-w-4xl" >
12
22
<Values />
13
23
<Goals />
Original file line number Diff line number Diff line change
1
+ ---
2
+ import { useTranslations } from " ../../i18n/utils" ;
3
+ import type { Params } from " ../../i18n/utils" ;
4
+
5
+ const { lang } = Astro .params as Params ;
6
+ const translation = useTranslations (lang );
7
+ ---
8
+
9
+ <section id =" i18n-outdated" >
10
+ <h2 >{ translation (" i18n-outdated.title" )} </h2 >
11
+ <p class =" description" >
12
+ { translation (" i18n-outdated.description" )}
13
+ </p >
14
+ </section >
Original file line number Diff line number Diff line change @@ -11,6 +11,14 @@ export function useTranslations(lang: keyof typeof ui) {
11
11
} ;
12
12
}
13
13
14
+ export function isOutdated ( lang : keyof typeof ui ) {
15
+ if ( "version" in ui [ lang ] ) {
16
+ return ui [ lang ] [ "version" ] < ui [ defaultLang ] [ "version" ] ;
17
+ } else {
18
+ return true ;
19
+ }
20
+ }
21
+
14
22
export const getStaticPaths = ( async ( ) => {
15
23
return Object . keys ( languages ) . map ( ( name ) => ( {
16
24
params : { lang : name as keyof typeof languages } ,
You can’t perform that action at this time.
0 commit comments