Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 877a183

Browse files
add i18n support
1 parent 85c019a commit 877a183

File tree

20 files changed

+184
-55
lines changed

20 files changed

+184
-55
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
### Application specific ###
2828
application-dev.properties
29+
src/main/resources/static/images/
2930
src/main/resources/static/css/
3031
src/main/resources/static/favicon.ico
3132
src/main/resources/static/js/

‎front-end/package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎front-end/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"npm": "^6.4.0",
2424
"popper.js": "^1.14.4",
2525
"vue": "^2.5.17",
26+
"vue-i18n": "^8.0.0",
2627
"vue-router": "^3.0.1",
2728
"vuelidate": "^0.7.4",
2829
"vuex": "^3.0.1"

‎front-end/src/components/Logo.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="logo-wrapper">
3-
<img class="logo" src="/static/images/logo.png">
4-
<div class="tagline">Open source task management tool</div>
3+
<img class="logo" src="/images/logo.png">
4+
<div class="tagline">{{ $t("logo.tagLine") }}</div>
55
</div>
66
</template>
77

‎front-end/src/components/PageFooter.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<footer class="footer">
33
<span class="copyright">&copy; 2018 TaskAgile.com</span>
44
<ul class="footer-links list-inline float-right">
5-
<li class="list-inline-item"><a href="#">About</a></li>
6-
<li class="list-inline-item"><a href="#">Terms of Service</a></li>
7-
<li class="list-inline-item"><a href="#">Privacy Policy</a></li>
5+
<li class="list-inline-item"><a href="#">{{ $t("pageFooter.about") }}</a></li>
6+
<li class="list-inline-item"><a href="#">{{ $t("pageFooter.termOfService") }}</a></li>
7+
<li class="list-inline-item"><a href="#">{{ $t("pageFooter.privacyPolicy") }}</a></li>
88
<li class="list-inline-item"><a href="https://github.com/taskagile/vuejs.spring-boot.mysql" target="_blank">GitHub</a></li>
99
</ul>
1010
</footer>

‎front-end/src/components/PageHeader.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
<div class="boards-menu-toggle">
88
<div class="dropdown">
99
<button class="btn dropdown-toggle" type="button" id="boardsMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
10-
Boards
10+
{{ $t('header.boardsMenu.label') }}
1111
</button>
1212
<div class="dropdown-menu" aria-labelledby="boardsMenu">
13-
<div v-show="!hasBoards" class="dropdown-item">No boards</div>
13+
<div v-show="!hasBoards" class="dropdown-item">{{ $t('header.boardsMenu.noBoard') }}</div>
1414
<div v-show="hasBoards">
15-
<h6 class="dropdown-header" v-show="personalBoards.length">Personal Boards</h6>
15+
<h6 class="dropdown-header" v-show="personalBoards.length">{{ $t('header.boardsMenu.personalBoards') }}</h6>
1616
<button v-for="board in personalBoards" v-bind:key="board.id" @click="openBoard(board)"
1717
class="dropdown-item" type="button">{{ board.name }}</button>
1818
<div v-for="team in teamBoards" v-bind:key="'t' + team.id">
@@ -27,7 +27,7 @@
2727
<div class="search-box flex-fill">
2828
<div class="search-wrapper">
2929
<font-awesome-icon icon="search" class="search-icon" />
30-
<input type="text" placeholder="Search" class="form-control form-control-sm" />
30+
<input type="text" v-bind:placeholder="$t('header.search')" class="form-control form-control-sm" />
3131
</div>
3232
</div>
3333
<div class="profile-menu-toggle">
@@ -36,8 +36,8 @@
3636
{{ user.name }}
3737
</button>
3838
<div class="dropdown-menu" aria-labelledby="profileMenu">
39-
<button class="dropdown-item" type="button">Profile</button>
40-
<button class="dropdown-item" type="button">Sign Out</button>
39+
<button class="dropdown-item" type="button">{{ $t('header.profile') }}</button>
40+
<button class="dropdown-item" type="button">{{ $t('header.signOut') }}</button>
4141
</div>
4242
</div>
4343
</div>

‎front-end/src/i18n.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Vue from 'vue'
2+
import VueI18n from 'vue-i18n'
3+
import { enUS, zhCN } from './locale'
4+
5+
Vue.use(VueI18n)
6+
7+
// Create VueI18n instance with options
8+
export const i18n = new VueI18n({
9+
locale: 'en_US',
10+
messages: {
11+
'en_US': enUS,
12+
'zh_CN': zhCN
13+
}
14+
})

‎front-end/src/locale/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import enUSMessages from './messages/en_US.json'
2+
import zhCNMessages from './messages/zh_CN.json'
3+
4+
export const enUS = enUSMessages
5+
export const zhCN = zhCNMessages
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"logo": {
3+
"tagLine": "Open source task management tool"
4+
},
5+
"header": {
6+
"boardsMenu": {
7+
"label": "Boards",
8+
"noBoard": "No board",
9+
"personalBoards": "Personal Boards"
10+
},
11+
"search": "Search",
12+
"profile": "Profile",
13+
"signOut": "Sign Out"
14+
},
15+
"loginPage": {
16+
"form": {
17+
"username": {
18+
"label": "Username or email address",
19+
"required": "Username or email address is required"
20+
},
21+
"password": {
22+
"label": "Password",
23+
"required": "Password is required"
24+
},
25+
"submit": "Sign in",
26+
"noAccountYet": "Don't have an account yet?",
27+
"signUpHere": "Sign up here",
28+
"forgotPassword": "Forgot your password?"
29+
}
30+
},
31+
"registerPage": {
32+
"form": {
33+
"username": {
34+
"label": "Username",
35+
"requred": "Username is required",
36+
"alphaNum": "Username can only contain letters and numbers",
37+
"minLength": "Username must have at least {minLength} letters.",
38+
"maxLength": "Username is too long. It can contains maximium {maxLength} letters."
39+
},
40+
"emailAddress": {
41+
"label": "Email address",
42+
"required": "Email address is required",
43+
"email": "This is not a valid email address",
44+
"maxLength": "Email address is too long. It can contains maximium {maxLength} letters."
45+
},
46+
"password": {
47+
"label": "Password",
48+
"required": "Password is required",
49+
"minLength": "Password is too short. It can contains at least {minLength} letters.",
50+
"maxLength": "Password is too long. It can contains maximium {maxLength} letters."
51+
},
52+
"submit": "Create account",
53+
"terms": {
54+
"accept": "By clicking "Create account", you agree to our {termsOfService} and {privacyPolicy}.",
55+
"termsOfService": "terms of service",
56+
"privacyPolicy": "privacy policy"
57+
},
58+
"alreadyHaveAccount": "Already have an account?",
59+
"signIn": "Sign in"
60+
}
61+
},
62+
"homePage": {
63+
"personalBoards": "Personal Boards",
64+
"createNewBoard": "Create New Board",
65+
"createNewTeam": "Create New Team"
66+
},
67+
"pageFooter": {
68+
"about": "About",
69+
"termOfService": "Terms of Service",
70+
"privacyPolicy": "Privacy Policy"
71+
},
72+
"error": {
73+
"request": {
74+
"bad": "Bad request",
75+
"notAuthorized": "Request not authorized.",
76+
"forbidden": "Request forbidden.",
77+
"notFound": "Request failed. Request endpoint not found on the server.",
78+
"unknownServerError": "There is an error on the server side. Please try again later.",
79+
"failed": "Request failed. Please try again later.",
80+
"noResponse": "Request failed. No response from the server."
81+
}
82+
}
83+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /