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
Pipeline #59297012 failed with stages
in 43 minutes and 10 seconds
import $ from 'jquery';
import Clipboard from 'clipboard';
import { sprintf, __ } from '~/locale';
function showTooltip(target, title) {
const $target = $(target);
......@@ -16,7 +17,7 @@ function showTooltip(target, title) {
}
function genericSuccess(e) {
showTooltip(e.trigger, 'Copied');
showTooltip(e.trigger, __('Copied'));
// Clear the selection and blur the trigger so it loses its border
e.clearSelection();
$(e.trigger).blur();
......@@ -33,7 +34,7 @@ function genericError(e) {
} else {
key = 'Ctrl';
}
showTooltip(e.trigger, `Press ${key}-C to copy`);
showTooltip(e.trigger, sprintf(__(`Press %{key}-C to copy`), { key }));
}
export default function initCopyToClipboard() {
......
/* eslint-disable class-methods-use-this */
import { Node } from 'tiptap';
import { __ } from '~/locale';
// Transforms generated HTML back to GFM for Banzai::Filter::TableOfContentsFilter
export default class TableOfContents extends Node {
......@@ -22,7 +23,7 @@ export default class TableOfContents extends Node {
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() {}
// Minimum number of users referenced before triggering a warning
MarkdownPreview.prototype.referenceThreshold = 10;
MarkdownPreview.prototype.emptyMessage = 'Nothing to preview.';
MarkdownPreview.prototype.emptyMessage = __('Nothing to preview.');
MarkdownPreview.prototype.ajaxCache = {};
......@@ -40,7 +40,7 @@ MarkdownPreview.prototype.showPreview = function($form) {
preview.text(this.emptyMessage);
this.hideReferencedUsers($form);
} else {
preview.addClass('md-preview-loading').text('Loading...');
preview.addClass('md-preview-loading').text(__('Loading...'));
this.fetchMarkdownPreview(
mdText,
url,
......
import $ from 'jquery';
import '../commons/bootstrap';
import { isInIssuePage } from '../lib/utils/common_utils';
import { __ } from '~/locale';
// Quick Submit behavior
//
......@@ -65,7 +66,9 @@ $(document).on(
}
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({
container: 'body',
......
......@@ -2690,6 +2690,9 @@ msgstr ""
msgid "ConvDev Index"
msgstr ""
msgid "Copied"
msgstr ""
msgid "Copy %{http_label} clone URL"
msgstr ""
......@@ -6173,6 +6176,9 @@ msgstr ""
msgid "Notes|Show history only"
msgstr ""
msgid "Nothing to preview."
msgstr ""
msgid "Notification events"
msgstr ""
......@@ -6751,6 +6757,9 @@ msgstr ""
msgid "Preferences|This feature is experimental and translations are not complete yet"
msgstr ""
msgid "Press %{key}-C to copy"
msgstr ""
msgid "Press Enter or click to search"
msgstr ""
......@@ -8869,6 +8878,9 @@ msgstr ""
msgid "System metrics (Kubernetes)"
msgstr ""
msgid "Table of Contents"
msgstr ""
msgid "Tag"
msgstr ""
......@@ -10659,6 +10671,12 @@ msgstr ""
msgid "You can also create a project from the command line."
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."
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