refs #151 Define i18n key in constants to translate in rendering

This commit is contained in:
AkiraFukushima 2018-08-14 09:03:52 +09:00
parent 9c45082524
commit 6143481bfc
5 changed files with 16 additions and 22 deletions

View File

@ -1,16 +1,14 @@
import i18n from '../config/i18n'
export default {
DisplayNameAndUsername: {
name: i18n.t('preferences.general.display_style.display_name_and_username'),
name: 'preferences.general.display_style.display_name_and_username',
value: 0
},
DisplayName: {
name: i18n.t('preferences.general.display_style.display_name'),
name: 'preferences.general.display_style.display_name',
value: 1
},
Username: {
name: i18n.t('preferences.general.display_style.username'),
name: 'preferences.general.display_style.username',
value: 2
}
}

View File

@ -1,12 +1,10 @@
import i18n from '../config/i18n'
export default {
Light: {
name: i18n.t('preferences.general.theme.light'),
name: 'preferences.general.theme.light',
key: 'light'
},
Dark: {
name: i18n.t('preferences.general.theme.dark'),
name: 'preferences.general.theme.dark',
key: 'dark'
}
}

View File

@ -1,23 +1,21 @@
import i18n from '../config/i18n'
export default {
Public: {
name: i18n.t('preferences.general.visibility.public'),
name: 'preferences.general.visibility.public',
value: 0,
key: 'public'
},
Unlisted: {
name: i18n.t('preferences.general.visibility.unlisted'),
name: 'preferences.general.visibility.unlisted',
value: 1,
key: 'unlisted'
},
Private: {
name: i18n.t('preferences.general.visibility.private'),
name: 'preferences.general.visibility.private',
value: 2,
key: 'private'
},
Direct: {
name: i18n.t('preferences.general.visibility.direct'),
name: 'preferences.general.visibility.direct',
value: 3,
key: 'direct'
}

View File

@ -8,7 +8,7 @@
<tr>
<td class="title">{{ $t('preferences.general.theme_color') }}</td>
<td class="status">
<el-radio v-for="t in themes" :key="t.key" v-model="theme" :label="t.key">{{ t.name }}</el-radio>
<el-radio v-for="t in themes" :key="t.key" v-model="theme" :label="t.key">{{ $t(t.name) }}</el-radio>
</td>
</tr>
<tr>
@ -24,7 +24,7 @@
<el-option
v-for="style in nameStyles"
:key="style.value"
:label="style.name"
:label="$t(style.name)"
:value="style.value">
</el-option>
</el-select>
@ -44,7 +44,7 @@
<el-option
v-for="v in visibilities"
:key="v.value"
:label="v.name"
:label="$t(v.name)"
:value="v.value">
</el-option>
</el-select>

View File

@ -31,19 +31,19 @@
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="visibilityList.Public.value">
<icon name="globe" class="privacy-icon"></icon>
{{ visibilityList.Public.name }}
{{ $t(visibilityList.Public.name) }}
</el-dropdown-item>
<el-dropdown-item :command="visibilityList.Unlisted.value">
<icon name="unlock" class="privacy-icon"></icon>
{{ visibilityList.Unlisted.name }}
{{ $t(visibilityList.Unlisted.name) }}
</el-dropdown-item>
<el-dropdown-item :command="visibilityList.Private.value">
<icon name="lock" class="privacy-icon"></icon>
{{ visibilityList.Private.name }}
{{ $t(visibilityList.Private.name) }}
</el-dropdown-item>
<el-dropdown-item :command="visibilityList.Direct.value">
<icon name="envelope" class="privacy-icon" scale="0.8"></icon>
{{ visibilityList.Direct.name }}
{{ $t(visibilityList.Direct.name) }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>