1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Desktop: Allow Markdown editor search dialog to be localised (#11219)

This commit is contained in:
Henry Heino
2024-10-26 13:02:54 -07:00
committed by GitHub
parent 4580c63ac7
commit e77fa19fea
6 changed files with 40 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ import useKeymap from './utils/useKeymap';
import useEditorSearch from '../utils/useEditorSearchExtension';
import CommandService from '@joplin/lib/services/CommandService';
import { SearchMarkers } from '../../../utils/useSearchMarkers';
import localisation from './utils/localisation';
interface Props extends EditorProps {
style: React.CSSProperties;
@@ -98,6 +99,7 @@ const Editor = (props: Props, ref: ForwardedRef<CodeMirrorControl>) => {
const editorProps: EditorProps = {
...props,
localisations: localisation(),
onEvent: event => onEventRef.current(event),
onLogMessage: message => onLogMessageRef.current(message),
};

View File

@@ -0,0 +1,28 @@
import { _ } from '@joplin/lib/locale';
// See https://codemirror.net/examples/translate/
export default () => ({
// @codemirror/view
'Control character': _('Control character'),
// @codemirror/commands
'Selection deleted': _('Selection deleted'),
// @codemirror/search
'Go to line': _('Go to line'),
'go': _('go'),
'Find': _('Find'),
'Replace': _('Replace'),
'next': _('next'),
'previous': _('previous'),
'all': _('all'),
'match case': _('match case'),
'by word': _('by word'),
'replace': _('replace'),
'replace all': _('replace all'),
'close': _('close'),
'current match': _('current match'),
'replaced $ matches': _('replaced $ matches'),
'replaced match on line $': _('replaced match on line $'),
'on line': _('on line'),
});