Skip to content

Commit

Permalink
perf: more translations
Browse files Browse the repository at this point in the history
  • Loading branch information
WDaan committed Nov 27, 2021
1 parent a87884d commit 4f8c697
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 37 deletions.
26 changes: 13 additions & 13 deletions src/components/Modals/ConfirmDeleteModal.vue
Expand Up @@ -3,16 +3,16 @@
v-model="dialog"
scrollable
content-class="rounded-form"
max-width="550px"
max-width="600px"
>
<v-card>
<v-card class="pa-2">
<v-card-title class="pa-0">
<v-toolbar-title class="ma-4">
<h3>Confirm Removal</h3>
<v-toolbar-title class="mx-4 mt-2">
<h3>{{ $t('confirm') | titleCase }}</h3>
</v-toolbar-title>
</v-card-title>
<v-card-text>
<v-list flat>
<v-card-text class="px-6p py-2 mb-2">
<v-list flat class="mb-4">
<v-list-item
v-for="t in torrents"
:key="t.hash"
Expand All @@ -26,28 +26,28 @@
</v-list-item-content>
</v-list-item>
</v-list>
</v-card-text>
<v-divider />
<v-card-actions class="justify-end">
<v-checkbox
v-model="settings.deleteWithFiles"
class="ma-0 pa-0"
label="Also delete the files on the storage"
:label="$t('modals.delete.check')"
hide-details
/>
<v-spacer />
</v-card-text>
<v-divider />
<v-card-actions class="justify-end">
<v-btn
class="white--text elevation-0 px-4"
:class="settings.deleteWithFiles ? 'error' : 'info'"
@click="deleteTorrent()"
>
Delete
{{ $t('delete') }}
</v-btn>
<v-spacer />
<v-btn
class="grey white--text elevation-0 px-4"
@click="close()"
>
Cancel
{{ $t('cancel') }}
</v-btn>
</v-card-actions>
</v-card>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Modals/SettingsModal/SettingsModal.vue
Expand Up @@ -71,13 +71,13 @@
class="accent white--text elevation-0 px-4"
@click="saveSettings"
>
save
{{ $t('save') }}
</v-btn>
<v-btn
class="error white--text elevation-0 px-4"
@click="close"
>
cancel
{{ $t('cancel') }}
</v-btn>
</v-card-actions>
</v-card>
Expand Down Expand Up @@ -128,4 +128,4 @@ export default {
.fix-height .v-card__text {
height: 400px;
}
</style>
</style>
8 changes: 4 additions & 4 deletions src/components/Modals/TorrentDetailModal/Tabs/Info.vue
Expand Up @@ -12,7 +12,7 @@
</tr>
<tr>
<td :class="commonStyle">
Directory
{{ $t('torrent.directory') | titleCase }}
</td>
<td>
{{ torrent.savePath }}
Expand All @@ -37,7 +37,7 @@
</tr>
<tr>
<td :class="commonStyle">
Downloaded
{{ $t('torrent.downloaded') | titleCase }}
</td>
<td>
{{ torrent.dloaded | getDataValue }}
Expand All @@ -46,7 +46,7 @@
</tr>
<tr>
<td :class="commonStyle">
Uploaded
{{ $t('torrent.uploaded') | titleCase }}
</td>
<td>
{{ torrent.uploaded | getDataValue }}
Expand Down Expand Up @@ -144,7 +144,7 @@
</tr>
<tr v-if="comment">
<td :class="commonStyle">
Comments
{{ $t('torrent.comments') | titleCase }}
</td>
<td>
{{ comment }}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Navbar/NavbarActions.vue
Expand Up @@ -15,7 +15,7 @@
</v-icon>
</v-btn>
</template>
<span>Log out</span>
<span>Log Out</span>
</v-tooltip>
</v-col>
<v-col>
Expand All @@ -37,7 +37,7 @@
</v-tooltip>
</v-col>
<v-col>
<connection-status :status="connectionStatus" />
<connection-status :status="connectionStatus | titleCase" />
</v-col>
<v-col>
<v-tooltip top>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/SessionStats.vue
Expand Up @@ -14,7 +14,7 @@
{{ mdiInformationOutline }}
</v-icon>
</template>
<span>Since the last time qBittorrent was restarted</span>
<span>{{ $t('navbar.sessionStats.tooltip') }}</span>
</v-tooltip>
<StorageCard
class="mb-4 mt-4"
Expand Down
4 changes: 2 additions & 2 deletions src/components/Torrent/TorrentRightClickMenu.vue
Expand Up @@ -24,7 +24,7 @@
class="ml-2"
style="font-size: 1em"
>
{{ $t('rightClick.pause') | titleCase }}
{{ $t('pause') | titleCase }}
</v-list-item-title>
</v-list-item>

Expand All @@ -37,7 +37,7 @@
class="ml-2 red--text"
style="font-size: 1em;"
>
{{ $t('rightClick.delete') | titleCase }}
{{ $t('delete') | titleCase }}
</v-list-item-title>
</v-list-item>
<v-divider />
Expand Down
2 changes: 2 additions & 0 deletions src/filters.js
Expand Up @@ -110,6 +110,8 @@ Vue.filter('getDataValue', getDataValue)


export function titleCase(str) {
if (!str) return

return str.split(' ')
.map(w => w[0].toUpperCase() + w.substr(1).toLowerCase())
.join(' ')
Expand Down
20 changes: 17 additions & 3 deletions src/lang/en.js
Expand Up @@ -2,14 +2,24 @@ const locale = {
/** General */
category: 'category',
settings: 'settings',
pause: 'pause',
delete: 'delete',
save: 'save',
cancel: 'cancel',
confirm: 'confirm',

/** Torrent */
torrent: {
title: 'title',
added: 'added on',
availability: 'availability',
size: 'size',
progress: 'progress'
progress: 'progress',
directory: 'directory',
downloaded: 'downloaded',
uploaded: 'uploaded',
created: 'created by',
comments: 'comments'
},
/** Navbar */
navbar: {
Expand All @@ -22,6 +32,9 @@ const locale = {
removeSelected: 'remove selected torrents',
openSettings: 'open settings',
searchNew: 'search new torrent'
},
sessionStats: {
tooltip: 'Since the last time qBittorrent was restarted'
}
},

Expand All @@ -30,6 +43,9 @@ const locale = {
add: {
title: 'Add a new Torrent',
selectFiles: 'Select your files'
},
delete: {
check: 'Also delete files from storage'
}
},

Expand All @@ -45,8 +61,6 @@ const locale = {
rightClick: {
resume: 'resume',
forceResume: 'force resume',
pause: 'pause',
delete: 'delete',
advanced: {
advanced: 'advanced',
changeLocation: 'change location',
Expand Down
21 changes: 18 additions & 3 deletions src/lang/nl.js
Expand Up @@ -2,13 +2,24 @@ const locale = {
/** General */
category: 'categorie',
settings: 'instellingen',
pause: 'pauzeer',
delete: 'verwijder',
save: 'opslaan',
cancel: 'annuleren',
confirm: 'bevestig',


/** Torrent */
torrent: {
title: 'titel',
added: 'toegevoegd op',
size: 'grootte',
progress: 'vooruitgang'
progress: 'vooruitgang',
directory: 'map',
downloaded: 'gedownload',
uploaded: 'geüpload',
created: 'gemaakt door',
comments: 'opmerkingen'
},

/** Navbar */
Expand All @@ -22,6 +33,9 @@ const locale = {
removeSelected: 'verwijder geselecteerde torrents',
openSettings: 'open instellingen',
searchNew: 'zoek nieuwe torrent'
},
sessionStats: {
tooltip: 'Sinds qBitorrent is opgestart'
}
},

Expand All @@ -30,6 +44,9 @@ const locale = {
add: {
title: 'Voeg torrent toe',
selectFiles: 'Selecteer bestanden'
},
delete: {
check: 'Ook bestanden verwijderen'
}
},

Expand All @@ -45,8 +62,6 @@ const locale = {
rightClick: {
resume: 'hervat',
forceResume: 'geforceerd hervatten',
pause: 'pauzeer',
delete: 'verwijder',
advanced: {
advanced: 'geavanceerd',
changeLocation: 'verander locatie',
Expand Down
4 changes: 2 additions & 2 deletions src/lang/zh.js
Expand Up @@ -2,6 +2,8 @@ const locale = {
/** General */
category: '分类',
settings: '设置',
pause: '暂停',
delete: '删除',

/** Torrent */
torrent: {
Expand Down Expand Up @@ -45,8 +47,6 @@ const locale = {
rightClick: {
resume: '继续',
forceResume: '强制继续',
pause: '暂停',
delete: '删除',
advanced: {
advanced: '高级',
changeLocation: '修改保存位置',
Expand Down
8 changes: 4 additions & 4 deletions src/views/Login.vue
Expand Up @@ -16,7 +16,7 @@
:rules="inputRules"
autocomplete="current email"
name="username"
@keyup.enter.native="Login"
@keyup.enter.native="login"
/>
<v-text-field
v-model="password"
Expand All @@ -27,14 +27,14 @@
:rules="inputRules"
autocomplete="current password"
name="password"
@keyup.enter.native="Login"
@keyup.enter.native="login"
/>
<v-spacer />
<v-card-actions class="justify-center">
<v-btn
text
class="accent white--text mx-0 mt-3"
@click="Login"
@click="login"
>
Login
</v-btn>
Expand Down Expand Up @@ -66,7 +66,7 @@ export default {
}
},
methods: {
async Login() {
async login() {
const authenticated = await this.$store.dispatch('LOGIN', {
username: this.username,
password: this.password
Expand Down

0 comments on commit 4f8c697

Please sign in to comment.