diff options
author | 2021-08-01 23:38:50 -0700 | |
---|---|---|
committer | 2021-08-01 23:38:50 -0700 | |
commit | 94f89a3c88b0a3795896699fef08611c345cfe1d (patch) | |
tree | 16cc103bef87545239f7e1a4ad52c89ee7d89dda /docs/src/util.ts | |
parent | c6af27a1aad4df6dd3528cad56d4730a955af767 (diff) | |
download | astro-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.ts | 4 |
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 |