From d3a5b89bb0267b3bc3f1b788f63b7a3001d9886b Mon Sep 17 00:00:00 2001 From: Siphalor Date: Fri, 24 Jul 2020 22:28:19 +0200 Subject: [PATCH] Improve languages detection --- src/main/java/de/siphalor/was/WhatAStorage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/siphalor/was/WhatAStorage.java b/src/main/java/de/siphalor/was/WhatAStorage.java index 3cb2563..6eb7b37 100644 --- a/src/main/java/de/siphalor/was/WhatAStorage.java +++ b/src/main/java/de/siphalor/was/WhatAStorage.java @@ -243,8 +243,8 @@ public class WhatAStorage { public String[] getLangs() { return contentManager.getResources("lang", "properties").map(resource -> { int index = resource.getId().lastIndexOf('.'); - return resource.getId().substring(Math.max(index, 0)); - }).toArray(String[]::new); + return resource.getId().substring(Math.max(index + 1, 0)); + }).distinct().toArray(String[]::new); } /**