Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC30-AutoInOutStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3cff491d
由
LN
编写于
2020-03-23 18:30:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
ef8df7fc
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
51 行增加
和
2 行删除
source/ACSingleStore/FrmStoreBox.cs
source/ACSingleStore/ResourceCulture.cs
source/ACSingleStore/FrmStoreBox.cs
查看文件 @
3cff491
...
@@ -223,6 +223,7 @@ namespace OnlineStore.AutoInOutStore
...
@@ -223,6 +223,7 @@ namespace OnlineStore.AutoInOutStore
ResourceCulture
.
SetCurrentCulture
(
ResourceCulture
.
China
);
ResourceCulture
.
SetCurrentCulture
(
ResourceCulture
.
China
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Default_Language
,
ResourceCulture
.
China
);
ConfigAppSettings
.
SaveValue
(
Setting_Init
.
Default_Language
,
ResourceCulture
.
China
);
}
}
// ResourceCulture.LoaAllRes();
GetVersion
();
GetVersion
();
LogUtil
.
logBox
=
this
.
richTextBox1
;
LogUtil
.
logBox
=
this
.
richTextBox1
;
this
.
ShowInTaskbar
=
true
;
this
.
ShowInTaskbar
=
true
;
...
...
source/ACSingleStore/ResourceCulture.cs
查看文件 @
3cff491
...
@@ -2,8 +2,10 @@
...
@@ -2,8 +2,10 @@
using
OnlineStore.DeviceLibrary
;
using
OnlineStore.DeviceLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Globalization
;
using
System.Globalization
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
using
System.Reflection
;
using
System.Reflection
;
using
System.Resources
;
using
System.Resources
;
...
@@ -44,7 +46,53 @@ namespace OnlineStore.AutoInOutStore
...
@@ -44,7 +46,53 @@ namespace OnlineStore.AutoInOutStore
CurrLanguage
=
name
;
CurrLanguage
=
name
;
Thread
.
CurrentThread
.
CurrentCulture
=
new
CultureInfo
(
name
);
Thread
.
CurrentThread
.
CurrentCulture
=
new
CultureInfo
(
name
);
}
}
public
static
void
LoaAllRes
()
{
if
(
rm
==
null
)
{
rm
=
new
ResourceManager
(
"OnlineStore.AutoInOutStore.Properties.Resource"
,
assembly
);
}
//CultureInfo ci = Thread.CurrentThread.CurrentCulture;
Dictionary
<
string
,
string
>
chinaMap
=
GetRMap
(
China
);
Dictionary
<
string
,
string
>
englishMap
=
GetRMap
(
English
);
List
<
string
>
resulList
=
new
List
<
string
>();
foreach
(
string
key
in
chinaMap
.
Keys
)
{
string
china
=
chinaMap
[
key
];
string
english
=
""
;
englishMap
.
TryGetValue
(
key
,
out
english
);
if
(
String
.
IsNullOrEmpty
(
english
))
{
english
=
""
;
}
resulList
.
Add
(
key
+
","
+
china
.
Replace
(
','
,
'&'
)
+
","
+
english
.
Replace
(
','
,
'&'
));
}
File
.
WriteAllLines
(
"D:\\storeResource.csv"
,
resulList
.
ToArray
());
}
private
static
Dictionary
<
string
,
string
>
GetRMap
(
string
lan
)
{
Dictionary
<
string
,
string
>
chinaMap
=
new
Dictionary
<
string
,
string
>();
CultureInfo
ci
=
new
CultureInfo
(
lan
);
ResourceSet
resourceSet
=
rm
.
GetResourceSet
(
ci
,
true
,
true
);
IDictionaryEnumerator
dictNumerator
=
resourceSet
.
GetEnumerator
();
// Get all string resources
while
(
dictNumerator
.
MoveNext
())
{
// Only string resources
if
(
dictNumerator
.
Value
is
string
)
{
var
key
=
(
string
)
dictNumerator
.
Key
;
var
value
=
(
string
)
dictNumerator
.
Value
;
// yield return new KeyValuePair<string, string>(key, value);
if
(!
chinaMap
.
ContainsKey
(
key
))
{
chinaMap
.
Add
(
key
,
value
);
}
}
}
return
chinaMap
;
}
private
static
string
CodeResourceControl_GetLanguageEvent
()
private
static
string
CodeResourceControl_GetLanguageEvent
()
{
{
return
CurrLanguage
;
return
CurrLanguage
;
...
@@ -67,13 +115,13 @@ namespace OnlineStore.AutoInOutStore
...
@@ -67,13 +115,13 @@ namespace OnlineStore.AutoInOutStore
}
}
//CultureInfo ci = Thread.CurrentThread.CurrentCulture;
//CultureInfo ci = Thread.CurrentThread.CurrentCulture;
CultureInfo
ci
=
new
CultureInfo
(
CurrLanguage
);
CultureInfo
ci
=
new
CultureInfo
(
CurrLanguage
);
strCurLanguage
=
rm
.
GetString
(
id
,
ci
).
Trim
();
strCurLanguage
=
rm
.
GetString
(
id
,
ci
).
Trim
();
if
(
strCurLanguage
.
Equals
(
""
)
&&
(!
defaultStr
.
Equals
(
""
)))
if
(
strCurLanguage
.
Equals
(
""
)
&&
(!
defaultStr
.
Equals
(
""
)))
{
{
strCurLanguage
=
defaultStr
;
strCurLanguage
=
defaultStr
;
NoIdLog
(
id
,
defaultStr
);
NoIdLog
(
id
,
defaultStr
);
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论