Externalize markdown toolbar button tooltips
Summary
The vue
version of the markdown toolbar is not using externalized strings.
Possible fixes
This can be easily fixed by adding the following externalized strings in the header.vue
component file. This is also using namespaces following the haml
version of the markdown toolbar.
diff --git a/app/assets/javascripts/vue_shared/components/markdown/header.vue b/app/assets/javascripts/vue_shared/components/markdown/header.vue
index 3ddb39730c4..254291d22e5 100644
--- a/app/assets/javascripts/vue_shared/components/markdown/header.vue
+++ b/app/assets/javascripts/vue_shared/components/markdown/header.vue
@@ -96,54 +96,54 @@ export default {
>
<toolbar-button
tag="**"
- button-title="Add bold text"
+ :button-title="s__('MarkdownToolbar|Add bold text')"
icon="bold"
/>
<toolbar-button
tag="*"
- button-title="Add italic text"
+ :button-title="s__('MarkdownToolbar|Add italic text')"
icon="italic"
/>
<toolbar-button
:prepend="true"
tag="> "
- button-title="Insert a quote"
+ :button-title="s__('MarkdownToolbar|Insert a quote')"
icon="quote"
/>
<toolbar-button
tag="`"
tag-block="```"
- button-title="Insert code"
+ :button-title="s__('MarkdownToolbar|Insert code')"
icon="code"
/>
<toolbar-button
tag="[{text}](url)"
tag-select="url"
- button-title="Add a link"
+ :button-title="s__('MarkdownToolbar|Add a link')"
icon="link"
/>
<toolbar-button
:prepend="true"
tag="* "
- button-title="Add a bullet list"
+ :button-title="s__('MarkdownToolbar|Add a bullet list')"
icon="list-bulleted"
/>
<toolbar-button
:prepend="true"
tag="1. "
- button-title="Add a numbered list"
+ :button-title="s__('MarkdownToolbar|Add a numbered list')"
icon="list-numbered"
/>
<toolbar-button
:prepend="true"
tag="* [ ] "
- button-title="Add a task list"
+ :button-title="s__('MarkdownToolbar|Add a task list')"
icon="task-done"
/>
<toolbar-button
:tag="mdTable"
:prepend="true"
- :button-title="__('Add a table')"
+ :button-title="s__('MarkdownToolbar|Add a table')"
icon="table"
/>
<button
@@ -152,7 +152,7 @@ export default {
class="toolbar-btn toolbar-fullscreen-btn js-zen-enter"
data-container="body"
tabindex="-1"
- title="Go full screen"
+ :title="s__('MarkdownToolbar|Go full screen')"
type="button"
>
<icon
Then, you would have to update the PO files with the new content by running bin/rake gettext:regenerate
. This will remove one translated string not using a namespace.
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 324e5315821..3f41dd72673 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -333,9 +333,6 @@ msgstr ""
msgid "Add a homepage to your wiki that contains information about your project and GitLab will display it here instead of this message."
msgstr ""
-msgid "Add a table"
-msgstr ""
-
msgid "Add license"
msgstr ""