Commit 9178ebb7 authored by Clement Ho's avatar Clement Ho

Merge branch 'js-i18n-behaviors' into 'master'

i18n the behaviors directory

See merge request gitlab-org/gitlab-ce!27637
parents 0aca6d56 89f89285
import $ from 'jquery'; import $ from 'jquery';
import Clipboard from 'clipboard'; import Clipboard from 'clipboard';
import { sprintf, __ } from '~/locale';
function showTooltip(target, title) { function showTooltip(target, title) {
const $target = $(target); const $target = $(target);
...@@ -16,7 +17,7 @@ function showTooltip(target, title) { ...@@ -16,7 +17,7 @@ function showTooltip(target, title) {
} }
function genericSuccess(e) { function genericSuccess(e) {
showTooltip(e.trigger, 'Copied'); showTooltip(e.trigger, __('Copied'));
// Clear the selection and blur the trigger so it loses its border // Clear the selection and blur the trigger so it loses its border
e.clearSelection(); e.clearSelection();
$(e.trigger).blur(); $(e.trigger).blur();
...@@ -33,7 +34,7 @@ function genericError(e) { ...@@ -33,7 +34,7 @@ function genericError(e) {
} else { } else {
key = 'Ctrl'; key = 'Ctrl';
} }
showTooltip(e.trigger, `Press ${key}-C to copy`); showTooltip(e.trigger, sprintf(__(`Press %{key}-C to copy`), { key }));
} }
export default function initCopyToClipboard() { export default function initCopyToClipboard() {
......
/* eslint-disable class-methods-use-this */ /* eslint-disable class-methods-use-this */
import { Node } from 'tiptap'; import { Node } from 'tiptap';
import { __ } from '~/locale';
// Transforms generated HTML back to GFM for Banzai::Filter::TableOfContentsFilter // Transforms generated HTML back to GFM for Banzai::Filter::TableOfContentsFilter
export default class TableOfContents extends Node { export default class TableOfContents extends Node {
...@@ -22,7 +23,7 @@ export default class TableOfContents extends Node { ...@@ -22,7 +23,7 @@ export default class TableOfContents extends Node {
priority: 51, priority: 51,
}, },
], ],
toDOM: () => ['p', { class: 'table-of-contents' }, 'Table of Contents'], toDOM: () => ['p', { class: 'table-of-contents' }, __('Table of Contents')],
}; };
} }
......
...@@ -22,7 +22,7 @@ function MarkdownPreview() {} ...@@ -22,7 +22,7 @@ function MarkdownPreview() {}
// Minimum number of users referenced before triggering a warning // Minimum number of users referenced before triggering a warning
MarkdownPreview.prototype.referenceThreshold = 10; MarkdownPreview.prototype.referenceThreshold = 10;
MarkdownPreview.prototype.emptyMessage = 'Nothing to preview.'; MarkdownPreview.prototype.emptyMessage = __('Nothing to preview.');
MarkdownPreview.prototype.ajaxCache = {}; MarkdownPreview.prototype.ajaxCache = {};
...@@ -40,7 +40,7 @@ MarkdownPreview.prototype.showPreview = function($form) { ...@@ -40,7 +40,7 @@ MarkdownPreview.prototype.showPreview = function($form) {
preview.text(this.emptyMessage); preview.text(this.emptyMessage);
this.hideReferencedUsers($form); this.hideReferencedUsers($form);
} else { } else {
preview.addClass('md-preview-loading').text('Loading...'); preview.addClass('md-preview-loading').text(__('Loading...'));
this.fetchMarkdownPreview( this.fetchMarkdownPreview(
mdText, mdText,
url, url,
......
import $ from 'jquery'; import $ from 'jquery';
import '../commons/bootstrap'; import '../commons/bootstrap';
import { isInIssuePage } from '../lib/utils/common_utils'; import { isInIssuePage } from '../lib/utils/common_utils';
import { __ } from '~/locale';
// Quick Submit behavior // Quick Submit behavior
// //
...@@ -65,7 +66,9 @@ $(document).on( ...@@ -65,7 +66,9 @@ $(document).on(
} }
const $this = $(this); const $this = $(this);
const title = isMac() ? 'You can also press ⌘-Enter' : 'You can also press Ctrl-Enter'; const title = isMac()
? __('You can also press ⌘-Enter')
: __('You can also press Ctrl-Enter');
$this.tooltip({ $this.tooltip({
container: 'body', container: 'body',
......
...@@ -2690,6 +2690,9 @@ msgstr "" ...@@ -2690,6 +2690,9 @@ msgstr ""
msgid "ConvDev Index" msgid "ConvDev Index"
msgstr "" msgstr ""
msgid "Copied"
msgstr ""
msgid "Copy %{http_label} clone URL" msgid "Copy %{http_label} clone URL"
msgstr "" msgstr ""
...@@ -6173,6 +6176,9 @@ msgstr "" ...@@ -6173,6 +6176,9 @@ msgstr ""
msgid "Notes|Show history only" msgid "Notes|Show history only"
msgstr "" msgstr ""
msgid "Nothing to preview."
msgstr ""
msgid "Notification events" msgid "Notification events"
msgstr "" msgstr ""
...@@ -6751,6 +6757,9 @@ msgstr "" ...@@ -6751,6 +6757,9 @@ msgstr ""
msgid "Preferences|This feature is experimental and translations are not complete yet" msgid "Preferences|This feature is experimental and translations are not complete yet"
msgstr "" msgstr ""
msgid "Press %{key}-C to copy"
msgstr ""
msgid "Press Enter or click to search" msgid "Press Enter or click to search"
msgstr "" msgstr ""
...@@ -8869,6 +8878,9 @@ msgstr "" ...@@ -8869,6 +8878,9 @@ msgstr ""
msgid "System metrics (Kubernetes)" msgid "System metrics (Kubernetes)"
msgstr "" msgstr ""
msgid "Table of Contents"
msgstr ""
msgid "Tag" msgid "Tag"
msgstr "" msgstr ""
...@@ -10659,6 +10671,12 @@ msgstr "" ...@@ -10659,6 +10671,12 @@ msgstr ""
msgid "You can also create a project from the command line." msgid "You can also create a project from the command line."
msgstr "" msgstr ""
msgid "You can also press ⌘-Enter"
msgstr ""
msgid "You can also press Ctrl-Enter"
msgstr ""
msgid "You can also star a label to make it a priority label." msgid "You can also star a label to make it a priority label."
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment