Commit 69a65d8d authored by Brandon Labuschagne's avatar Brandon Labuschagne

I18N JS files starting with p or r

This is one of many MRs opened in order to improve the overall
internationalisation of the GitLab codebase.

This commit only targets Vanilla JS files.

i18n documentation
https://docs.gitlab.com/ee/development/i18n/externalization.html
parent 941f37e9
...@@ -38,9 +38,9 @@ export default class ProjectLabelSubscription { ...@@ -38,9 +38,9 @@ export default class ProjectLabelSubscription {
let newAction; let newAction;
if (oldStatus === 'unsubscribed') { if (oldStatus === 'unsubscribed') {
[newStatus, newAction] = ['subscribed', 'Unsubscribe']; [newStatus, newAction] = ['subscribed', __('Unsubscribe')];
} else { } else {
[newStatus, newAction] = ['unsubscribed', 'Subscribe']; [newStatus, newAction] = ['unsubscribed', __('Subscribe')];
} }
$btn.removeClass('disabled'); $btn.removeClass('disabled');
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import $ from 'jquery'; import $ from 'jquery';
import Api from './api'; import Api from './api';
import ProjectSelectComboButton from './project_select_combo_button'; import ProjectSelectComboButton from './project_select_combo_button';
import { s__ } from './locale';
export default function projectSelect() { export default function projectSelect() {
import(/* webpackChunkName: 'select2' */ 'select2/select2') import(/* webpackChunkName: 'select2' */ 'select2/select2')
...@@ -21,9 +22,9 @@ export default function projectSelect() { ...@@ -21,9 +22,9 @@ export default function projectSelect() {
this.includeProjectsInSubgroups = $(select).data('includeProjectsInSubgroups') || false; this.includeProjectsInSubgroups = $(select).data('includeProjectsInSubgroups') || false;
this.allowClear = $(select).data('allowClear') || false; this.allowClear = $(select).data('allowClear') || false;
placeholder = 'Search for project'; placeholder = s__('ProjectSelect|Search for project');
if (this.includeGroups) { if (this.includeGroups) {
placeholder += ' or group'; placeholder += s__('ProjectSelect| or group');
} }
$(select).select2({ $(select).select2({
......
...@@ -5,7 +5,7 @@ import _ from 'underscore'; ...@@ -5,7 +5,7 @@ import _ from 'underscore';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import flash from './flash'; import flash from './flash';
import axios from './lib/utils/axios_utils'; import axios from './lib/utils/axios_utils';
import { __ } from './locale'; import { sprintf, s__, __ } from './locale';
function Sidebar(currentUser) { function Sidebar(currentUser) {
this.toggleTodo = this.toggleTodo.bind(this); this.toggleTodo = this.toggleTodo.bind(this);
...@@ -101,7 +101,10 @@ Sidebar.prototype.toggleTodo = function(e) { ...@@ -101,7 +101,10 @@ Sidebar.prototype.toggleTodo = function(e) {
this.todoUpdateDone(data); this.todoUpdateDone(data);
}) })
.catch(() => .catch(() =>
flash(`There was an error ${ajaxType === 'post' ? 'adding a' : 'deleting the'} todo.`), flash(sprintf(__('There was an error %{message} todo.')), {
message:
ajaxType === 'post' ? s__('RightSidebar|adding a') : s__('RightSidebar|deleting the'),
}),
); );
}; };
......
...@@ -7538,6 +7538,12 @@ msgstr "" ...@@ -7538,6 +7538,12 @@ msgstr ""
msgid "ProjectPage|Project ID: %{project_id}" msgid "ProjectPage|Project ID: %{project_id}"
msgstr "" msgstr ""
msgid "ProjectSelect| or group"
msgstr ""
msgid "ProjectSelect|Search for project"
msgstr ""
msgid "ProjectSettings|Additional merge request capabilities that influence how and when merges will be performed" msgid "ProjectSettings|Additional merge request capabilities that influence how and when merges will be performed"
msgstr "" msgstr ""
...@@ -8226,6 +8232,12 @@ msgstr "" ...@@ -8226,6 +8232,12 @@ msgstr ""
msgid "Revoked personal access token %{personal_access_token_name}!" msgid "Revoked personal access token %{personal_access_token_name}!"
msgstr "" msgstr ""
msgid "RightSidebar|adding a"
msgstr ""
msgid "RightSidebar|deleting the"
msgstr ""
msgid "Run housekeeping" msgid "Run housekeeping"
msgstr "" msgstr ""
...@@ -9664,6 +9676,9 @@ msgstr "" ...@@ -9664,6 +9676,9 @@ msgstr ""
msgid "There was a problem communicating with your device." msgid "There was a problem communicating with your device."
msgstr "" msgstr ""
msgid "There was an error %{message} todo."
msgstr ""
msgid "There was an error loading users activity calendar." msgid "There was an error loading users activity calendar."
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