Skip to content

Commit

Permalink
Add portugese override
Browse files Browse the repository at this point in the history
  • Loading branch information
ArendPeter committed Dec 22, 2024
1 parent 90fc2fc commit 647b9b9
Show file tree
Hide file tree
Showing 5 changed files with 342 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default ({candidates=[], ranked=false} : {candidates?: Candidate[], ranke
});

const incIndex = (arr, index) => {
if(index < 0) return; // Quick Hack to keep the page from crashing
while(index >= arr.length ){
arr.push({
name: arr.length,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default ({topScore, frontRunners, ranked=false, candidates=undefined} : {
const equalPreferences = [];

const incIndex = (arr, index) => {
if(index < 0) return; // Quick Hack to keep the page from crashing
while(index >= arr.length ){
arr.push({
name: arr.length,
Expand Down
5 changes: 3 additions & 2 deletions packages/frontend/src/i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ number:
rank_ordinal_few: "{{count}}rd"
rank_ordinal_other: "{{count}}th"

# Results Example: bettervoting.com/tcvc7r/results
results:
preliminary_title: PRELIMINARY RESULTS
official_title: OFFICIAL RESULTS
Expand Down Expand Up @@ -512,7 +513,7 @@ landing_page:
#### PRIORITY 3 : Extended Results ####
#######################################

# Results page
# Results page (ex. bettervoting.com/tcvc7r/results)
results_ext:
head_to_head_title: Head-to-Head Matchups !tip(head_to_head)

Expand Down Expand Up @@ -606,7 +607,7 @@ tabulation_logs:

# Automatic runoff
automatic_runoff_start: >
Advance to automatic runoff round between {{capital_candidate_a}} and {{candidate_b}}
Advance to automatic runoff round between {{candidate_a}} and {{candidate_b}}
automatic_runoff_win: >
{{winner}} is preferred over {{loser}} by {{winner_votes}} votes to {{loser_votes}}, and {{equal_votes}} voters have an [equal preference](https://www.starvoting.org/equal_preference).
automatic_runoff_tie: >
Expand Down
6 changes: 5 additions & 1 deletion packages/frontend/src/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import LanguageDetector from 'i18next-browser-languagedetector';
import en from './en.yaml';
import ptBR from './pt-BR.yaml';

i18n
// detect user language
// learn more: https://github.com/i18next/i18next-browser-languageDetector
//.use(LanguageDetector)
.use(LanguageDetector)
// pass the i18n instance to react-i18next.
.use(initReactI18next)
// init i18next
Expand All @@ -26,6 +27,9 @@ i18n
en: {
translation: en
},
'pt-BR': {
translation: ptBR
}
}
});

Expand Down
332 changes: 332 additions & 0 deletions packages/frontend/src/i18n/pt-BR.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,332 @@
#######################################################
#### PRIORITY 0 : Core Voting Path + Basic Results ####
#######################################################

# Initial Landing page for voter (ex. https://bettervoting.com/j87vqp/)
election_home:
start_time: '{{capital_election}} begins on {{datetime, datetime}}'
end_time: '{{capital_election}} ends on {{datetime, datetime}}'
ended_time: '{{capital_election}} ended on {{datetime, datetime}}'
vote: Vote
or_view_results: or view results
ballot_submitted: '{{capital_ballot}} Submitted'
view_results: Ver Resultados
drafted: This election is still being drafted
archived: This election has been archived

# Ballot (ex. https://bettervoting.com/j87vqp/vote)
ballot:
this_election_uses: This {{election}} will use {{voting_method}} to elect {{spelled_count}} $t(winner.winner).
instructions_checkbox: I have read the instructions
learn_more: Learn more about {{voting_method}}
previous: Previous
next: Next
submit_ballot: Submit
submitting: Submitting...

dialog_submit_title: Submit {{capital_ballot}}?
dialog_send_receipt: Send Ballot Receipt Email?
dialog_email_placeholder: Receipt Email
dialog_cancel: Cancel
dialog_submit: Submit
warnings:
skipped_rank: Do not skip rankings. Rank candidates in order to clearly show preferences. Candidates left blank are ranked last.
duplicate_rank: Do not rank multiple candidates equally. (Ranking candidates equally can void your ballot.)

methods:
approval:
instruction_bullets:
- Fill in the bubble next to your favorite
- You can select as many {{candidates}} as you like
footer_single_winner: The {{candidate}} with the most votes wins
footer_multi_winner: The {{n}} {{candidates}} with the most votes wins
left_title: ''
right_title: ''
heading_prefix: ''
star_pr:
instruction_bullets:
- Give your favorite(s) five stars.
- Give your last choice(s) zero stars or leave blank.
- Score other {{candidates}} as desired.
- Equal scores indicate equal preference.
footer_single_winner: ''
footer_multi_winner: >
Winners in Proportional STAR Voting are selected in rounds. Each round elects the {{candidate}} with the highest total score,
then designates that {{candidate}}'s strongest supporters as represented. Subsequent rounds include all voters who are not yet
fully represented.
# These show above the star columns
left_title: 'Worst'
right_title: 'Best'
star:
instruction_bullets:
- Give your favorite(s) five stars.
- Give your last choice(s) zero stars or leave blank.
- Score other {{candidates}} as desired.
- Equal scores indicate equal preference.
footer_single_winner: |
The two highest scoring {{candidates}} are finalists.
Your full vote goes to the finalist you prefer.
footer_multi_winner: >
This election uses STAR Voting and will elect {{n}} winners.
In STAR Voting the two highest scoring {{candidates}} are finalists and the finalist preferred by more voters wins.
# These show above the star columns
left_title: 'Worst'
right_title: 'Best'
rcv:
instruction_bullets:
- Rank the {{candidates}} in order of preference. (1st, 2nd, 3rd, etc.)
- Ranking {{candidates}} equally is not allowed.
- '{{capital_candidates}} left blank are ranked last'
footer_single_winner: >
How RCV is counted: Ballots are counted in elimination rounds. In each round, your vote goes to the candidate you ranked highest,
if possible. If no candidate has a majority of remaining votes the candidate with the fewest votes is eliminated.
If your vote is unable to transfer, it will not be counted in later rounds. If a candidate has a majority of remaining votes
in a round, they are elected.
left_title: ''
right_title: ''
ranked_robin:
instruction_bullets:
- Rank the {{candidates}} in order of preference.
- Equal ranks are allowed
- '{{capital_candidates}} left blank are ranked last'
footer_single_winner: |
{{capital_candidates}} are compared in one-on-one match-ups.
A {{candidate}} wins a match-up if they are ranked higher than the opponent by more voters
left_title: ''
right_title: ''
choose_one:
instruction_bullets:
- Fill in the bubble next to your favorite
footer_single_winner: The {{candidate}} with the most votes wins
footer_multi_winner: The {{n}} {{candidates}} with the most votes win
left_title: ''
right_title: ''

# Displayed at the bottom of voter pages (ex. https://bettervoting.com/j87vqp/)
support_blurb: For support on this {{election}} please contact [{{email}}](mailto)

# Share Button dropdown (ex. https://bettervoting.com/pres24/thanks)
share:
button: Share {{capital_election}}
facebook: Facebook
X: X
reddit: Reddit
copy_link: Copy Link
link_copied: Link Copied!

# Number translations (used for {{spelled_count}})
spelled_numbers:
1: one
2: two
3: three
4: four
5: five
6: six
7: seven
8: eight
9: nine
10: ten

# Winner pluralization
winner:
winner_one: winner
winner_other: winners

methods:
star:
full_name: STAR Voting
short_name: STAR Voting
learn_link: https://www.youtube.com/watch?v=fKg0fRL88zc
star_pr:
full_name: Proportional STAR Voting
short_name: STAR PR
learn_link: https://www.starvoting.org/star-pr
approval:
full_name: Approval Voting
short_name: Approval Voting
learn_link: https://www.youtube.com/watch?v=db6Syys2fmE
rcv:
full_name: Ranked Choice Voting
short_name: RCV
learn_link: https://www.youtube.com/watch?v=oHRPMJmzBBw
stv:
full_name: Single Transferable Vote
short_name: STV
learn_link: https://www.youtube.com/watch?v=ItywbxafCk4
ranked_robin:
full_name: Ranked Robin
short_name: Ranked Robin
learn_link: https://www.equal.vote/ranked_robin
choose_one:
full_name: Choose One Plurality
short_name: Choose One

# Confirmation (after you've submitted a ballot)
ballot_submitted:
title: '{{capital_ballot}} Submitted'
description: Thank you for voting!
results: Results
donate: Donate to Equal Vote to support open source voting software
end_time: '{{capital_election}} ends {{date}} at {{time}}'

# Localisation for numbers
number:
rank_ordinal_one: "{{count}}st"
rank_ordinal_two: "{{count}}nd"
rank_ordinal_few: "{{count}}rd"
rank_ordinal_other: "{{count}}th"

# Results Example: bettervoting.com/tcvc7r/results
results:
preliminary_title: PRELIMINARY RESULTS
official_title: OFFICIAL RESULTS
election_title: |
{{capital_election}} Name:
{{title}}
race_title: '{{capital_race}} {{n}}: {{title}}'
single_candidate_result: '{{name}} is the only {{candidate}}, and wins by default'
loading_election: Loading {{capital_election}}...
details: Race Details
additional_info: Stats for Nerds
waiting_for_results: |
Still waiting for results
No votes have been cast
single_vote: |
There's only one vote so far.
Full results will be displayed once there's more votes.
tie_title: 'Tied!'
tiebreak_subtitle: '{{names}} won after tie breaker'
win_title_postfix_one: 'Wins!'
win_title_postfix: 'Win!'
vote_count: '{{n}} voters'
method_context: 'Voting Method: {{voting_method}}'
learn_link_text: How {{voting_method}} works

choose_one:
bar_title: Votes for each {{capital_candidate}}
table_title: Table
table_columns:
- '{{capital_candidate}}'
- Votes
- '% All Votes'

approval:
bar_title: Candidate Approval
table_title: Table
table_columns:
- '{{capital_candidate}}'
- Votes
- '% All Votes'

ranked_robin:
bar_title: Head-to-head wins
table_title: Table
table_columns:
- '{{capital_candidate}}'
- '# Wins'
- Win Rate

rcv:
first_choice_title: First Choice Preferences
final_round_title: Final Runoff
table_title: Ranked Choice Tabulation Rounds
runoff_majority: majority of remaining active votes
exhausted: Exhausted
tabulation_candidate_column: '{{capital_candidate}}'
round_column: Round {{n}}

star:
score_title: Scoring Round
score_description:
- Add the stars from all the ballots.
- The two highest scoring {{candidates}} are the finalists.
runoff_title: Automatic Runoff Round
runoff_description:
- Each vote goes to the voter's preferred finalist.
- Finalist with most votes wins.
runoff_majority: majority of voters with preference
score_table_title: Scores Table
score_table_columns:
- '{{capital_candidate}}'
- Score
runoff_table_title: Runoff Table
runoff_table_columns:
- '{{capital_candidate}}'
- Runoff Votes
- '% Runoff Votes'
- '% Between Finalists'

detailed_steps_title: Tabulation Steps
tiebreaker_note_title: A note on Tiebreakers
tiebreaker_note_text:
- Ties are broken using the [Offical Tiebreaker Protocol](https://starvoting.org/ties) whenever possible.
- Ties are 10 times less likely to occur with STAR Voting than with Choose-One Voting and generally resolve as the number of voters increases.
equal_preferences_title: Distribution of Equal Preferences
equal_preferences: Equal Preferences
score_higher_than_runoff_title: Why is the top scoring candidate different from the winner?
score_higher_than_runoff_text: |
The top-scoring candidate often matches the runoff winner, but not always.
In the runoff, only the most preferred votes count, which can shift the outcome.
For example, a 5 vs. 4-star vote has less impact in scoring but counts fully in the runoff,
while a 5 vs. 0-star vote makes a big difference in scoring but is equal in the runoff.
The runoff winner comes out on top because more voters prefer them over the runner-up.
# Alternate Text:
# The top-scoring candidate usually matches the winner in the runoff, but not always.
# The runoff round counts only the votes for the candidate a voter most prefers, which can lead to different weightings than in the scoring round.
# For example, a slight preference (like 5 vs. 4 stars) has a small impact in scoring but counts as one full vote in the runoff.
# Conversely, a strong preference (like 5 vs. 0 stars) makes a big difference in scoring but carries the same weight in the runoff.
# Ultimately, the runoff winner becomes the final winner because they are preferred by more voters over the runner-up.

star_pr:
chart_title: Round Results
table_title: Results Table
table_columns:
- '{{capital_candidate}}'
round_column: Round {{n}}

keyword:
# Method Terms
star:
preferences: scores
star_pr:
preferences: scores
approval:
preferences: approvals
rcv:
preferences: ranks
stv:
preferences: ranks
ranked_robin:
preferences: ranks
choose_one:
preferences: preferences

# Election vs Poll Terms
election:
election: election
elections: elections
candidate: candidate
candidates: candidates
race: race
ballot: ballot
vote: vote

poll:
election: poll
elections: polls
candidate: option
candidates: options
race: question
ballot: response
vote: response

# General Terms
yes: Yes
no: No

save: Save
cancel: Cancel
submit: Submit

# This is used in tables and charts
total: Total

0 comments on commit 647b9b9

Please sign in to comment.