Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,21 @@ const Index = () => {
]
.filter(Boolean)
.join(" ");

return {
address: fullAddress,
latitude: selectedPollingStation.latitude,
longitude: selectedPollingStation.longitude,
const options = {
dialogTitle: t("navigate_to_polling_station.title"),
dialogMessage: t("navigate_to_polling_station.description"),
cancelText: t("navigate_to_polling_station.actions.cancel"),
cancelText: t("navigate_to_polling_station.cancel"),
};

if (selectedPollingStation.latitude && selectedPollingStation.longitude) {
return {
latitude: selectedPollingStation.latitude,
longitude: selectedPollingStation.longitude,
...options,
};
}

return { ...options, address: fullAddress };
}, [selectedPollingStation, visits]);

const handleCopyPollingStationInfo = async () => {
Expand Down
3 changes: 2 additions & 1 deletion mobile/assets/locales/az/translations_AZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"ru": "Rus dili",
"az": "Azərbaycan dili",
"es": "Ispan dili",
"de": "Alman dili"
"de": "Alman dili",
"pt-BR": "Portugali (Braziliya) dili"
},
"onboarding": {
"language": {
Expand Down
3 changes: 2 additions & 1 deletion mobile/assets/locales/bg/translations_BG.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"ru": "руски",
"az": "азербайджански",
"es": "испански",
"de": "немски"
"de": "немски",
"pt-BR": "португалски (Бразилия)"
},
"onboarding": {
"language": {
Expand Down
9 changes: 5 additions & 4 deletions mobile/assets/locales/de/translations_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"ru": "Russisch",
"az": "Aserbaidschanisch",
"es": "Spanisch",
"de": "Deutsch"
"de": "Deutsch",
"pt-BR": "Portugiesisch (Brasilien)"
},
"onboarding": {
"language": {
Expand Down Expand Up @@ -390,9 +391,9 @@
"navigate_to_polling_station": "Zur Wahllokal-Ansicht wechseln"
},
"navigate_to_polling_station": {
"title": "Zum Wahllokal navigieren",
"description": "Wählen Sie eine Karten-App, um eine Wegbeschreibung zum Wahllokal zu erhalten.",
"cancel": "Abbrechen"
"title": "Zum Wahllokal navigieren",
"description": "Wählen Sie eine Karten-App, um eine Wegbeschreibung zum Wahllokal zu erhalten.",
"cancel": "Abbrechen"
}
},
"polling_station_information_form": {
Expand Down
6 changes: 3 additions & 3 deletions mobile/assets/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"ru": "Russian",
"az": "Azerbaijani",
"es": "Spanish",
"de": "German"
"de": "German",
"pt-BR": "Portuguese (Brazil)"
},
"onboarding": {
"language": {
Expand Down Expand Up @@ -463,7 +464,6 @@
"cancel": "Cancel"
}
},

"delete_submission_modal": {
"title": "Delete submission",
"description": {
Expand Down Expand Up @@ -903,4 +903,4 @@
"attachments": "Attachments:",
"notes": "Notes:"
}
}
}
3 changes: 2 additions & 1 deletion mobile/assets/locales/es/translations_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"ru": "Ruso",
"az": "Azerbaiyano",
"es": "Español",
"de": "Alemán"
"de": "Alemán",
"pt-BR": "Portugués (Brasil)"
},
"onboarding": {
"language": {
Expand Down
1,807 changes: 904 additions & 903 deletions mobile/assets/locales/hy/translations_HY.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion mobile/assets/locales/ka/translations_KA.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"ru": "რუსული",
"az": "აზერბაიჯანული",
"es": "ესპანური",
"de": "გერმანული"
"de": "გერმანული",
"pt-BR": "პორტუგალიური (ბრაზილია)"
},
"onboarding": {
"language": {
Expand Down
3 changes: 2 additions & 1 deletion mobile/assets/locales/pl/translations_PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"ru": "rosyjski",
"az": "azerbejdżański",
"es": "hiszpański",
"de": "niemiecki"
"de": "niemiecki",
"pt-BR": "portugalski (Brazylia)"
},
"onboarding": {
"language": {
Expand Down
906 changes: 906 additions & 0 deletions mobile/assets/locales/pt-BR/translations_PT-BR.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion mobile/assets/locales/ro/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"ru": "Rusă",
"az": "Azerbeidjană",
"es": "Spaniolă",
"de": "Germană"
"de": "Germană",
"pt-BR": "Portugheză (Brazilia)"
},
"onboarding": {
"language": {
Expand Down
3 changes: 2 additions & 1 deletion mobile/assets/locales/ru/translations_RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"ru": "Русский язык",
"az": "Азербайджанский язык",
"es": "Испанский язык",
"de": "Немецкий язык"
"de": "Немецкий язык",
"pt-BR": "Португальский (Бразилия)"
},
"onboarding": {
"language": {
Expand Down
3 changes: 2 additions & 1 deletion mobile/assets/locales/sr/translations_SR.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"ru": "ruski",
"az": "azerski",
"es": "španski",
"de": "nemački"
"de": "nemački",
"pt-BR": "portugalski (Brazil)"
},
"onboarding": {
"language": {
Expand Down
6 changes: 4 additions & 2 deletions mobile/common/config/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ru from "../../assets/locales/ru/translations_RU.json";
import az from "../../assets/locales/az/translations_AZ.json";
import es from "../../assets/locales/es/translations_ES.json";
import de from "../../assets/locales/de/translations_DE.json";
import ptBr from "../../assets/locales/pt-BR/translations_PT-BR.json";

import { SECURE_STORAGE_KEYS } from "../constants";
import { getSecureStoreItem } from "../../helpers/SecureStoreWrapper";
Expand All @@ -29,9 +30,9 @@ export const isRTL = language?.textDirection === "rtl";
i18n.use(initReactI18next).init<ResourceLanguage>({
// default language app is currently the system locale or english
lng: systemLocale || "en",
fallbackLng: ["en", "ro", "pl", "bg", "sr", "ka", "hy", "ru", "az", "es", "de"],
fallbackLng: ["en", "ro", "pl", "bg", "sr", "ka", "hy", "ru", "az", "es", "de", "pt-BR"],
compatibilityJSON: "v3",
supportedLngs: ["ro", "en", "pl", "bg", "sr", "ka", "hy", "ru", "az", "es", "de"],
supportedLngs: ["ro", "en", "pl", "bg", "sr", "ka", "hy", "ru", "az", "es", "de", "pt", "pt-BR"],
resources: {
en,
ro,
Expand All @@ -44,6 +45,7 @@ i18n.use(initReactI18next).init<ResourceLanguage>({
az,
es,
de,
'pt-BR': ptBr,
},
debug: true,
interpolation: {
Expand Down
2 changes: 1 addition & 1 deletion mobile/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { StyleProp, TextStyle } from "react-native";
import { TextStyle } from "react-native";
import {
Button as TamaguiButton,
ButtonProps as TamaguiButtonProps,
Expand Down
4 changes: 2 additions & 2 deletions mobile/contexts/language/LanguageContext.provider.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { createContext, useContext } from "react";
import i18n from "../../common/config/i18n";

export type Language = "az" | "bg" | "en" | "es" | "hy" | "ka" | "pl" | "ro" | "ru" | "sr" | "de";
export type Language = "az" | "bg" | "en" | "es" | "hy" | "ka" | "pl" | "ro" | "ru" | "sr" | "de" | "pt-BR";

type LanguageContextType = {
changeLanguage: (language: Language) => void;
};

export const LanguageContext = createContext<LanguageContextType>({
changeLanguage: (_language: Language) => {},
changeLanguage: (_language: Language) => { },
});

const LanguageContextProvider = ({ children }: React.PropsWithChildren) => {
Expand Down
2 changes: 2 additions & 0 deletions mobile/database/DAO/PollingStationsNomenclatorDAO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const addPollingStationsNomenclatureBulk = async (
pollingStation.pollingStationId = node.pollingStationId;
pollingStation.pollingStationNumber = node.number;
pollingStation.parentId = node.parentId || -1;
pollingStation.latitude = node.latitude;
pollingStation.longitude = node.longitude;
}),
);
await database.batch(newNomenclature);
Expand Down
Loading
Loading