Skip to content

Commit

Permalink
perf: support more translations + add Simplified Chinese translations (
Browse files Browse the repository at this point in the history
…VueTorrent#415)

* Extract all translatable strings in the settings dialog box.

* Finish All string extract.

issue:
  1. src\components\Modals\ShareLimit\ShareLimitInput.vue
     :label="`${title} Limit`"
  2. src\components\Modals\TagsAndCategories\CreateCategoryDialog.vue
     all tips not work
  3. src\components\Modals\TorrentDetailModal\Tabs\Trackers.vue
     no idea about formatTrackerStatus

Signed-off-by: Dee.H.Y <dongfengweixiao@hotmail.com>
  • Loading branch information
dongfengweixiao authored May 8, 2022
1 parent ea8e4a4 commit ddd28ae
Show file tree
Hide file tree
Showing 45 changed files with 863 additions and 261 deletions.
20 changes: 10 additions & 10 deletions src/components/Modals/AddModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@
<v-textarea
v-if="files.length == 0"
v-model="urls"
label="URL"
:label="$t('url')"
:prepend-icon="mdiLink"
rows="1"
required
:autofocus="!phoneLayout"
auto-grow
clearable
hint="One link per line"
:hint="$t('modals.add.urlHint')"
/>
</v-col>
</v-row>
Expand All @@ -103,7 +103,7 @@
v-model="category"
:items="availableCategories"
clearable
label="Category"
:label="$t('category')"
item-text="name"
:prepend-icon="mdiTag"
@input="categoryChanged"
Expand All @@ -112,7 +112,7 @@
<v-text-field
v-model="directory"
:disabled="autoTMM"
label="Download Directory"
:label="$t('modals.add.downloadDirectory')"
:prepend-icon="mdiFolder"
autocomplete="download-directory"
name="download-directory"
Expand All @@ -121,28 +121,28 @@
<v-flex xs12 sm6>
<v-checkbox
v-model="start"
label="Start torrent"
:label="$t('modals.add.starttorrent')"
hide-details
/>
</v-flex>
<v-flex xs12 sm6>
<v-checkbox
v-model="skip_checking"
label="Skip hash check"
:label="$t('modals.add.skipHashCheck')"
hide-details
/>
</v-flex>
<v-flex xs12 sm6>
<v-checkbox
v-model="root_folder"
label="Create subfolder"
:label="$t('modals.add.createSubfolder')"
hide-details
/>
</v-flex>
<v-flex xs12 sm6>
<v-checkbox
v-model="autoTMM"
label="Automatic Torrent Management"
:label="$t('modals.add.automaticTorrentManagement')"
hide-details
/>
</v-flex>
Expand Down Expand Up @@ -198,7 +198,7 @@
</v-icon>
</div>
<div>
<h3>Drop here for add</h3>
<h3>{{ $t('modals.add.dropHereForAdd') }}</h3>
</div>
</div>
</div>
Expand Down Expand Up @@ -234,7 +234,7 @@ export default {
else return /^.*\.torrent$/.test(f.name)
})
return result ? result : 'One or more files is not a valid torrent'
return result ? result : this.$i18n.t('modals.add.oneOrMoreFilesInvalidTorrent')
}
],
loading: false,
Expand Down
10 changes: 5 additions & 5 deletions src/components/Modals/ChangeLocationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<v-card>
<v-card-title class="pa-0">
<v-toolbar-title class="ma-4 primarytext--text">
<h3>Change Location</h3>
<h3>{{ $t('modals.changeLocation.title') }}</h3>
</v-toolbar-title>
</v-card-title>
<v-card-text>
Expand All @@ -17,13 +17,13 @@
<v-col>
<v-text-field
v-model="torrent.name"
label="Torrent Name"
:label="$t('modals.changeLocation.torrentName')"
:prepend-icon="mdiFile"
readonly
/>
<v-text-field
v-model="newPath"
label="Directory"
:label="$t('directory')"
:prepend-icon="mdiFolder"
@keydown.enter="setLocation"
/>
Expand All @@ -37,13 +37,13 @@
class="accent white--text elevation-0 px-4"
@click="setLocation"
>
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
8 changes: 4 additions & 4 deletions src/components/Modals/RenameModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<v-card>
<v-card-title class="pa-0">
<v-toolbar-title class="ma-4 primarytext--text">
<h3>Rename</h3>
<h3>{{ $t('modals.rename.title') }}</h3>
</v-toolbar-title>
</v-card-title>
<v-card-text>
Expand All @@ -21,7 +21,7 @@
rows="1"
auto-grow
clearable
label="Torrent Name"
:label="$t('modals.rename.torrentName')"
:prepend-inner-icon="mdiFile"
/>
</v-col>
Expand All @@ -42,13 +42,13 @@
class="accent white--text elevation-0 px-4"
@click="rename"
>
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
2 changes: 1 addition & 1 deletion src/components/Modals/SearchModal/PluginManager.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<v-btn @click="opened = true">
<v-icon>{{ mdiCog }}</v-icon> Plugin manager
<v-icon>{{ mdiCog }}</v-icon> {{ $t('modals.pluginManager.title') | titleCase }}
</v-btn>

