From ae6cae50d8a41c958437213fcb04c1bb3a7c84cb Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 31 Mar 2015 03:58:33 +0000 Subject: [PATCH] * add String-2-Locale helper function --- source/net/filebot/format/ExpressionFormatMethods.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/net/filebot/format/ExpressionFormatMethods.java b/source/net/filebot/format/ExpressionFormatMethods.java index 8f5d3dd4..5062e2a6 100644 --- a/source/net/filebot/format/ExpressionFormatMethods.java +++ b/source/net/filebot/format/ExpressionFormatMethods.java @@ -9,6 +9,7 @@ import java.nio.file.attribute.BasicFileAttributeView; import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.regex.Matcher; import net.filebot.util.FileUtilities; @@ -330,4 +331,8 @@ public class ExpressionFormatMethods { return new File(parent, self); } + public static Locale toLocale(String self) { + return Locale.forLanguageTag(self); + } + }