Commit 7f75ac0c authored by Brandon Labuschagne's avatar Brandon Labuschagne Committed by Fatih Acet

Internationalisation of merge_conflicts 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 448a0862
...@@ -3,15 +3,16 @@ ...@@ -3,15 +3,16 @@
import $ from 'jquery'; import $ from 'jquery';
import Vue from 'vue'; import Vue from 'vue';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import { s__ } from '~/locale';
(global => { (global => {
global.mergeConflicts = global.mergeConflicts || {}; global.mergeConflicts = global.mergeConflicts || {};
const diffViewType = Cookies.get('diff_view'); const diffViewType = Cookies.get('diff_view');
const HEAD_HEADER_TEXT = 'HEAD//our changes'; const HEAD_HEADER_TEXT = s__('MergeConflict|HEAD//our changes');
const ORIGIN_HEADER_TEXT = 'origin//their changes'; const ORIGIN_HEADER_TEXT = s__('MergeConflict|origin//their changes');
const HEAD_BUTTON_TITLE = 'Use ours'; const HEAD_BUTTON_TITLE = s__('MergeConflict|Use ours');
const ORIGIN_BUTTON_TITLE = 'Use theirs'; const ORIGIN_BUTTON_TITLE = s__('MergeConflict|Use theirs');
const INTERACTIVE_RESOLVE_MODE = 'interactive'; const INTERACTIVE_RESOLVE_MODE = 'interactive';
const EDIT_RESOLVE_MODE = 'edit'; const EDIT_RESOLVE_MODE = 'edit';
const DEFAULT_RESOLVE_MODE = INTERACTIVE_RESOLVE_MODE; const DEFAULT_RESOLVE_MODE = INTERACTIVE_RESOLVE_MODE;
...@@ -173,7 +174,7 @@ import Cookies from 'js-cookie'; ...@@ -173,7 +174,7 @@ import Cookies from 'js-cookie';
getConflictsCountText() { getConflictsCountText() {
const count = this.getConflictsCount(); const count = this.getConflictsCount();
const text = count > 1 ? 'conflicts' : 'conflict'; const text = count > 1 ? s__('MergeConflict|conflicts') : s__('MergeConflict|conflict');
return `${count} ${text}`; return `${count} ${text}`;
}, },
...@@ -348,8 +349,8 @@ import Cookies from 'js-cookie'; ...@@ -348,8 +349,8 @@ import Cookies from 'js-cookie';
}, },
getCommitButtonText() { getCommitButtonText() {
const initial = 'Commit to source branch'; const initial = s__('MergeConflict|Commit to source branch');
const inProgress = 'Committing...'; const inProgress = s__('MergeConflict|Committing...');
return this.state ? (this.state.isSubmitting ? inProgress : initial) : initial; return this.state ? (this.state.isSubmitting ? inProgress : initial) : initial;
}, },
......
...@@ -8,6 +8,7 @@ import './components/diff_file_editor'; ...@@ -8,6 +8,7 @@ import './components/diff_file_editor';
import './components/inline_conflict_lines'; import './components/inline_conflict_lines';
import './components/parallel_conflict_lines'; import './components/parallel_conflict_lines';
import syntaxHighlight from '../syntax_highlight'; import syntaxHighlight from '../syntax_highlight';
import { __ } from '~/locale';
export default function initMergeConflicts() { export default function initMergeConflicts() {
const INTERACTIVE_RESOLVE_MODE = 'interactive'; const INTERACTIVE_RESOLVE_MODE = 'interactive';
...@@ -92,7 +93,7 @@ export default function initMergeConflicts() { ...@@ -92,7 +93,7 @@ export default function initMergeConflicts() {
}) })
.catch(() => { .catch(() => {
mergeConflictsStore.setSubmitState(false); mergeConflictsStore.setSubmitState(false);
createFlash('Failed to save merge conflicts resolutions. Please try again!'); createFlash(__('Failed to save merge conflicts resolutions. Please try again!'));
}); });
}, },
}, },
......
...@@ -4066,6 +4066,9 @@ msgstr "" ...@@ -4066,6 +4066,9 @@ msgstr ""
msgid "Failed to remove user key." msgid "Failed to remove user key."
msgstr "" msgstr ""
msgid "Failed to save merge conflicts resolutions. Please try again!"
msgstr ""
msgid "Failed to save new settings" msgid "Failed to save new settings"
msgstr "" msgstr ""
...@@ -5643,6 +5646,30 @@ msgstr "" ...@@ -5643,6 +5646,30 @@ msgstr ""
msgid "Merge when pipeline succeeds" msgid "Merge when pipeline succeeds"
msgstr "" msgstr ""
msgid "MergeConflict|Commit to source branch"
msgstr ""
msgid "MergeConflict|Committing..."
msgstr ""
msgid "MergeConflict|HEAD//our changes"
msgstr ""
msgid "MergeConflict|Use ours"
msgstr ""
msgid "MergeConflict|Use theirs"
msgstr ""
msgid "MergeConflict|conflict"
msgstr ""
msgid "MergeConflict|conflicts"
msgstr ""
msgid "MergeConflict|origin//their changes"
msgstr ""
msgid "MergeRequests|Add a reply" msgid "MergeRequests|Add a reply"
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