refactor(i18n): remove raw text in source code

Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
Fernando Fernández 2023-12-30 21:13:13 +01:00
parent d0a619f838
commit 170c001053
4 changed files with 67 additions and 53 deletions

View File

@ -191,7 +191,9 @@ module.exports = {
'unicorn/no-await-expression-member': 'off',
// TODO: Reenable once vue-i18n-extract is completely refactored
'@intlify/vue-i18n/no-unused-keys': 'off',
'@intlify/vue-i18n/no-raw-text': 'error',
'@intlify/vue-i18n/no-raw-text': ['error', {
'ignorePattern': '^[-#:()&.]+$'
}],
'vue/component-name-in-template-casing': [
'error',
'PascalCase',

View File

@ -3,13 +3,17 @@
"NoMediaSourcesAvailable": "No media sources available",
"NoMediaStreamsAvailable": "No media streams available for the selected source",
"accept": "Accept",
"access": "Access",
"actor": "Actor",
"actors": "Actors",
"addBlockedTag": "Add blocked tag",
"addNewPerson": "Add a new person",
"administrator": "Administrator",
"airPlayDevices": "AirPlay devices",
"albums": "Albums",
"allLanguages": "All languages",
"allLibraries": "Enable access to all libraries",
"allowRemoteConnections": "Allow remote connections to this server",
"alphabetically": "Alphabetically",
"appbar": {
"tasks": {
@ -27,7 +31,10 @@
"audio": "Audio",
"audioCodecNotSupported": "The audio codec is not supported",
"auto": "Automatic",
"avatar": "Avatar",
"badRequest": "Bad request. Try again",
"blockTags": "Block items with tags:",
"blockUnratedItems": "Block items with no or unrecognized rating information:",
"books": "Books",
"browserNotSupported": "Your browser is not supported for playing this file.",
"buttons": {
@ -45,6 +52,7 @@
"collections": "Collections",
"communityRating": "Community rating",
"confirm": "Confirm",
"confirmPassword": "Confirm new password",
"connect": "Connect",
"contentType": "Content type",
"continueListening": "Continue listening",
@ -52,6 +60,7 @@
"copyPrompt": "Copy the following text into the clipboard?",
"copyStreamURL": "Copy Stream URL",
"criticRating": "Critic rating",
"currentPassword": "Current password",
"customRating": "Custom rating",
"darkModeToggle": "Toggle dark mode",
"dateAdded": "Date added",
@ -59,6 +68,8 @@
"delete": "Delete",
"deleteItem": "Delete media",
"deleteItemDescription": "Deleting this item will delete it from both the file system and your media library. Are you sure you wish to continue?",
"deleteUser": "Delete user",
"deleteUserConfirm": "Are you sure you want to delete this user?",
"details": "Details",
"dialog": {
"upNext": {
@ -67,6 +78,7 @@
"startNow": "Start now"
}
},
"dimensions": "{width}x{height}",
"directing": "Directing",
"director": "Director",
"disabled": "Disabled",
@ -76,6 +88,7 @@
"edit": "Edit",
"editMetadata": "Edit metadata",
"editPerson": "Edit person",
"editUser": "Edit user",
"endDate": "End date",
"endsAt": "Ends at {time}",
"episodeNumber": "Episode {episodeNumber}",
@ -131,6 +144,7 @@
"screenshot": "Screenshot",
"thumb": "Thumb"
},
"imageVotes": "{votes} votes",
"images": "Images",
"incorrectUsernameOrPassword": "Incorrect username or password",
"instantMix": "Instant mix",
@ -170,8 +184,12 @@
},
"itemNotFound": "Item not found",
"jellyfinLogo": "Jellyfin logo",
"language": "Language",
"lastActivityDate": "Last seen {value} ago",
"latestLibrary": "Latest {libraryName}",
"libraries": "Libraries",
"libraryAccess": "Library access",
"libraryAccessNote": "Select the libraries to share with this user. Administrators will be able to edit all folders using the metadata manager.",
"libraryEmpty": "This library is empty",
"libraryEmptyFilters": "No matches. Remove some filters to show more items",
"libraryNotFound": "Library not found",
@ -214,6 +232,8 @@
"noLogsFound": "No logs found"
},
"manualLogin": "Manual login",
"maxAllowedRating": "Maximum allowed parental rating",
"maxAllowedRatingSubtitle": "Content with a higher rating will be hidden from this user.",
"mediaInfo": "Media Info",
"mediaInfoAspectRatio": "Aspect ratio",
"mediaInfoAudioChannelLayout": "Layout",
@ -280,6 +300,8 @@
"music": "Music",
"name": "Name",
"networks": "Networks",
"newPassword": "New password",
"newUser": "Create user",
"nextUp": "Next up",
"no": "No",
"noImagesFound": "No images found",
@ -291,6 +313,7 @@
"originalAspectRatio": "Original aspect ratio",
"originalTitle": "Original title",
"overview": "Overview",
"parentalControl": "Parental Control",
"parentalRating": "Parental rating",
"parentalRatings": "Parental Ratings",
"password": "Password",
@ -355,6 +378,7 @@
},
"present": "Present",
"producer": "Producer",
"profile": "Profile",
"quality": "Quality",
"queue": "Queue",
"rating": "Rating",
@ -366,6 +390,7 @@
"remoteDevices": "Remote devices",
"replaceAllMetadata": "Replace all metadata",
"replaceExistingImages": "Replace existing images",
"resetPassword": "Reset password",
"results": "Results",
"resumable": "Resumable",
"resume": "Resume",
@ -511,31 +536,6 @@
"playNext": "The selected item will be played after the current one",
"routeValidationError": "The specified routeId in route params is not correct"
},
"addBlockedTag": "Add blocked tag",
"blockUnratedItems": "Block items with no or unrecognized rating information:",
"blockTags": "Block items with tags:",
"maxAllowedRating": "Maximum allowed parental rating",
"maxAllowedRatingSubtitle": "Content with a higher rating will be hidden from this user.",
"parentalControl": "Parental Control",
"tagName": "Tag name",
"unblockTag": "Unblock tag",
"access": "Access",
"allLibraries": "Enable access to all libraries",
"allowRemoteConnections": "Allow remote connections to this server",
"deleteUser": "Delete user",
"deleteUserConfirm": "Are you sure you want to delete this user?",
"profile": "Profile",
"confirmPassword": "Confirm new password",
"currentPassword": "Current password",
"newPassword": "New password",
"resetPassword": "Reset password",
"users": "Users",
"avatar": "Avatar",
"editUser": "Edit user",
"lastActivityDate": "Last seen {value} ago",
"libraryAccess": "Library access",
"libraryAccessNote": "Select the libraries to share with this user. Administrators will be able to edit all folders using the metadata manager.",
"newUser": "Create user",
"songs": "Songs",
"sortByType": "By {type}",
"sortTitle": "Sort title",
@ -548,6 +548,7 @@
"subtitles": "Subtitles",
"syncPlayGroups": "SyncPlay groups",
"syncingInProgress": "Syncing in progress",
"tagName": "Tag name",
"tagline": "Tagline",
"tags": "Tags",
"themeSong": "Theme Song",
@ -598,6 +599,7 @@
"unableToRefreshLibrary": "Unable to refresh library",
"unableToToggleLike": "Unable to change the liked status of the element",
"unableToTogglePlayed": "Unable to update the watch status",
"unblockTag": "Unblock tag",
"undefined": "Undefined",
"unexpectedError": "Unexpected error",
"unhandledException": "Unhandled exception",
@ -619,6 +621,7 @@
"upNext": "Up next",
"upNextName": "Up next: {upNextItemName}",
"username": "Username",
"users": "Users",
"validation": {
"bothPasswordsSame": "Both passwords must be the same",
"mustBeUrl": "This field must be a valid URL",

View File

@ -20,8 +20,10 @@
<div class="text-center text-subtitle-1">
{{ item.ImageType }}
</div>
<div class="text-center text-body-2 text--secondary">
{{ item.Width }} x {{ item.Height }}
<div
v-if="item.Width && item.Height"
class="text-center text-body-2 text--secondary">
{{ t('dimensions', { width: item.Width, height: item.Height }) }}
</div>
<VCardActions class="justify-center">
<VBtn
@ -67,7 +69,7 @@
{{ item.ImageType }}
</div>
<div class="text-center text-body-2 text--secondary">
{{ item.Width }} &times; {{ item.Height }}
{{ t('dimensions', { width: item.Width, height: item.Height }) }}
</div>
<VCardActions class="justify-center">
<VBtn
@ -96,18 +98,19 @@
</template>
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
import { useRemote } from '@/composables';
import {
getContainerAspectRatioForImageType,
getImageInfo
} from '@/utils/images';
import {
BaseItemDto,
ImageInfo,
ImageType
} from '@jellyfin/sdk/lib/generated-client';
import { getImageApi } from '@jellyfin/sdk/lib/utils/api/image-api';
import {
getContainerAspectRatioForImageType,
getImageInfo
} from '@/utils/images';
import { useRemote } from '@/composables';
import { computed, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
const props = defineProps<{ metadata: BaseItemDto }>();
@ -115,6 +118,7 @@ const remote = useRemote();
const images = ref<ImageInfo[]>([]);
const dialog = ref(false);
const { t } = useI18n();
const generalImages = computed<ImageInfo[]>(() =>
images.value.filter(

View File

@ -74,20 +74,24 @@
<div class="text-center text-truncate text-subtitle-1 mt-2">
{{ item.ProviderName }}
</div>
<div class="text-center text-body-2 text-grey-darken-2 info-box">
<template v-if="item.Width && item.Height">
{{ item.Width }} &times; {{ item.Height }}
<template v-if="item.Language">
&middot; {{ item.Language }}
</template>
</template>
<div
v-if="item.Width && item.Height"
class="text-center text-body-2 text-grey-darken-2 info-box">
{{ t('dimensions', { width: item.Width, height: item.Height }) }}
</div>
<div
v-if="item.Language"
class="text-center text-body-2 text-grey-darken-2 info-box">
<b>{{ `${t("language")}: ` }}</b>{{ getLocaleName(item.Language) }}
</div>
<div
v-if="item.CommunityRating"
class="text-center text-body-2 text-grey-darken-2 info-box">
<b>{{ `${t("communityRating")}: ` }}</b>{{ item.CommunityRating.toFixed(1) }}
</div>
<div class="text-center text-body-2 text-grey-darken-2 info-box">
<template v-if="item.CommunityRating">
{{ item.CommunityRating.toFixed(1) }}
<template v-if="item.VoteCount">
&middot; {{ item.VoteCount }} votes
</template>
<template v-if="item.VoteCount">
{{ t('imageVotes', { votes: item.VoteCount }) }}
</template>
</div>
<VSpacer />
@ -109,17 +113,18 @@
</template>
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRemote } from '@/composables';
import { getLocaleName } from '@/utils/i18n';
import { getContainerAspectRatioForImageType } from '@/utils/images';
import {
BaseItemDto,
ImageProviderInfo,
RemoteImageInfo,
ImageType,
BaseItemDto
RemoteImageInfo
} from '@jellyfin/sdk/lib/generated-client';
import { getRemoteImageApi } from '@jellyfin/sdk/lib/utils/api/remote-image-api';
import { getContainerAspectRatioForImageType } from '@/utils/images';
import { useRemote } from '@/composables';
import { computed, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
const props = defineProps<{
metadata: BaseItemDto;