Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
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
List
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
syntax_j
mycard
Commits
bcae0ce9
Commit
bcae0ce9
authored
Dec 08, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
语言包优化
parent
fa26571c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
app/app-detail.component.ts
app/app-detail.component.ts
+8
-2
app/app.ts
app/app.ts
+5
-0
app/apps.service.ts
app/apps.service.ts
+2
-2
No files found.
app/app-detail.component.ts
View file @
bcae0ce9
...
...
@@ -6,7 +6,7 @@ import {App} from "./app";
import
{
DownloadService
}
from
"
./download.service
"
;
import
{
clipboard
,
remote
}
from
"
electron
"
;
import
*
as
path
from
"
path
"
;
import
*
as
fs
from
'
fs
'
;
import
*
as
fs
from
"
fs
"
;
declare
const
Notification
:
any
;
declare
const
$
:
any
;
...
...
@@ -56,7 +56,13 @@ export class AppDetailComponent implements OnInit {
console
.
log
(
this
.
references
);
this
.
referencesInstall
=
{};
for
(
let
reference
of
this
.
references
)
{
this
.
referencesInstall
[
reference
.
id
]
=
true
;
if
(
reference
.
isLanguage
())
{
// 对于语言包,只有在语言包的locales比游戏本身的更加合适的时候才默认勾选
// 这里先偷个懒,中文环境勾选中文语言包,非中文环境勾选非中文语言包
this
.
referencesInstall
[
reference
.
id
]
=
reference
.
locales
[
0
].
startsWith
(
'
zh
'
)
==
this
.
settingsService
.
getLocale
().
startsWith
(
'
zh
'
)
}
else
{
this
.
referencesInstall
[
reference
.
id
]
=
true
;
}
}
}
...
...
app/app.ts
View file @
bcae0ce9
...
...
@@ -81,11 +81,16 @@ export class App {
status
:
AppStatus
;
conference
:
string
|
undefined
;
isLanguage
()
{
return
this
.
category
==
Category
.
module
&&
this
.
tags
.
includes
(
'
language
'
);
}
reset
()
{
this
.
status
.
status
=
'
init
'
;
this
.
local
=
null
;
localStorage
.
removeItem
(
this
.
id
);
}
isInstalled
():
boolean
{
return
this
.
status
.
status
!=
'
init
'
;
}
...
...
app/apps.service.ts
View file @
bcae0ce9
import
{
Injectable
,
ApplicationRef
,
EventEmitter
}
from
"
@angular/core
"
;
import
{
Http
}
from
"
@angular/http
"
;
import
{
App
,
AppStatus
,
Action
,
Category
}
from
"
./app
"
;
import
{
App
,
AppStatus
,
Action
}
from
"
./app
"
;
import
{
SettingsService
}
from
"
./settings.sevices
"
;
import
*
as
fs
from
"
fs
"
;
import
*
as
path
from
"
path
"
;
...
...
@@ -239,7 +239,7 @@ export class AppsService {
'
language_pack
'
:
'
语言包
'
}
};
if
(
!
app
.
name
&&
app
.
category
==
Category
.
module
&&
app
.
tags
.
includes
(
'
language
'
)
&&
app
.
parent
)
{
if
(
!
app
.
name
&&
app
.
parent
&&
app
.
isLanguage
()
)
{
app
.
name
=
`
${
app
.
parent
.
name
}
${
lang
[
locale
].
language_pack
}
(
${
app
.
locales
.
map
((
l
)
=>
lang
[
locale
][
l
]).
join
(
'
,
'
)}
)`
}
}
...
...
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