Skip to content
Merged
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
6 changes: 6 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5017,13 +5017,19 @@ const CONST = {
CAD: 'CA',
GBP: 'GB',
AUD: 'AU',
NOK: 'NO',
SEK: 'SE',
ZAR: 'ZA',
},
// Unit each country publishes its rates in
GOVERNMENT_RATE_COUNTRY_TO_UNIT: {
US: 'mi',
GB: 'mi',
CA: 'km',
AU: 'km',
NO: 'km',
SE: 'km',
ZA: 'km',
},
FAKE_P2P_ID: '_FAKE_P2P_ID_',
UNSET_DISTANCE_RATE_ID: '-1',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7637,7 +7637,7 @@ Der Control-Tarif beginnt bei 9 $ pro aktivem Mitglied und Monat.`,
autoGeneratedRateTooltip: 'Dieser Satz wurde automatisch erzeugt.',
autoUpdateGovernmentRate: 'Regierungssätze automatisch aktualisieren',
autoUpdateGovernmentRateDescription: (countryPhrase: string) => `Neue Sätze automatisch erstellen, wenn ${countryPhrase} neue Richtlinien veröffentlicht.`,
governmentRateCountries: {US: 'die Vereinigten Staaten', CA: 'Kanada', GB: 'Großbritannien', AU: 'Australien'},
governmentRateCountries: {US: 'die Vereinigten Staaten', CA: 'Kanada', GB: 'Großbritannien', AU: 'Australien', NO: 'Norwegen', SE: 'Schweden', ZA: 'Südafrika'},
},
editor: {
descriptionInputLabel: 'Beschreibung',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/el.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7930,7 +7930,7 @@ _Για πιο αναλυτικές οδηγίες, [επισκεφθείτε τ
autoGeneratedRateTooltip: 'Αυτός ο συντελεστής δημιουργείται αυτόματα.',
autoUpdateGovernmentRate: 'Αυτόματη ενημέρωση κρατικών συντελεστών',
autoUpdateGovernmentRateDescription: (countryPhrase: string) => `Δημιουργείτε αυτόματα νέες τιμές όταν η ${countryPhrase} δημοσιεύει νέες οδηγίες.`,
governmentRateCountries: {US: 'οι Ηνωμένες Πολιτείες', CA: 'Καναδάς', GB: 'Μεγάλη Βρετανία', AU: 'Αυστραλία'},
governmentRateCountries: {US: 'οι Ηνωμένες Πολιτείες', CA: 'Καναδάς', GB: 'Μεγάλη Βρετανία', AU: 'Αυστραλία', NO: 'Νορβηγία', SE: 'Σουηδία', ZA: 'Νότια Αφρική'},
},
editor: {
descriptionInputLabel: 'Περιγραφή',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7983,6 +7983,9 @@ const translations = {
CA: 'Canada',
GB: 'Great Britain',
AU: 'Australia',
NO: 'Norway',
SE: 'Sweden',
ZA: 'South Africa',
},
errors: {
rateNameRequired: 'Rate name is required',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7656,7 +7656,7 @@ El plan Controlar empieza en 9 $ por miembro activo al mes.`,
autoGeneratedRateTooltip: 'Esta tasa se genera automáticamente.',
autoUpdateGovernmentRate: 'Actualizar automáticamente las tasas gubernamentales',
autoUpdateGovernmentRateDescription: (countryPhrase: string) => `Crea automáticamente nuevas tasas cuando ${countryPhrase} publique nuevas directrices.`,
governmentRateCountries: {US: 'Estados Unidos', CA: 'Canadá', GB: 'Gran Bretaña', AU: 'Australia'},
governmentRateCountries: {US: 'Estados Unidos', CA: 'Canadá', GB: 'Gran Bretaña', AU: 'Australia', NO: 'Noruega', SE: 'Suecia', ZA: 'Sudáfrica'},
},
editor: {
nameInputLabel: 'Nombre',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7658,7 +7658,7 @@ Le forfait Control commence à 9 $ par Membre actif et par mois.`,
autoGeneratedRateTooltip: 'Ce taux est généré automatiquement.',
autoUpdateGovernmentRate: 'Mettre automatiquement à jour les taux gouvernementaux',
autoUpdateGovernmentRateDescription: (countryPhrase: string) => `Créer automatiquement de nouveaux taux lorsque ${countryPhrase} publie de nouvelles directives.`,
governmentRateCountries: {US: 'les États-Unis', CA: 'Canada', GB: 'Grande-Bretagne', AU: 'Australie'},
governmentRateCountries: {US: 'les États-Unis', CA: 'Canada', GB: 'Grande-Bretagne', AU: 'Australie', NO: 'Norvège', SE: 'Suède', ZA: 'Afrique du Sud'},
},
editor: {
descriptionInputLabel: 'Description',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7594,7 +7594,7 @@ Il piano Control parte da 9 $ al mese per ogni membro attivo.`,
autoGeneratedRateTooltip: 'Questa tariffa è generata automaticamente.',
autoUpdateGovernmentRate: 'Aggiorna automaticamente le aliquote governative',
autoUpdateGovernmentRateDescription: (countryPhrase: string) => `Crea automaticamente nuove aliquote quando ${countryPhrase} pubblica nuove linee guida.`,
governmentRateCountries: {US: 'gli Stati Uniti', CA: 'Canada', GB: 'Gran Bretagna', AU: 'Australia'},
governmentRateCountries: {US: 'gli Stati Uniti', CA: 'Canada', GB: 'Gran Bretagna', AU: 'Australia', NO: 'Norvegia', SE: 'Svezia', ZA: 'Sudafrica'},
},
editor: {
descriptionInputLabel: 'Descrizione',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7502,7 +7502,7 @@ Control プランは、アクティブメンバー1人あたり月額 $9 から
autoGeneratedRateTooltip: 'このレートは自動生成されています。',
autoUpdateGovernmentRate: '政府レートを自動更新',
autoUpdateGovernmentRateDescription: (countryPhrase: string) => `${countryPhrase} が新しいガイダンスを公表したときに、新しいレートを自動的に作成します。`,
governmentRateCountries: {US: 'アメリカ合衆国', CA: 'カナダ', GB: 'グレートブリテン', AU: 'オーストラリア'},
governmentRateCountries: {US: 'アメリカ合衆国', CA: 'カナダ', GB: 'グレートブリテン', AU: 'オーストラリア', NO: 'ノルウェー', SE: 'スウェーデン', ZA: '南アフリカ'},
},
editor: {
descriptionInputLabel: '説明',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7575,7 +7575,7 @@ Het Control-abonnement begint bij $9 per actieve deelnemer per maand.`,
autoGeneratedRateTooltip: 'Dit tarief is automatisch gegenereerd.',
autoUpdateGovernmentRate: 'Overheidspercentages automatisch bijwerken',
autoUpdateGovernmentRateDescription: (countryPhrase: string) => `Maak automatisch nieuwe tarieven aan wanneer ${countryPhrase} nieuwe richtlijnen publiceert.`,
governmentRateCountries: {US: 'de Verenigde Staten', CA: 'Canada', GB: 'Groot-Brittannië', AU: 'Australië'},
governmentRateCountries: {US: 'de Verenigde Staten', CA: 'Canada', GB: 'Groot-Brittannië', AU: 'Australië', NO: 'Noorwegen', SE: 'Zweden', ZA: 'Zuid-Afrika'},
},
editor: {
descriptionInputLabel: 'Beschrijving',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7599,7 +7599,7 @@ Plan Control zaczyna się od 9 USD za aktywnego członka miesięcznie.`,
autoGeneratedRateTooltip: 'Ta stawka jest generowana automatycznie.',
autoUpdateGovernmentRate: 'Automatycznie aktualizuj stawki rządowe',
autoUpdateGovernmentRateDescription: (countryPhrase: string) => `Automatycznie twórz nowe stawki, gdy ${countryPhrase} publikuje nowe wytyczne.`,
governmentRateCountries: {US: 'Stany Zjednoczone', CA: 'Kanada', GB: 'Wielka Brytania', AU: 'Australia'},
governmentRateCountries: {US: 'Stany Zjednoczone', CA: 'Kanada', GB: 'Wielka Brytania', AU: 'Australia', NO: 'Norwegia', SE: 'Szwecja', ZA: 'Republika Południowej Afryki'},
},
editor: {
descriptionInputLabel: 'Opis',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7581,7 +7581,7 @@ O plano Control começa em US$ 9 por membro ativo por mês.`,
autoGeneratedRateTooltip: 'Essa tarifa é gerada automaticamente.',
autoUpdateGovernmentRate: 'Atualizar automaticamente taxas governamentais',
autoUpdateGovernmentRateDescription: (countryPhrase: string) => `Crie automaticamente novas taxas quando ${countryPhrase} publicar novas orientações.`,
governmentRateCountries: {US: 'Estados Unidos', CA: 'Canadá', GB: 'Grã-Bretanha', AU: 'Austrália'},
governmentRateCountries: {US: 'Estados Unidos', CA: 'Canadá', GB: 'Grã-Bretanha', AU: 'Austrália', NO: 'Noruega', SE: 'Suécia', ZA: 'África do Sul'},
},
editor: {
descriptionInputLabel: 'Descrição',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7316,7 +7316,7 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
autoGeneratedRateTooltip: '此费率为自动生成。',
autoUpdateGovernmentRate: '自动更新政府费率',
autoUpdateGovernmentRateDescription: (countryPhrase: string) => `当${countryPhrase}发布新指引时自动创建新费率。`,
governmentRateCountries: {US: '美国', CA: '加拿大', GB: '英国', AU: '澳大利亚'},
governmentRateCountries: {US: '美国', CA: '加拿大', GB: '英国', AU: '澳大利亚', NO: '挪威', SE: '瑞典', ZA: '南非'},
},
editor: {
descriptionInputLabel: '描述',
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/PolicyDistanceRatesUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ describe('PolicyDistanceRatesUtils', () => {
expect(getGovernmentRateCountryForCurrency('CAD')).toBe('CA');
expect(getGovernmentRateCountryForCurrency('GBP')).toBe('GB');
expect(getGovernmentRateCountryForCurrency('AUD')).toBe('AU');
expect(getGovernmentRateCountryForCurrency('NOK')).toBe('NO');
expect(getGovernmentRateCountryForCurrency('SEK')).toBe('SE');
expect(getGovernmentRateCountryForCurrency('ZAR')).toBe('ZA');
});

it('should return undefined for an unsupported or missing currency', () => {
Expand All @@ -154,6 +157,9 @@ describe('PolicyDistanceRatesUtils', () => {
expect(isCurrencySupportedForAutoUpdate('CAD')).toBe(true);
expect(isCurrencySupportedForAutoUpdate('GBP')).toBe(true);
expect(isCurrencySupportedForAutoUpdate('AUD')).toBe(true);
expect(isCurrencySupportedForAutoUpdate('NOK')).toBe(true);
expect(isCurrencySupportedForAutoUpdate('SEK')).toBe(true);
expect(isCurrencySupportedForAutoUpdate('ZAR')).toBe(true);
expect(isCurrencySupportedForAutoUpdate('NZD')).toBe(false);
expect(isCurrencySupportedForAutoUpdate(undefined)).toBe(false);
});
Expand All @@ -165,6 +171,9 @@ describe('PolicyDistanceRatesUtils', () => {
expect(getExpectedUnitForCurrency('GBP')).toBe('mi');
expect(getExpectedUnitForCurrency('CAD')).toBe('km');
expect(getExpectedUnitForCurrency('AUD')).toBe('km');
expect(getExpectedUnitForCurrency('NOK')).toBe('km');
expect(getExpectedUnitForCurrency('SEK')).toBe('km');
expect(getExpectedUnitForCurrency('ZAR')).toBe('km');
});

it('should return undefined for an unsupported currency', () => {
Expand Down
Loading