More localization support (#33)

pull/62/head
Varun Patil 2022-09-16 16:26:29 -07:00
parent 47532b5d72
commit 45b90aa91f
6 changed files with 16 additions and 16 deletions

View File

@ -29,7 +29,7 @@ test.describe('Open', () => {
await page.locator(`${i2}`).click();
await page.waitForTimeout(1000);
await page.locator('[aria-label="Delete selection"]').click();
await page.locator('[aria-label="Delete"]').click();
await page.waitForTimeout(4000);
expect(await page.locator(`img[src="${src1}"]`).count()).toBe(0);
expect(await page.locator(`img[src="${src2}"]`).count()).toBe(0);

View File

@ -3,20 +3,20 @@
<NcAppNavigation>
<template id="app-memories-navigation" #list>
<NcAppNavigationItem :to="{name: 'timeline'}"
:title="t('timeline', 'Timeline')"
:title="t('memories', 'Timeline')"
exact>
<ImageMultiple slot="icon" :size="20" />
</NcAppNavigationItem>
<NcAppNavigationItem :to="{name: 'folders'}"
:title="t('folders', 'Folders')">
:title="t('memories', 'Folders')">
<FolderIcon slot="icon" :size="20" />
</NcAppNavigationItem>
<NcAppNavigationItem :to="{name: 'favorites'}"
:title="t('favorites', 'Favorites')">
:title="t('memories', 'Favorites')">
<Star slot="icon" :size="20" />
</NcAppNavigationItem>
<NcAppNavigationItem :to="{name: 'videos'}"
:title="t('videos', 'Videos')">
:title="t('memories', 'Videos')">
<Video slot="icon" :size="20" />
</NcAppNavigationItem>
</template>

View File

@ -143,7 +143,7 @@ export default class Photo extends Mixins(GlobalMixin) {
// Get this photo in the fileInfos
const photo = fileInfos.find(d => Number(d.fileid) === Number(this.data.fileid));
if (!photo) {
showError('Cannot find this photo anymore!');
showError(this.t('memories', 'Cannot find this photo anymore!'));
return;
}

View File

@ -65,7 +65,7 @@ export default class Settings extends Mixins(UserConfig, GlobalMixin) {
if (res.status === 200) {
window.location.reload();
} else {
showError('Error updating settings');
showError(this.t('memories', 'Error updating settings'));
}
}
}

View File

@ -75,7 +75,7 @@
<div v-if="selection.size > 0" class="top-bar">
<NcActions>
<NcActionButton
:aria-label="t('memories', 'Cancel selection')"
:aria-label="t('memories', 'Cancel')"
@click="clearSelection()">
{{ t('memories', 'Cancel') }}
<template #icon> <Close :size="20" /> </template>
@ -88,7 +88,7 @@
<NcActions>
<NcActionButton
:aria-label="t('memories', 'Delete selection')"
:aria-label="t('memories', 'Delete')"
@click="deleteSelection">
{{ t('memories', 'Delete') }}
<template #icon> <Delete :size="20" /> </template>
@ -96,13 +96,13 @@
</NcActions>
<NcActions>
<NcActionButton
:aria-label="t('memories', 'Download selection')"
:aria-label="t('memories', 'Download')"
@click="downloadSelection">
{{ t('memories', 'Download') }}
<template #icon> <Download :size="20" /> </template>
</NcActionButton>
<NcActionButton
:aria-label="t('memories', 'Mark Favorite')"
:aria-label="t('memories', 'Favorite')"
@click="favoriteSelection">
{{ t('memories', 'Favorite') }}
<template #icon> <Star :size="20" /> </template>

View File

@ -196,8 +196,8 @@ export async function* deleteFilesByIds(fileIds: number[]) {
try {
fileInfos = await getFiles(fileIds.filter(f => f));
} catch (e) {
showError(t('memories', 'Failed to delete files.'));
console.error('Failed to get file info for files to delete', fileIds, e);
showError(t('memories', 'Failed to delete files.'));
return;
}
@ -208,7 +208,7 @@ export async function* deleteFilesByIds(fileIds: number[]) {
await deleteFile(fileInfo.filename);
return fileInfo.fileid as number;
} catch (error) {
console.error(t('memories', 'Failed to delete {fileName}.', fileInfo), error);
console.error('Failed to delete', fileInfo, error);
showError(t('memories', 'Failed to delete {fileName}.', fileInfo));
return 0;
}
@ -287,7 +287,7 @@ export async function downloadFilesByIds(fileIds: number[]) {
},
)
} catch (error) {
console.error(t('memories', 'Failed to favorite {fileName}.', { fileName }), error)
console.error('Failed to favorite', fileName, error)
showError(t('memories', 'Failed to favorite {fileName}.', { fileName }))
}
}
@ -311,8 +311,8 @@ export async function downloadFilesByIds(fileIds: number[]) {
try {
fileInfos = await getFiles(fileIds.filter(f => f));
} catch (e) {
console.error('Failed to get file info', fileIds, e);
showError(t('memories', 'Failed to favorite files.'));
console.error('Failed to get file info for files to favorite', fileIds, e);
return;
}
@ -323,7 +323,7 @@ export async function downloadFilesByIds(fileIds: number[]) {
await favoriteFile(fileInfo.filename, favoriteState);
return fileInfo.fileid as number;
} catch (error) {
console.error(t('memories', 'Failed to favorite {fileName}.', fileInfo), error);
console.error('Failed to favorite', fileInfo, error);
showError(t('memories', 'Failed to favorite {fileName}.', fileInfo));
return 0;
}