<v-bottom-sheet
Expand Down
16 changes: 8 additions & 8 deletions src/components/Modals/SearchModal/SearchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>
<v-card :style="{ height: phoneLayout ? '100vh' : '' }">
<v-card-title class="justify-center">
<h2>Search</h2>
<h2>{{ $t('modals.search.title') }}</h2>
</v-card-title>
<v-card-text class="pa-0">
<v-form
Expand All @@ -35,7 +35,7 @@
:color="loading ? 'warning' : 'primary'"
@click="loading ? stopSearch() : startSearch()"
>
{{ loading ? "Stop" : "Search" }}
{{ loading ? $t('modals.search.btnStopSearch') : $t('modals.search.btnStartSearch') }}
</v-btn>
</v-col>
</v-flex>
Expand Down Expand Up @@ -106,12 +106,12 @@ export default {
loading: false,
grid: {
headers: [
{ text: 'Name', value: 'fileName' },
{ text: 'Size', value: 'fileSize' },
{ text: 'Seeds', value: 'nbSeeders' },
{ text: 'Peers', value: 'nbLeechers' },
{ text: 'Search_engine', value: 'siteUrl' },
{ text: 'Action', value: 'actions', sortable: false }
{ text: this.$i18n.t('modals.search.columnTitle.name'), value: 'fileName' },
{ text: this.$i18n.t('modals.search.columnTitle.size'), value: 'fileSize' },
{ text: this.$i18n.t('modals.search.columnTitle.seeds'), value: 'nbSeeders' },
{ text: this.$i18n.t('modals.search.columnTitle.peers'), value: 'nbLeechers' },
{ text: this.$i18n.t('modals.search.columnTitle.search_engine'), value: 'siteUrl' },
{ text: this.$i18n.t('modals.search.columnTitle.action'), value: 'actions', sortable: false }
]
},
searchForm: {
Expand Down
12 changes: 6 additions & 6 deletions src/components/Modals/SettingsModal/SettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
<v-tabs v-model="tab" align-with-title show-arrows>
<v-tabs-slider color="white" />
<v-tab class="white--text" href="#vuetorrent">
<h4>vuetorrent</h4>
<h4>{{ $t('modals.settings.tabName.VueTorrent') }}</h4>
</v-tab>
<v-tab class="white--text" href="#downloads">
<h4>downloads</h4>
<h4>{{ $t('modals.settings.tabName.downloads') }}</h4>
</v-tab>
<v-tab class="white--text" href="#connection">
<h4>connection</h4>
<h4>{{ $t('modals.settings.tabName.connection') }}</h4>
</v-tab>
<v-tab class="white--text" href="#bittorrent">
<h4>bittorrent</h4>
<h4>{{ $t('modals.settings.tabName.bittorrent') }}</h4>
</v-tab>
<v-tab class="white--text" href="#webui">
<h4>WEB UI</h4>
<h4>{{ $t('modals.settings.tabName.webUI') }}</h4>
</v-tab>
<v-tab class="white--text" href="#tagsAndCategories">
<h4>tags & categories</h4>
<h4>{{ $t('modals.settings.tabName.tagsAndCategories') }}</h4>
</v-tab>
</v-tabs>
</template>
Expand Down
32 changes: 16 additions & 16 deletions src/components/Modals/SettingsModal/Tabs/BitTorrent.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<template>
<v-card flat>
<v-subheader>Privacy</v-subheader>
<v-subheader>{{ $t('modals.settings.pageBittorrent.subHeaderPrivacy') }}</v-subheader>
<v-list-item>
<v-checkbox
v-model="settings.dht"
hide-details
class="ma-0 pa-0"
label="Enable DHT (decentralized network) to find more peers"
:label="$t('modals.settings.pageBittorrent.enableDHT')"
/>
</v-list-item>
<v-list-item>
<v-checkbox
v-model="settings.pex"
hide-details
class="ma-0 pa-0"
label="Enable Peer Exchange (PeX) to find more peers"
:label="$t('modals.settings.pageBittorrent.enablePeX')"
/>
</v-list-item>
<v-list-item>
<v-checkbox
v-model="settings.lsd"
hide-details
class="ma-0 pa-0"
label="Enable Local Peer Discovery to find more peers"
:label="$t('modals.settings.pageBittorrent.enableLPD')"
/>
</v-list-item>
<v-list-item>
<v-checkbox
v-model="settings.lsd"
hide-details
class="ma-0 pa-0"
label="Enable anonymous mode"
:label="$t('modals.settings.pageBittorrent.enableAnonymous')"
/>
</v-list-item>
<v-divider insert />
Expand All @@ -39,7 +39,7 @@
v-model="settings.queueing_enabled"
hide-details
class="ma-0 pa-0"
label="Torrent Queueing"
:label="$t('modals.settings.pageBittorrent.torrentQueue')"
/>
</v-list-item>
<v-list-item>
Expand All @@ -50,7 +50,7 @@
dense
type="number"
hide-details
label="Maximum active downloads"
:label="$t('modals.settings.pageBittorrent.maxActiveDownload')"
:disabled="!settings.queueing_enabled"
/>
</v-list-item>
Expand All @@ -62,7 +62,7 @@
dense
type="number"
hide-details
label="Maximum active uploads"
:label="$t('modals.settings.pageBittorrent.maxActiveUpload')"
:disabled="!settings.queueing_enabled"
/>
</v-list-item>
Expand All @@ -74,7 +74,7 @@
dense
type="number"
hide-details
label="Maximum active torrents"
:label="$t('modals.settings.pageBittorrent.maxActiveTorrent')"
:disabled="!settings.queueing_enabled"
/>
</v-list-item>
Expand All @@ -83,7 +83,7 @@
v-model="settings.dont_count_slow_torrents"
hide-details
class="ma-0 pa-0"
label="Do not count slow torrents in these limits"
:label="$t('modals.settings.pageBittorrent.excludeSlowTorrent')"
/>
</v-list-item>
<v-list-item>
Expand All @@ -94,7 +94,7 @@
dense
type="number"
hide-details
label="Download rate threshold KiB/s"
:label="$t('modals.settings.pageBittorrent.downloadRateLimit')"
:disabled="!settings.dont_count_slow_torrents"
/>
</v-list-item>
Expand All @@ -106,7 +106,7 @@
dense
type="number"
hide-details
label="Upload rate threshold KiB/s"
:label="$t('modals.settings.pageBittorrent.uploadRateLimit')"
:disabled="!settings.dont_count_slow_torrents"
/>
</v-list-item>
Expand All @@ -118,20 +118,20 @@
dense
type="number"
hide-details
label="Torrent inactivity timer"
:label="$t('modals.settings.pageBittorrent.torrentInactivityTimer')"
:disabled="!settings.dont_count_slow_torrents"
/>
</v-list-item>
<v-divider insert />
<v-subheader>Seed Limits</v-subheader>
<v-subheader>{{ $t('modals.settings.pageBittorrent.subHeaderSeedLimits') }}</v-subheader>
<v-list-item>
<v-row dense>
<v-col>
<v-checkbox
v-model="settings.max_ratio_enabled"
hide-details
class="ma-0 pa-0"
label="When ratio reaches"
:label="$t('modals.settings.pageBittorrent.whenRatioReaches')"
/>
</v-col>
<v-col>
Expand All @@ -154,7 +154,7 @@
v-model="settings.max_seeding_time_enabled"
hide-details
class="ma-0 pa-0"
label="When seeding time reaches"
:label="$t('modals.settings.pageBittorrent.whenSeedingTimeReaches')"
/>
</v-col>
<v-col>
Expand Down
Loading

0 comments on commit ddd28ae

Please sign in to comment.