Skip to content

Commit

Permalink
Spanish localizations (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
katherinejensen00 authored Nov 20, 2024
2 parents a378133 + 7a7793d commit e11e1cf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ globalThis.webViewComponent = function TextCollectionWebView({
const selectProjectsPromptKey = '%textCollection_dialog_selectProjectsToShow_prompt%';
const selectProjectsKey = '%webview_selectProjects%';
const textCollectionKey = '%textCollection_defaultTitle%';
const [localizedStrings] = useLocalizedStrings([
selectProjectsTitleKey,
selectProjectsPromptKey,
selectProjectsKey,
textCollectionKey,
]);
const [localizedStrings] = useLocalizedStrings(
useMemo(
() => [selectProjectsTitleKey, selectProjectsPromptKey, selectProjectsKey, textCollectionKey],
[selectProjectsTitleKey, selectProjectsPromptKey, selectProjectsKey, textCollectionKey],
),
);
const localizedSelectProjectsTitle = localizedStrings[selectProjectsTitleKey];
const localizedSelectProjectsPrompt = localizedStrings[selectProjectsPromptKey];
const localizedSelectProjects = localizedStrings[selectProjectsKey];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
"%mainMenu_openWordList%": "Open Word List",
"%wordList_cloudView_label%": "Cloud",
"%wordList_filter_defaultText%": "Word filter",
"%wordList_fullWordCount_titleFormat%": "Words ({fullWordCount}) \\{sortingDirectionIcon\\}",
"%wordList_fullWordCount_titleFormat%": "Words ({fullWordCount}) {sortingDirectionIcon}",
"%wordList_openListForProject_prompt%": "Please select project to open in the word list:",
"%wordList_openListForProject_title%": "Open Word List",
"%wordList_partialWordCount_titleFormat%": "Words ({wordListLength} of {fullWordCount}) {sortingDirectionIcon}",
"%wordList_totalCount_titleFormat%": "Words ({fullWordCount})",
"%wordList_tableView_label%": "Table",
"%wordList_title_format%": "Word List {projectName}",
"%wordList_titleWithProjectName_format%": "Word List for project {projectName}",
Expand All @@ -20,11 +19,10 @@
"%mainMenu_openWordList%": "Abrir Lista de Palabras",
"%wordList_cloudView_label%": "Nube",
"%wordList_filter_defaultText%": "Filtro de palabra",
"%wordList_fullWordCount_titleFormat%": "Palabras ({fullWordCount}) \\{sortingDirectionIcon\\}",
"%wordList_fullWordCount_titleFormat%": "Palabras ({fullWordCount}) {sortingDirectionIcon}",
"%wordList_openListForProject_prompt%": "Por favor, seleccione proyecto para abrir en la lista de palabras:",
"%wordList_openListForProject_title%": "Abrir Lista de Palabras",
"%wordList_partialWordCount_titleFormat%": "Palabras ({wordListLength} de {fullWordCount}) {sortingDirectionIcon}",
"%wordList_totalCount_titleFormat%": "Palabras ({fullWordCount})",
"%wordList_tableView_label%": "Tabla",
"%wordList_title_format%": "Lista de Palabras {projectName}",
"%wordList_titleWithProjectName_format%": "Lista de Palabras para el proyecto {projectName}",
Expand Down
7 changes: 5 additions & 2 deletions src/paratext-bible-word-list/src/word-table.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type WordTableProps = {
};

const countFormatKey = '%wordList_wordCount_format%';
const fullCountFormatKey = '%wordList_totalCount_titleFormat%';
const fullCountFormatKey = '%wordList_fullWordCount_titleFormat%';
const partialCountFormatKey = '%wordList_partialWordCount_titleFormat%';

const getSortingIcon = (sortDirection: false | SortDirection): string => {
Expand Down Expand Up @@ -78,7 +78,10 @@ export default function WordTable({ wordList, fullWordCount, onWordClick }: Word

const wordColumnTitleFormat = useMemo(() => {
return wordList.length === fullWordCount
? formatReplacementString(localizedFullCountFormat, { fullWordCount })
? formatReplacementString(localizedFullCountFormat, {
fullWordCount,
sortingDirectionIcon: '{sortingDirectionIcon}',
})
: formatReplacementString(localizedPartialCountFormat, {
wordListLength: wordList.length,
fullWordCount,
Expand Down

0 comments on commit e11e1cf

Please sign in to comment.