summaryrefslogtreecommitdiff
path: root/docs/src/util.ts
diff options
context:
space:
mode:
authorGravatar Fred K. Schott <fkschott@gmail.com> 2021-08-01 23:38:50 -0700
committerGravatar GitHub <noreply@github.com> 2021-08-01 23:38:50 -0700
commit94f89a3c88b0a3795896699fef08611c345cfe1d (patch)
tree16cc103bef87545239f7e1a4ad52c89ee7d89dda /docs/src/util.ts
parentc6af27a1aad4df6dd3528cad56d4730a955af767 (diff)
downloadastro-94f89a3c88b0a3795896699fef08611c345cfe1d.tar.gz
astro-94f89a3c88b0a3795896699fef08611c345cfe1d.tar.zst
astro-94f89a3c88b0a3795896699fef08611c345cfe1d.zip
full translation (#967)
Diffstat (limited to 'docs/src/util.ts')
-rw-r--r--docs/src/util.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/src/util.ts b/docs/src/util.ts
new file mode 100644
index 000000000..ba4f4fb3d
--- /dev/null
+++ b/docs/src/util.ts
@@ -0,0 +1,4 @@
+export function getLanguageFromURL(pathname:string) {
+ const langCodeMatch = pathname.match(/\/([a-z]{2})\//);
+ return langCodeMatch ? langCodeMatch[1] : 'en';
+} \ No newline at end of file