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