Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

This pull request uses the _(...) function to make it possible to localise the strings in the Markdown editor's search dialog (and two of the accessibility strings). See https://codemirror.net/examples/translate/ for details about the approach taken.

Note: This only applies to desktop. On mobile, a custom search dialog is used.

Testing plan

  1. Add an exclamation point to each of the mapped strings in localisation.ts:
diff
diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/v6/utils/localisation.ts b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/v6/utils/localisation.ts
index a17cf3571..e5c133df3 100644
--- a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/v6/utils/localisation.ts
+++ b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/v6/utils/localisation.ts
@@ -9,20 +9,20 @@ export default () => ({
 	'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'),
+	'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!'),
 });
  1. Verify that an exclamation point has been added to each of the strings in the search dialog (except regex):
    screenshot: Search dialog strings, except regex, have trailing exclamation points

@personalizedrefrigerator personalizedrefrigerator changed the title Desktop: Allow Markdown editor search dialog to be translated Desktop: Allow Markdown editor search dialog to be localised Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant