Skip to content

Commit 267c149

Browse files
authored
Merge pull request #905 from JessicaBarh/plural-translations
handle localization of plurals
2 parents d026755 + 930bef7 commit 267c149

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/commandsAndMenu.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -716,11 +716,11 @@ export function addCommands(
716716
const extensions = files
717717
.map(file => PathExt.extname(file.to))
718718
.filter(extension => extension.length > 0);
719-
const subject = extensions.length > 1 ? 'extensions' : 'extension';
720-
return trans.__(
721-
'Ignore %1 %2 (add to .gitignore)',
722-
extensions.join(', '),
723-
trans.__(subject)
719+
return trans._n(
720+
'Ignore %2 extension (add to .gitignore)',
721+
'Ignore %2 extensions (add to .gitignore)',
722+
extensions.length,
723+
extensions.join(', ')
724724
);
725725
},
726726
caption: pluralizedContextLabel(

src/components/CommitBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class CommitBox extends React.Component<
125125
className={commitButtonClass}
126126
type="button"
127127
title={title}
128-
value="Commit"
128+
value={this.props.trans.__('Commit')}
129129
disabled={disabled}
130130
onClick={this._onCommitSubmit}
131131
/>

src/components/TagMenu.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import {
1919
import { tagIcon } from '../style/icons';
2020
import { IGitExtension, Level } from '../tokens';
2121

22-
const CHANGES_ERR_MSG =
23-
'The repository contains files with uncommitted changes. Please commit or discard these changes before switching to a tag.';
2422
const ITEM_HEIGHT = 24.8; // HTML element height for a single branch
2523
const MIN_HEIGHT = 150; // Minimal HTML element height for the tags list
2624
const MAX_HEIGHT = 400; // Maximal HTML element height for the tags list
@@ -297,7 +295,9 @@ export class TagMenu extends React.Component<ITagMenuProps, ITagMenuState> {
297295
if (!self.props.branching) {
298296
showErrorMessage(
299297
self.props.trans.__('Checkout tags is disabled'),
300-
self.props.trans.__(CHANGES_ERR_MSG)
298+
self.props.trans.__(
299+
'The repository contains files with uncommitted changes. Please commit or discard these changes before switching to a tag.'
300+
)
301301
);
302302
return;
303303
}

0 commit comments

Comments
 (0)