diff --git a/client/src/components/HandMarkedPaperBallot.tsx b/client/src/components/HandMarkedPaperBallot.tsx index a8fb945..d8ccd6b 100644 --- a/client/src/components/HandMarkedPaperBallot.tsx +++ b/client/src/components/HandMarkedPaperBallot.tsx @@ -17,8 +17,11 @@ import { VotesDict, withLocale, YesNoContest, + LocaleMap, } from '@votingworks/ballot-encoder' +import defaultBallotTranslationStrings from '../data/defaultBallotTranslationStrings.json' + import AppContext from '../contexts/AppContext' import { DEFAULT_LOCALE } from '../config/globals' @@ -38,6 +41,10 @@ import Prose from './Prose' import Text from './Text' import HorizontalRule from './HorizontalRule' +const defaultBallotStrings = defaultBallotTranslationStrings as LocaleMap<{ + [key: string]: string +}> + const localeDateLong = (dateString: string, locale: string) => moment(new Date(dateString)).locale(locale).format('LL') @@ -393,9 +400,15 @@ const HandMarkedPaperBallot = ({ const localeElection: OptionalElection = secondaryLocaleCode ? withLocale(election, secondaryLocaleCode) : undefined - i18n.addResources(DEFAULT_LOCALE, '', election.ballotStrings) + i18n.addResources(DEFAULT_LOCALE, 'translation', { + ...defaultBallotStrings[DEFAULT_LOCALE], + ...election.ballotStrings, + }) if (localeElection) { - i18n.addResources(secondaryLocaleCode, '', localeElection.ballotStrings) + i18n.addResources(secondaryLocaleCode, 'translation', { + ...defaultBallotStrings[secondaryLocaleCode], + ...localeElection.ballotStrings, + }) } const primaryPartyName = getPartyFullNameFromBallotStyle({ ballotStyleId, diff --git a/client/src/data/defaultBallotTranslationStrings.json b/client/src/data/defaultBallotTranslationStrings.json new file mode 100644 index 0000000..06f5d43 --- /dev/null +++ b/client/src/data/defaultBallotTranslationStrings.json @@ -0,0 +1,52 @@ +{ + "en-US": { + "Official Ballot": "Official Ballot", + "TEST BALLOT": "TEST BALLOT", + "Yes": "Yes", + "No": "No", + "Precinct": "Precinct", + "Style": "Style", + "Page": "Page", + "Pages": "Pages", + "{{primaryPartyName}} {{electionTitle}}": "{{primaryPartyName}} {{electionTitle}}", + "write-in": "write-in", + "Vote for 1": "Vote for 1", + "Vote for not more than {{ seats }}": "Vote for not more than {{ seats }}", + "voteYesOrNo": "Vote Yes or No", + "Instructions": "Instructions", + "To vote, use a black pen to completely fill in the oval to the left of your choice.": "To vote, use a black pen to completely fill in the oval to the left of your choice.", + "To Vote for a Write-In": "To Vote for a Write-In", + "To vote for a person not on the ballot, completely fill in the oval to the left of the “write-in” line and print the person’s name on the line.": "To vote for a person not on the ballot, completely fill in the oval to the left of the “write-in” line and print the person’s name on the line.", + "To correct a mistake": "To correct a mistake", + "To make a correction, please ask for a replacement ballot. Any marks other than filled ovals may cause your ballot not to be counted.": "To make a correction, please ask for a replacement ballot. Any marks other than filled ovals may cause your ballot not to be counted.", + "Thank you for voting.": "Thank you for voting.", + "You have reached the end of the ballot. Please review your ballot selections.": "You have reached the end of the ballot. Please review your ballot selections." + }, + "es-US": { + "Official Ballot": "Boleta Oficial", + "TEST BALLOT": "BOLETA DE PRUEBA", + "Yes": "Sí", + "No": "No", + "Precinct": "Recinto", + "Style": "Estilo", + "Page": "Página", + "Pages": "Paginas", + "{{primaryPartyName}} {{electionTitle}}": "{{electionTitle}} del {{primaryPartyName}}", + "write-in": "voto por", + "Vote for 1": "Voto por 1", + "Vote for not more than {{ seats }}": "Voto por no más de {{ seats }}", + "voteYesOrNo": "Voto o No", + "Instructions": "Instrucciones", + "To vote, use a black pen to completely fill in the oval to the left of your choice.": "Para votar, use un bolígrafo negro para rellenar completamente el óvalo a la izquierda de su selección.", + "To Vote for a Write-In": "Para asignar un voto", + "To vote for a person not on the ballot, completely fill in the oval to the left of the “write-in” line and print the person's name on the line.": "Para votar para una persona que no figura en la boleta electoral, rellena completamente el óvalo a la izquierda de la línea de “voto por” y escriba el nombre de la persona en la línea.", + "To correct a mistake": "Para corregir un error", + "To make a correction, please ask for a replacement ballot. Any marks other than filled ovals may cause your ballot not to be counted.": "Para hacer una corrección, solicite una boleta nueva. Cualquier marca que no sea óvalos llenos puede hacer que su boleta no se cuente.", + "Thank you for voting.": "Gracias por votar.", + "You have reached the end of the ballot. Please review your ballot selections.": "Ha llegado al final de la votación. Por favor revise las opciones seleccionadas en su boleta." + }, + "other": { + "write-in (description)": "voto por", + "write-in (action)": "Nomino y voto por" + } +}