Skip to content

Commit

Permalink
Merge pull request #905 from JessicaBarh/plural-translations
Browse files Browse the repository at this point in the history
handle localization of plurals
  • Loading branch information
fcollonval authored Mar 24, 2021
2 parents d026755 + 930bef7 commit 267c149
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/commandsAndMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -716,11 +716,11 @@ export function addCommands(
const extensions = files
.map(file => PathExt.extname(file.to))
.filter(extension => extension.length > 0);
const subject = extensions.length > 1 ? 'extensions' : 'extension';
return trans.__(
'Ignore %1 %2 (add to .gitignore)',
extensions.join(', '),
trans.__(subject)
return trans._n(
'Ignore %2 extension (add to .gitignore)',
'Ignore %2 extensions (add to .gitignore)',
extensions.length,
extensions.join(', ')
);
},
caption: pluralizedContextLabel(
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommitBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class CommitBox extends React.Component<
className={commitButtonClass}
type="button"
title={title}
value="Commit"
value={this.props.trans.__('Commit')}
disabled={disabled}
onClick={this._onCommitSubmit}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/components/TagMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import {
import { tagIcon } from '../style/icons';
import { IGitExtension, Level } from '../tokens';

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

0 comments on commit 267c149

Please sign in to comment.