fix tld detecting method for localization
Seto Elkahfi committed
Jan 10, 2020 at 11:14 UTC
11ec43a4677c631143d0476336a008112034ea90
1 file changed
+3
-2
src/index.tsx
+3
-2
@@ -25,10 +25,11 @@ const messages: {
25
26
27
var language = "en";
28
+const tld = window.location.hostname.split('.').pop();
29
29
-if (window.location.hostname === "id.setoelkahfi" || window.location.hostname === "setoelkahfi.web.id") {
30
+if (tld === "id") {
31
language = "id";
31
-} else if (window.location.hostname === "se.setoelkahfi" || window.location.hostname === "seto.elkahfi.se") {
32
+} else if (tld === "se") {
33
language = "se";
34
}
35