Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
336
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
23
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TransFem.org
Sharkey
Commits
fbc801d1
Commit
fbc801d1
authored
5 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
言語切り替え
parent
2f18f82e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
locales/ja-JP.yml
+20
-17
20 additions, 17 deletions
locales/ja-JP.yml
src/client/init.ts
+12
-10
12 additions, 10 deletions
src/client/init.ts
src/client/pages/settings/general.vue
+20
-1
20 additions, 1 deletion
src/client/pages/settings/general.vue
webpack.config.ts
+1
-1
1 addition, 1 deletion
webpack.config.ts
with
53 additions
and
29 deletions
locales/ja-JP.yml
+
20
−
17
View file @
fbc801d1
_ago
:
_lang_
:
"
日本語"
unknown
:
"
謎"
future
:
"
未来"
justNow
:
"
たった今"
secondsAgo
:
"
{n}秒前"
minutesAgo
:
"
{n}分前"
hoursAgo
:
"
{n}時間前"
daysAgo
:
"
{n}日前"
weeksAgo
:
"
{n}週間前"
monthsAgo
:
"
{n}ヶ月前"
yearsAgo
:
"
{n}年前"
_time
:
second
:
"
秒"
minute
:
"
分"
hour
:
"
時間"
day
:
"
日"
introMisskey
:
"
ようこそ!Misskeyは、オープンソースの分散型マイクロブログサービスです。
\n
「ノート」を作成して、いま起こっていることを共有したり、あなたについて皆に発信しよう📡
\n
「リアクション」機能で、皆のノートに素早く反応を追加することもできます👍
\n
新しい世界を探検しよう🚀"
introMisskey
:
"
ようこそ!Misskeyは、オープンソースの分散型マイクロブログサービスです。
\n
「ノート」を作成して、いま起こっていることを共有したり、あなたについて皆に発信しよう📡
\n
「リアクション」機能で、皆のノートに素早く反応を追加することもできます👍
\n
新しい世界を探検しよう🚀"
monthAndDay
:
"
{month}月
{day}日"
monthAndDay
:
"
{month}月
{day}日"
...
@@ -400,6 +384,25 @@ passwordNotMatched: "一致していません"
...
@@ -400,6 +384,25 @@ passwordNotMatched: "一致していません"
signinWith
:
"
{x}でログイン"
signinWith
:
"
{x}でログイン"
tapSecurityKey
:
"
セキュリティーキーにタッチ"
tapSecurityKey
:
"
セキュリティーキーにタッチ"
or
:
"
もしくは"
or
:
"
もしくは"
uiLanguage
:
"
UIの表示言語"
_ago
:
unknown
:
"
謎"
future
:
"
未来"
justNow
:
"
たった今"
secondsAgo
:
"
{n}秒前"
minutesAgo
:
"
{n}分前"
hoursAgo
:
"
{n}時間前"
daysAgo
:
"
{n}日前"
weeksAgo
:
"
{n}週間前"
monthsAgo
:
"
{n}ヶ月前"
yearsAgo
:
"
{n}年前"
_time
:
second
:
"
秒"
minute
:
"
分"
hour
:
"
時間"
day
:
"
日"
_tutorial
:
_tutorial
:
title
:
"
Misskeyの使い方"
title
:
"
Misskeyの使い方"
...
...
This diff is collapsed.
Click to expand it.
src/client/init.ts
+
12
−
10
View file @
fbc801d1
...
@@ -61,20 +61,22 @@ if (localStorage.getItem('theme') == null) {
...
@@ -61,20 +61,22 @@ if (localStorage.getItem('theme') == null) {
}
}
//#region Detect the user language
//#region Detect the user language
let
lang
=
null
;
let
lang
=
localStorage
.
getItem
(
'
lang
'
)
;
if
(
langs
.
map
(
x
=>
x
[
0
]).
includes
(
navigator
.
language
))
{
if
(
lang
==
null
)
{
lang
=
navigator
.
language
;
if
(
langs
.
map
(
x
=>
x
[
0
]).
includes
(
navigator
.
language
))
{
}
else
{
lang
=
navigator
.
language
;
lang
=
langs
.
map
(
x
=>
x
[
0
]).
find
(
x
=>
x
.
split
(
'
-
'
)[
0
]
==
navigator
.
language
);
}
else
{
lang
=
langs
.
map
(
x
=>
x
[
0
]).
find
(
x
=>
x
.
split
(
'
-
'
)[
0
]
==
navigator
.
language
);
if
(
lang
==
null
)
{
if
(
lang
==
null
)
{
// Fallback
// Fallback
lang
=
'
en-US
'
;
lang
=
'
en-US
'
;
}
}
}
}
localStorage
.
setItem
(
'
lang
'
,
lang
);
localStorage
.
setItem
(
'
lang
'
,
lang
);
}
//#endregion
//#endregion
// Detect the user agent
// Detect the user agent
...
...
This diff is collapsed.
Click to expand it.
src/client/pages/settings/general.vue
+
20
−
1
View file @
fbc801d1
...
@@ -27,6 +27,13 @@
...
@@ -27,6 +27,13 @@
{{ $t('reduceUiAnimation') }}
{{ $t('reduceUiAnimation') }}
</mk-switch>
</mk-switch>
</div>
</div>
<div
class=
"_content"
>
<mk-select
v-model=
"lang"
>
<
template
#label
>
{{
$t
(
'
uiLanguage
'
)
}}
</
template
>
<option
v-for=
"x in langs"
:value=
"x[0]"
:key=
"x[0]"
>
{{ x[1] }}
</option>
</mk-select>
</div>
</section>
</section>
</template>
</template>
...
@@ -36,8 +43,9 @@ import { faImage, faCog } from '@fortawesome/free-solid-svg-icons';
...
@@ -36,8 +43,9 @@ import { faImage, faCog } from '@fortawesome/free-solid-svg-icons';
import
MkInput
from
'
../../components/ui/input.vue
'
;
import
MkInput
from
'
../../components/ui/input.vue
'
;
import
MkButton
from
'
../../components/ui/button.vue
'
;
import
MkButton
from
'
../../components/ui/button.vue
'
;
import
MkSwitch
from
'
../../components/ui/switch.vue
'
;
import
MkSwitch
from
'
../../components/ui/switch.vue
'
;
import
MkSelect
from
'
../../components/ui/select.vue
'
;
import
i18n
from
'
../../i18n
'
;
import
i18n
from
'
../../i18n
'
;
import
{
apiUrl
}
from
'
../../config
'
;
import
{
apiUrl
,
langs
}
from
'
../../config
'
;
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
i18n
,
i18n
,
...
@@ -46,10 +54,13 @@ export default Vue.extend({
...
@@ -46,10 +54,13 @@ export default Vue.extend({
MkInput
,
MkInput
,
MkButton
,
MkButton
,
MkSwitch
,
MkSwitch
,
MkSelect
,
},
},
data
()
{
data
()
{
return
{
return
{
langs
,
lang
:
localStorage
.
getItem
(
'
lang
'
),
wallpaperUploading
:
false
,
wallpaperUploading
:
false
,
faImage
,
faCog
faImage
,
faCog
}
}
...
@@ -72,6 +83,14 @@ export default Vue.extend({
...
@@ -72,6 +83,14 @@ export default Vue.extend({
},
},
},
},
watch
:
{
lang
()
{
localStorage
.
setItem
(
'
lang
'
,
this
.
lang
);
localStorage
.
removeItem
(
'
locale
'
);
location
.
reload
();
}
},
methods
:
{
methods
:
{
onWallpaperChange
([
file
])
{
onWallpaperChange
([
file
])
{
this
.
wallpaperUploading
=
true
;
this
.
wallpaperUploading
=
true
;
...
...
This diff is collapsed.
Click to expand it.
webpack.config.ts
+
1
−
1
View file @
fbc801d1
...
@@ -124,7 +124,7 @@ module.exports = {
...
@@ -124,7 +124,7 @@ module.exports = {
}),
}),
new
webpack
.
DefinePlugin
({
new
webpack
.
DefinePlugin
({
_VERSION_
:
JSON
.
stringify
(
meta
.
version
),
_VERSION_
:
JSON
.
stringify
(
meta
.
version
),
_LANGS_
:
JSON
.
stringify
(
Object
.
entries
(
locales
).
map
(([
k
,
v
]:
[
string
,
any
])
=>
[
k
,
v
&&
v
.
meta
&&
v
.
meta
.
lang
])),
_LANGS_
:
JSON
.
stringify
(
Object
.
entries
(
locales
).
map
(([
k
,
v
]:
[
string
,
any
])
=>
[
k
,
v
.
_
lang
_
])),
_ENV_
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
)
_ENV_
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
)
}),
}),
new
VueLoaderPlugin
(),
new
VueLoaderPlugin
(),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment