forked from DerivcoIpswich/dsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResourceFile.cs
More file actions
31 lines (26 loc) · 804 Bytes
/
Copy pathResourceFile.cs
File metadata and controls
31 lines (26 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// ResourceFile.cs
// Script#/Core
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//
using System;
using System.IO;
namespace DSharp
{
internal static class ResourceFile
{
public static string GetLocale(string fileName)
{
string extension = Path.GetExtension(fileName);
if (string.Compare(extension, ".resx", StringComparison.OrdinalIgnoreCase) == 0)
{
fileName = Path.GetFileNameWithoutExtension(fileName);
extension = Path.GetExtension(fileName);
if (string.IsNullOrEmpty(extension) == false)
{
return extension.Substring(1);
}
}
return string.Empty;
}
}
}