Commit f65e2119 authored by Brandon Labuschagne's avatar Brandon Labuschagne Committed by Filipa Lacerda

Internationalisation of pages directory

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

i18n documentation
https://docs.gitlab.com/ee/development/i18n/externalization.html
parent 888840b6
...@@ -22,7 +22,7 @@ export default () => { ...@@ -22,7 +22,7 @@ export default () => {
_.debounce(function onMessageInput() { _.debounce(function onMessageInput() {
const message = $(this).val(); const message = $(this).val();
if (message === '') { if (message === '') {
$('.js-broadcast-message-preview').text('Your message here'); $('.js-broadcast-message-preview').text(__('Your message here'));
} else { } else {
axios axios
.post(previewPath, { .post(previewPath, {
......
...@@ -3,6 +3,7 @@ import createFlash from '~/flash'; ...@@ -3,6 +3,7 @@ import createFlash from '~/flash';
import GfmAutoComplete from 'ee_else_ce/gfm_auto_complete'; import GfmAutoComplete from 'ee_else_ce/gfm_auto_complete';
import emojiRegex from 'emoji-regex'; import emojiRegex from 'emoji-regex';
import EmojiMenu from './emoji_menu'; import EmojiMenu from './emoji_menu';
import { __ } from '~/locale';
const defaultStatusEmoji = 'speech_balloon'; const defaultStatusEmoji = 'speech_balloon';
...@@ -48,7 +49,7 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -48,7 +49,7 @@ document.addEventListener('DOMContentLoaded', () => {
const EMOJI_REGEX = emojiRegex(); const EMOJI_REGEX = emojiRegex();
if (EMOJI_REGEX.test(userNameInput.value)) { if (EMOJI_REGEX.test(userNameInput.value)) {
// set field to invalid so it gets detected by GlFieldErrors // set field to invalid so it gets detected by GlFieldErrors
userNameInput.setCustomValidity('Invalid field'); userNameInput.setCustomValidity(__('Invalid field'));
} else { } else {
userNameInput.setCustomValidity(''); userNameInput.setCustomValidity('');
} }
...@@ -81,5 +82,5 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -81,5 +82,5 @@ document.addEventListener('DOMContentLoaded', () => {
} }
}); });
}) })
.catch(() => createFlash('Failed to load emoji list.')); .catch(() => createFlash(__('Failed to load emoji list.')));
}); });
import { __ } from '~/locale';
export const visibilityOptions = { export const visibilityOptions = {
PRIVATE: 0, PRIVATE: 0,
INTERNAL: 10, INTERNAL: 10,
...@@ -5,9 +7,11 @@ export const visibilityOptions = { ...@@ -5,9 +7,11 @@ export const visibilityOptions = {
}; };
export const visibilityLevelDescriptions = { export const visibilityLevelDescriptions = {
[visibilityOptions.PRIVATE]: [visibilityOptions.PRIVATE]: __(
'The project is accessible only by members of the project. Access must be granted explicitly to each user.', 'The project is accessible only by members of the project. Access must be granted explicitly to each user.',
[visibilityOptions.INTERNAL]: 'The project can be accessed by any user who is logged in.', ),
[visibilityOptions.PUBLIC]: [visibilityOptions.INTERNAL]: __('The project can be accessed by any user who is logged in.'),
[visibilityOptions.PUBLIC]: __(
'The project can be accessed by anyone, regardless of authentication.', 'The project can be accessed by anyone, regardless of authentication.',
),
}; };
import $ from 'jquery'; import $ from 'jquery';
import Flash from '~/flash'; import Flash from '~/flash';
import Api from '~/api'; import Api from '~/api';
import { __ } from '~/locale';
export default class Search { export default class Search {
constructor() { constructor() {
...@@ -24,7 +25,7 @@ export default class Search { ...@@ -24,7 +25,7 @@ export default class Search {
data(term, callback) { data(term, callback) {
return Api.groups(term, {}, data => { return Api.groups(term, {}, data => {
data.unshift({ data.unshift({
full_name: 'Any', full_name: __('Any'),
}); });
data.splice(1, 0, 'divider'); data.splice(1, 0, 'divider');
return callback(data); return callback(data);
...@@ -54,14 +55,14 @@ export default class Search { ...@@ -54,14 +55,14 @@ export default class Search {
this.getProjectsData(term) this.getProjectsData(term)
.then(data => { .then(data => {
data.unshift({ data.unshift({
name_with_namespace: 'Any', name_with_namespace: __('Any'),
}); });
data.splice(1, 0, 'divider'); data.splice(1, 0, 'divider');
return data; return data;
}) })
.then(data => callback(data)) .then(data => callback(data))
.catch(() => new Flash('Error fetching projects')); .catch(() => new Flash(__('Error fetching projects')));
}, },
id(obj) { id(obj) {
return obj.id; return obj.id;
......
...@@ -6,7 +6,7 @@ import dateFormat from 'dateformat'; ...@@ -6,7 +6,7 @@ import dateFormat from 'dateformat';
import { getDayName, getDayDifference } from '~/lib/utils/datetime_utility'; import { getDayName, getDayDifference } from '~/lib/utils/datetime_utility';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import flash from '~/flash'; import flash from '~/flash';
import { __ } from '~/locale'; import { n__, s__, __ } from '~/locale';
const d3 = { select, scaleLinear, scaleThreshold }; const d3 = { select, scaleLinear, scaleThreshold };
...@@ -35,9 +35,9 @@ function formatTooltipText({ date, count }) { ...@@ -35,9 +35,9 @@ function formatTooltipText({ date, count }) {
const dateDayName = getDayName(dateObject); const dateDayName = getDayName(dateObject);
const dateText = dateFormat(dateObject, 'mmm d, yyyy'); const dateText = dateFormat(dateObject, 'mmm d, yyyy');
let contribText = 'No contributions'; let contribText = __('No contributions');
if (count > 0) { if (count > 0) {
contribText = `${count} contribution${count > 1 ? 's' : ''}`; contribText = n__('%d contribution', '%d contributions', count);
} }
return `${contribText}<br />${dateDayName} ${dateText}`; return `${contribText}<br />${dateDayName} ${dateText}`;
} }
...@@ -199,27 +199,27 @@ export default class ActivityCalendar { ...@@ -199,27 +199,27 @@ export default class ActivityCalendar {
renderDayTitles() { renderDayTitles() {
const days = [ const days = [
{ {
text: 'M', text: s__('DayTitle|M'),
y: 29 + this.dayYPos(1), y: 29 + this.dayYPos(1),
}, },
{ {
text: 'W', text: s__('DayTitle|W'),
y: 29 + this.dayYPos(3), y: 29 + this.dayYPos(3),
}, },
{ {
text: 'F', text: s__('DayTitle|F'),
y: 29 + this.dayYPos(5), y: 29 + this.dayYPos(5),
}, },
]; ];
if (this.firstDayOfWeek === firstDayOfWeekChoices.monday) { if (this.firstDayOfWeek === firstDayOfWeekChoices.monday) {
days.push({ days.push({
text: 'S', text: s__('DayTitle|S'),
y: 29 + this.dayYPos(7), y: 29 + this.dayYPos(7),
}); });
} else if (this.firstDayOfWeek === firstDayOfWeekChoices.saturday) { } else if (this.firstDayOfWeek === firstDayOfWeekChoices.saturday) {
days.push({ days.push({
text: 'S', text: s__('DayTitle|S'),
y: 29 + this.dayYPos(6), y: 29 + this.dayYPos(6),
}); });
} }
...@@ -253,11 +253,11 @@ export default class ActivityCalendar { ...@@ -253,11 +253,11 @@ export default class ActivityCalendar {
renderKey() { renderKey() {
const keyValues = [ const keyValues = [
'no contributions', __('no contributions'),
'1-9 contributions', __('1-9 contributions'),
'10-19 contributions', __('10-19 contributions'),
'20-29 contributions', __('20-29 contributions'),
'30+ contributions', __('30+ contributions'),
]; ];
const keyColors = [ const keyColors = [
'#ededed', '#ededed',
......
...@@ -44,6 +44,11 @@ msgstr[1] "" ...@@ -44,6 +44,11 @@ msgstr[1] ""
msgid "%d commits" msgid "%d commits"
msgstr "" msgstr ""
msgid "%d contribution"
msgid_plural "%d contributions"
msgstr[0] ""
msgstr[1] ""
msgid "%d exporter" msgid "%d exporter"
msgid_plural "%d exporters" msgid_plural "%d exporters"
msgstr[0] "" msgstr[0] ""
...@@ -297,9 +302,18 @@ msgstr[1] "" ...@@ -297,9 +302,18 @@ msgstr[1] ""
msgid "1 week" msgid "1 week"
msgstr "" msgstr ""
msgid "1-9 contributions"
msgstr ""
msgid "10-19 contributions"
msgstr ""
msgid "1st contribution!" msgid "1st contribution!"
msgstr "" msgstr ""
msgid "20-29 contributions"
msgstr ""
msgid "2FA" msgid "2FA"
msgstr "" msgstr ""
...@@ -315,6 +329,9 @@ msgstr "" ...@@ -315,6 +329,9 @@ msgstr ""
msgid "30 minutes" msgid "30 minutes"
msgstr "" msgstr ""
msgid "30+ contributions"
msgstr ""
msgid "403|Please contact your GitLab administrator to get permission." msgid "403|Please contact your GitLab administrator to get permission."
msgstr "" msgstr ""
...@@ -3002,6 +3019,18 @@ msgstr "" ...@@ -3002,6 +3019,18 @@ msgstr ""
msgid "Date picker" msgid "Date picker"
msgstr "" msgstr ""
msgid "DayTitle|F"
msgstr ""
msgid "DayTitle|M"
msgstr ""
msgid "DayTitle|S"
msgstr ""
msgid "DayTitle|W"
msgstr ""
msgid "Debug" msgid "Debug"
msgstr "" msgstr ""
...@@ -3751,6 +3780,9 @@ msgstr "" ...@@ -3751,6 +3780,9 @@ msgstr ""
msgid "Error fetching network graph." msgid "Error fetching network graph."
msgstr "" msgstr ""
msgid "Error fetching projects"
msgstr ""
msgid "Error fetching refs" msgid "Error fetching refs"
msgstr "" msgstr ""
...@@ -5006,6 +5038,9 @@ msgstr "" ...@@ -5006,6 +5038,9 @@ msgstr ""
msgid "Invalid feature" msgid "Invalid feature"
msgstr "" msgstr ""
msgid "Invalid field"
msgstr ""
msgid "Invalid file." msgid "Invalid file."
msgstr "" msgstr ""
...@@ -6104,6 +6139,9 @@ msgstr "" ...@@ -6104,6 +6139,9 @@ msgstr ""
msgid "No container images stored for this project. Add one by following the instructions above." msgid "No container images stored for this project. Add one by following the instructions above."
msgstr "" msgstr ""
msgid "No contributions"
msgstr ""
msgid "No contributions were found" msgid "No contributions were found"
msgstr "" msgstr ""
...@@ -9219,9 +9257,18 @@ msgstr "" ...@@ -9219,9 +9257,18 @@ msgstr ""
msgid "The project can be accessed by any logged in user." msgid "The project can be accessed by any logged in user."
msgstr "" msgstr ""
msgid "The project can be accessed by any user who is logged in."
msgstr ""
msgid "The project can be accessed by anyone, regardless of authentication."
msgstr ""
msgid "The project can be accessed without any authentication." msgid "The project can be accessed without any authentication."
msgstr "" msgstr ""
msgid "The project is accessible only by members of the project. Access must be granted explicitly to each user."
msgstr ""
msgid "The project is still being deleted. Please try again later." msgid "The project is still being deleted. Please try again later."
msgstr "" msgstr ""
...@@ -10992,6 +11039,9 @@ msgstr "" ...@@ -10992,6 +11039,9 @@ msgstr ""
msgid "Your issues will be imported in the background. Once finished, you'll get a confirmation email." msgid "Your issues will be imported in the background. Once finished, you'll get a confirmation email."
msgstr "" msgstr ""
msgid "Your message here"
msgstr ""
msgid "Your name" msgid "Your name"
msgstr "" msgstr ""
...@@ -11439,6 +11489,9 @@ msgstr "" ...@@ -11439,6 +11489,9 @@ msgstr ""
msgid "new merge request" msgid "new merge request"
msgstr "" msgstr ""
msgid "no contributions"
msgstr ""
msgid "none" msgid "none"
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