Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-2pick
Commits
956dc60b
Commit
956dc60b
authored
Dec 24, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
detect language on linux
parent
f8b0e5d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
8 deletions
+34
-8
gframe/game.cpp
gframe/game.cpp
+34
-8
No files found.
gframe/game.cpp
View file @
956dc60b
...
@@ -1113,33 +1113,59 @@ void Game::LoadConfig() {
...
@@ -1113,33 +1113,59 @@ void Game::LoadConfig() {
}
}
}
}
fclose
(
fp
);
fclose
(
fp
);
if
(
!
gameConf
.
locale
||
wcslen
(
gameConf
.
locale
)
<=
0
)
{
unsigned
int
lcid
=
0
;
#ifdef _WIN32
#ifdef _WIN32
if
(
!
gameConf
.
locale
)
{
lcid
=
((
unsigned
int
)
GetSystemDefaultLangID
())
&
0xff
;
unsigned
int
lcid
=
((
unsigned
int
)
GetSystemDefaultLangID
())
&
0xff
;
#else
char
*
locale_str
=
getenv
(
"LANG"
);
if
(
locale_str
)
{
if
(
strstr
(
locale_str
,
"zh"
))
lcid
=
0x04
;
else
if
(
strstr
(
locale_str
,
"en"
))
lcid
=
0x09
;
else
if
(
strstr
(
locale_str
,
"es"
))
lcid
=
0x0a
;
else
if
(
strstr
(
locale_str
,
"ja"
))
lcid
=
0x11
;
else
if
(
strstr
(
locale_str
,
"ko"
))
lcid
=
0x12
;
else
if
(
strstr
(
locale_str
,
"pt"
))
lcid
=
0x16
;
}
#endif
switch
(
lcid
)
{
switch
(
lcid
)
{
case
0x04
:
{
case
0x04
:
{
myswprintf
(
mainGame
->
gameConf
.
locale
,
L"%ls"
,
L"zh-CN"
);
myswprintf
(
gameConf
.
locale
,
L"%ls"
,
L"zh-CN"
);
break
;
break
;
}
}
case
0x09
:
{
case
0x09
:
{
myswprintf
(
mainGame
->
gameConf
.
locale
,
L"%ls"
,
L"en-US"
);
myswprintf
(
gameConf
.
locale
,
L"%ls"
,
L"en-US"
);
break
;
break
;
}
}
case
0x0a
:
{
case
0x0a
:
{
myswprintf
(
mainGame
->
gameConf
.
locale
,
L"%ls"
,
L"es-ES"
);
myswprintf
(
gameConf
.
locale
,
L"%ls"
,
L"es-ES"
);
break
;
break
;
}
}
case
0x11
:
{
case
0x11
:
{
myswprintf
(
mainGame
->
gameConf
.
locale
,
L"%ls"
,
L"ja-JP"
);
myswprintf
(
gameConf
.
locale
,
L"%ls"
,
L"ja-JP"
);
break
;
break
;
}
}
case
0x12
:
{
case
0x12
:
{
myswprintf
(
mainGame
->
gameConf
.
locale
,
L"%ls"
,
L"ko-KR"
);
myswprintf
(
gameConf
.
locale
,
L"%ls"
,
L"ko-KR"
);
break
;
}
case
0x16
:
{
myswprintf
(
gameConf
.
locale
,
L"%ls"
,
L"pt-BR"
);
break
;
break
;
}
}
}
}
}
}
#endif
}
}
void
Game
::
SaveConfig
()
{
void
Game
::
SaveConfig
()
{
FILE
*
fp
=
fopen
(
"system.conf"
,
"w"
);
FILE
*
fp
=
fopen
(
"system.conf"
,
"w"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment