diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-05-02 13:53:34 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-05-02 13:53:34 +0000 |
commit | 3cfac9b00da82b10e0a43141054d845782ce0f7c (patch) | |
tree | 3e55310be681a1866027cecf0d40854d92979eff | |
parent | 888840b6a33d6f6d80b3753a5f3ed4a3a8280dac (diff) | |
parent | f65e2119d3ce32ec52b8a0cdc603948ad0268e26 (diff) | |
download | gitlab-ce-3cfac9b00da82b10e0a43141054d845782ce0f7c.tar.gz |
Merge branch 'js-i18n-pages' into 'master'
Internationalisation of pages directory
See merge request gitlab-org/gitlab-ce!27731
6 files changed, 81 insertions, 22 deletions
diff --git a/app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js b/app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js index d5ded3f9a79..6e00e31b828 100644 --- a/app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js +++ b/app/assets/javascripts/pages/admin/broadcast_messages/broadcast_message.js @@ -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, { diff --git a/app/assets/javascripts/pages/profiles/show/index.js b/app/assets/javascripts/pages/profiles/show/index.js index e726ab0e220..13cb0d6f74b 100644 --- a/app/assets/javascripts/pages/profiles/show/index.js +++ b/app/assets/javascripts/pages/profiles/show/index.js @@ -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.'))); }); diff --git a/app/assets/javascripts/pages/projects/shared/permissions/constants.js b/app/assets/javascripts/pages/projects/shared/permissions/constants.js index bc5c29d12b5..ac0dca31c37 100644 --- a/app/assets/javascripts/pages/projects/shared/permissions/constants.js +++ b/app/assets/javascripts/pages/projects/shared/permissions/constants.js @@ -1,3 +1,5 @@ +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.', + ), }; diff --git a/app/assets/javascripts/pages/search/show/search.js b/app/assets/javascripts/pages/search/show/search.js index 0c896c8599e..d5a8e712d6b 100644 --- a/app/assets/javascripts/pages/search/show/search.js +++ b/app/assets/javascripts/pages/search/show/search.js @@ -1,6 +1,7 @@ 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; diff --git a/app/assets/javascripts/pages/users/activity_calendar.js b/app/assets/javascripts/pages/users/activity_calendar.js index 4a20753e7ae..693125f8a38 100644 --- a/app/assets/javascripts/pages/users/activity_calendar.js +++ b/app/assets/javascripts/pages/users/activity_calendar.js @@ -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', diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 352de8599ba..9f8bf08116c 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -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 "" |