1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Chore: Clean up and simplify translatable strings

This commit is contained in:
Laurent Cozic 2022-10-30 18:37:58 +00:00
parent 33b262cd22
commit 56229d640b
9 changed files with 19 additions and 41 deletions

View File

@ -11,7 +11,7 @@ class Command extends BaseCommand {
}
description() {
return _('Moves the given <item> (notes matching pattern in current notebook or one notebook) to [notebook]. If <item> is subnotebook and [notebook] is "root", will make <item> parent notebook');
return _('Moves the given <item> to [notebook]');
}
async action(args) {

View File

@ -622,7 +622,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
});
editor.ui.registry.addButton('joplinInsertDateTime', {
tooltip: _('Insert Date Time'),
tooltip: _('Insert time'),
icon: 'insert-time',
onAction: function() {
void CommandService.instance().execute('insertDateTime');

View File

@ -80,7 +80,7 @@ const declarations: CommandDeclaration[] = [
},
{
name: 'insertDateTime',
label: () => _('Insert Date Time'),
label: () => _('Insert time'),
iconName: 'icon-add-date',
},
{

View File

@ -89,10 +89,10 @@ const EditLinkDialog = (props: LinkDialogProps) => {
// for more about creating accessible RN inputs.
const linkTextInput = (
<View style={styles.inputContainer} accessible>
<Text style={styles.text}>{_('Link Text')}</Text>
<Text style={styles.text}>{_('Link text')}</Text>
<TextInput
style={styles.input}
placeholder={_('Description of the link')}
placeholder={_('Link description')}
placeholderTextColor={placeholderColor}
value={linkLabel}
@ -138,7 +138,7 @@ const EditLinkDialog = (props: LinkDialogProps) => {
props.editorControl.hideLinkDialog();
}}>
<View style={styles.modalContent}>
<Text style={styles.header}>{_('Edit Link')}</Text>
<Text style={styles.header}>{_('Edit link')}</Text>
<View>
{linkTextInput}
{linkURLInput}

View File

@ -42,16 +42,10 @@ const MarkdownToolbar = (props: MarkdownToolbarProps) => {
const headerButtons: ButtonSpec[] = [];
for (let level = 1; level <= 5; level++) {
const active = selState.headerLevel === level;
let label;
if (!active) {
label = _('Create header level %d', level);
} else {
label = _('Remove level %d header', level);
}
headerButtons.push({
icon: `H${level}`,
description: label,
description: _('Header %d', level),
active,
// We only call addHeaderButton 5 times and in the same order, so
@ -72,8 +66,7 @@ const MarkdownToolbar = (props: MarkdownToolbarProps) => {
icon: (
<FontAwesomeIcon name="list-ul" style={styles.text}/>
),
description:
selState.inUnorderedList ? _('Remove unordered list') : _('Create unordered list'),
description: _('Unordered list'),
active: selState.inUnorderedList,
onPress: useCallback(() => {
editorControl.toggleList(ListType.UnorderedList);
@ -86,8 +79,7 @@ const MarkdownToolbar = (props: MarkdownToolbarProps) => {
icon: (
<FontAwesomeIcon name="list-ol" style={styles.text}/>
),
description:
selState.inOrderedList ? _('Remove ordered list') : _('Create ordered list'),
description: _('Ordered list'),
active: selState.inOrderedList,
onPress: useCallback(() => {
editorControl.toggleList(ListType.OrderedList);
@ -100,8 +92,7 @@ const MarkdownToolbar = (props: MarkdownToolbarProps) => {
icon: (
<FontAwesomeIcon name="tasks" style={styles.text}/>
),
description:
selState.inChecklist ? _('Remove task list') : _('Create task list'),
description: _('Task list'),
active: selState.inChecklist,
onPress: useCallback(() => {
editorControl.toggleList(ListType.CheckList);
@ -138,8 +129,7 @@ const MarkdownToolbar = (props: MarkdownToolbarProps) => {
icon: (
<FontAwesomeIcon name="bold" style={styles.text}/>
),
description:
selState.bolded ? _('Unbold') : _('Bold text'),
description: _('Bold'),
active: selState.bolded,
onPress: editorControl.toggleBolded,
@ -150,8 +140,7 @@ const MarkdownToolbar = (props: MarkdownToolbarProps) => {
icon: (
<FontAwesomeIcon name="italic" style={styles.text}/>
),
description:
selState.italicized ? _('Unitalicize') : _('Italicize'),
description: _('Italic'),
active: selState.italicized,
onPress: editorControl.toggleItalicized,
@ -160,8 +149,7 @@ const MarkdownToolbar = (props: MarkdownToolbarProps) => {
inlineFormattingBtns.push({
icon: '{;}',
description:
selState.inCode ? _('Remove code formatting') : _('Format as code'),
description: _('Code'),
active: selState.inCode,
onPress: editorControl.toggleCode,
@ -171,8 +159,7 @@ const MarkdownToolbar = (props: MarkdownToolbarProps) => {
if (props.editorSettings.katexEnabled) {
inlineFormattingBtns.push({
icon: '∑',
description:
selState.inMath ? _('Remove TeX region') : _('Create TeX region'),
description: _('KaTeX'),
active: selState.inMath,
onPress: editorControl.toggleMath,
@ -184,8 +171,7 @@ const MarkdownToolbar = (props: MarkdownToolbarProps) => {
icon: (
<FontAwesomeIcon name="link" style={styles.text}/>
),
description:
selState.inLink ? _('Edit link') : _('Create link'),
description: _('Link'),
active: selState.inLink,
onPress: editorControl.showLinkDialog,
@ -229,7 +215,7 @@ const MarkdownToolbar = (props: MarkdownToolbarProps) => {
<MaterialIcon name="search" style={styles.text}/>
),
description: (
props.searchState.dialogVisible ? _('Close find and replace') : _('Find and replace')
props.searchState.dialogVisible ? _('Close') : _('Find and replace')
),
active: props.searchState.dialogVisible,
onPress: useCallback(() => {

View File

@ -1,8 +1,7 @@
const React = require('react');
import { _ } from '@joplin/lib/locale';
import { ReactElement, useCallback, useState } from 'react';
import { AccessibilityInfo, LayoutChangeEvent, ScrollView, View, ViewStyle } from 'react-native';
import { LayoutChangeEvent, ScrollView, View, ViewStyle } from 'react-native';
import ToggleOverflowButton from './ToggleOverflowButton';
import ToolbarButton, { buttonSize } from './ToolbarButton';
import ToolbarOverflowRows from './ToolbarOverflowRows';
@ -55,11 +54,6 @@ const Toolbar = (props: ToolbarProps) => {
}, [allButtonSpecs.length]);
const onToggleOverflowVisible = useCallback(() => {
AccessibilityInfo.announceForAccessibility(
!overflowButtonsVisible
? _('Opened toolbar overflow menu')
: _('Closed toolbar overflow menu')
);
setOverflowPopupVisible(!overflowButtonsVisible);
}, [overflowButtonsVisible]);

View File

@ -195,7 +195,7 @@ export const SearchPanel = (props: SearchPanelProps) => {
styles={styles}
iconName="close"
onPress={control.hideSearch}
title={_('Close search')}
title={_('Close')}
/>
);

View File

@ -300,7 +300,6 @@ class ScreenHeaderComponent extends PureComponent<ScreenHeaderProps, ScreenHeade
disabled={disabled}
accessibilityLabel={_('Back')}
accessibilityHint={_('Navigate to the previous view')}
accessibilityRole="button">
<View style={disabled ? styles.backButtonDisabled : styles.backButton}>
<Icon
@ -326,7 +325,6 @@ class ScreenHeaderComponent extends PureComponent<ScreenHeaderProps, ScreenHeade
style={{ padding: 0 }}
accessibilityLabel={_('Save changes')}
accessibilityHint={disabled ? _('Any changes have been saved') : null}
accessibilityRole="button">
<View style={disabled ? styles.saveButtonDisabled : styles.saveButton}>{icon}</View>
</TouchableOpacity>

View File

@ -328,7 +328,7 @@ const SideMenuContentComponent = (props: Props) => {
if (hasChildren) folder_togglePress(folder);
}}
accessibilityLabel={collapsed ? _('Expand folder') : _('Collapse folder')}
accessibilityLabel={collapsed ? _('Expand') : _('Collapse')}
accessibilityRole="togglebutton"
>
{iconComp}