Updated voting strings for translation

This commit is contained in:
Emanuel Schütze 2020-02-25 10:54:29 +01:00 committed by FinnStutzenstein
parent e72bcc1eaf
commit 2d13519c35
9 changed files with 61 additions and 64 deletions

View File

@ -13,7 +13,7 @@ export interface AssignmentPollTitleInformation {
}
export const AssignmentPollMethodsVerbose = {
votes: 'Fixed Amount of votes for all candidates',
votes: 'Yes per candidate',
YN: 'Yes/No per candidate',
YNA: 'Yes/No/Abstain per candidate'
};

View File

@ -17,7 +17,7 @@
<!-- Detailview for poll -->
<ng-template #viewTemplate>
<ng-container *ngIf="poll">
<h1>{{ poll.title }}</h1>
<h1>{{ poll.title | translate }}</h1>
<div>
<!-- Subtitle -->
@ -25,7 +25,7 @@
<!-- State chip -->
<span>
{{ poll.stateVerbose }}
{{ poll.stateVerbose | translate }}
</span>
</div>

View File

@ -107,7 +107,7 @@ export class MotionPollComponent extends BasePollComponent<ViewMotionPoll> {
public constructor(
titleService: Title,
matSnackBar: MatSnackBar,
translate: TranslateService,
protected translate: TranslateService,
dialog: MatDialog,
promptService: PromptService,
public pollRepo: MotionPollRepositoryService,
@ -123,10 +123,10 @@ export class MotionPollComponent extends BasePollComponent<ViewMotionPoll> {
}
public async deletePoll(): Promise<void> {
const title = 'Delete poll';
const text = 'Do you really want to delete the selected poll?';
const title = this.translate.instant('Are you sure you want to delete this vote?');
const content = this.poll.getTitle();
if (await this.promptService.open(title, text)) {
if (await this.promptService.open(title, content)) {
this.repo.delete(this.poll).catch(this.raiseError);
}
}

View File

@ -116,19 +116,15 @@ export abstract class BasePollDetailComponent<V extends ViewBasePoll> extends Ba
}
public async deletePoll(): Promise<void> {
const title = 'Delete poll';
const text = 'Do you really want to delete the selected poll?';
if (await this.promptService.open(title, text)) {
const title = this.translate.instant('Are you sure you want to delete this vote?');
if (await this.promptService.open(title)) {
this.repo.delete(this.poll).then(() => this.onDeleted(), this.raiseError);
}
}
public async pseudoanonymizePoll(): Promise<void> {
const title = 'Anonymize single votes';
const text = 'Do you really want to anonymize all votes? This cannot be undone.';
if (await this.promptService.open(title, text)) {
const title = this.translate.instant('Are you sure you want to anonymize all votes? This cannot be undone.');
if (await this.promptService.open(title)) {
this.repo.pseudoanonymize(this.poll).then(() => this.onPollLoaded(), this.raiseError); // votes have changed, but not the poll, so the components have to be informed about the update
}
}

View File

@ -36,7 +36,7 @@ export abstract class BasePollComponent<V extends ViewBasePoll> extends BaseView
public constructor(
titleService: Title,
matSnackBar: MatSnackBar,
public translate: TranslateService,
protected translate: TranslateService,
public dialog: MatDialog,
protected promptService: PromptService,
protected repo: BasePollRepositoryService,
@ -47,8 +47,9 @@ export abstract class BasePollComponent<V extends ViewBasePoll> extends BaseView
public async changeState(key: PollState): Promise<void> {
if (key === PollState.Created) {
const title = this.translate.instant('Are you sure you want to reset this poll? All Votes will be lost.');
if (await this.promptService.open(title)) {
const title = this.translate.instant('Are you sure you want to reset this vote?');
const content = this.translate.instant('All votes will be lost.');
if (await this.promptService.open(title, content)) {
this.repo.resetPoll(this._poll).catch(this.raiseError);
}
} else {
@ -64,7 +65,7 @@ export abstract class BasePollComponent<V extends ViewBasePoll> extends BaseView
* Handler for the 'delete poll' button
*/
public async onDeletePoll(): Promise<void> {
const title = this.translate.instant('Are you sure you want to delete this poll?');
const title = this.translate.instant('Are you sure you want to delete this vote?');
if (await this.promptService.open(title)) {
await this.repo.delete(this._poll).catch(this.raiseError);
}

View File

@ -35,10 +35,10 @@ export const PollClassTypeVerbose = {
};
export const PollStateVerbose = {
1: 'Created',
2: 'Started',
3: 'Finished (unpublished)',
4: 'Published'
1: 'created',
2: 'started',
3: 'finished (unpublished)',
4: 'published'
};
export const PollStateChangeActionVerbose = {
@ -49,21 +49,21 @@ export const PollStateChangeActionVerbose = {
};
export const PollTypeVerbose = {
analog: 'Analog voting',
named: 'Named voting',
pseudoanonymous: 'Pseudoanonymous voting'
analog: 'analog',
named: 'nominal',
pseudoanonymous: 'non-nominal'
};
export const PollPropertyVerbose = {
majority_method: 'Required majority',
onehundred_percent_base: '100% base',
type: 'Poll type',
pollmethod: 'Poll method',
type: 'Voting type',
pollmethod: 'Voting method',
state: 'State',
groups: 'Entitled to vote',
votes_amount: 'Amount of votes',
global_no: 'Enable global no',
global_abstain: 'Enable global abstain'
global_no: 'general "No"',
global_abstain: 'general "Abstain"'
};
export const MajorityMethodVerbose = {

View File

@ -30,10 +30,10 @@ export class PollFilterListService extends BaseFilterListService<ViewBasePoll> {
property: 'state',
label: this.translate.instant('State'),
options: [
{ condition: PollState.Created, label: this.translate.instant('Created') },
{ condition: PollState.Started, label: this.translate.instant('Started') },
{ condition: PollState.Finished, label: this.translate.instant('Finished') },
{ condition: PollState.Published, label: this.translate.instant('Published') }
{ condition: PollState.Created, label: this.translate.instant('created') },
{ condition: PollState.Started, label: this.translate.instant('started') },
{ condition: PollState.Finished, label: this.translate.instant('finished (unpublished)') },
{ condition: PollState.Published, label: this.translate.instant('published') }
]
},
{

View File

@ -11,6 +11,20 @@ def get_config_variables():
to be evaluated during app loading (see apps.py).
"""
# Voting
yield ConfigVariable(
name="assignment_poll_method",
default_value="votes",
input_type="choice",
label="Preselected election method",
choices=tuple(
{"value": method[0], "display_name": method[1]}
for method in AssignmentPoll.POLLMETHODS
),
weight=400,
group="Elections",
subgroup="Ballot",
)
yield ConfigVariable(
name="assignment_poll_default_100_percent_base",
default_value="YNA",
@ -20,9 +34,19 @@ def get_config_variables():
{"value": base[0], "display_name": base[1]}
for base in AssignmentPoll.PERCENT_BASES
),
weight=400,
weight=405,
group="Elections",
subgroup="Voting",
subgroup="Ballot",
)
yield ConfigVariable(
name="assignment_poll_default_groups",
default_value=[],
input_type="groups",
label="Default groups with voting rights",
weight=410,
group="Elections",
subgroup="Ballot",
)
yield ConfigVariable(
@ -35,34 +59,10 @@ def get_config_variables():
),
label="Required majority",
help_text="Default method to check whether a candidate has reached the required majority.",
weight=405,
weight=415,
hidden=True,
group="Elections",
subgroup="Voting",
)
yield ConfigVariable(
name="assignment_poll_default_groups",
default_value=[],
input_type="groups",
label="Default groups for named and pseudoanonymous assignment polls",
weight=410,
group="Elections",
subgroup="Voting",
)
yield ConfigVariable(
name="assignment_poll_method",
default_value="votes",
input_type="choice",
label="Preselected poll method",
choices=tuple(
{"value": method[0], "display_name": method[1]}
for method in AssignmentPoll.POLLMETHODS
),
weight=415,
group="Elections",
subgroup="Voting",
subgroup="Ballot",
)
yield ConfigVariable(
@ -72,7 +72,7 @@ def get_config_variables():
label="Put all candidates on the list of speakers",
weight=420,
group="Elections",
subgroup="Voting",
subgroup="Ballot",
)
# Ballot Paper

View File

@ -365,7 +365,7 @@ def get_config_variables():
name="motion_poll_default_groups",
default_value=[],
input_type="groups",
label="Default groups for named and pseudoanonymous motion polls",
label="Default groups with voting rights",
weight=372,
group="Motions",
subgroup="Voting and ballot papers",