Skip to content

Commit

Permalink
feat(locale) add Swedish locale
Browse files Browse the repository at this point in the history
  • Loading branch information
ansmonjol committed Oct 12, 2023
1 parent b032f92 commit 6cbc146
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 3 deletions.
1 change: 1 addition & 0 deletions ditto/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@
"text_65251f46339c650084ce0d57": "True",
"text_65251f4cd55aeb004e5aa5ef": "False",
"text_6526cbd3aedb8800aed06c3d": "Spanish",
"text_6526cd088700e000714f0025": "Swedish",
"text_65118a52df984447c1869463": "Assign plan",
"text_65118a52df984447c1869469": "Select a plan to setup the subscription",
"text_65118a52df984447c186940f": "Assign a plan to {{customerName}}",
Expand Down
6 changes: 4 additions & 2 deletions ditto/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ module.exports = {
"es": require('./-wip---customer---customer-portal__es.json'),
"fr": require('./-wip---customer---customer-portal__fr.json'),
"it": require('./-wip---customer---customer-portal__it.json'),
"nb": require('./-wip---customer---customer-portal__nb.json')
"nb": require('./-wip---customer---customer-portal__nb.json'),
"sv": require('./-wip---customer---customer-portal__sv.json')
},
"project_632b49dccdbed9536c8497ab": {
"base": require('./-wip---customers---customer-hold-currency__base.json')
Expand Down Expand Up @@ -166,7 +167,8 @@ module.exports = {
"es": require('./-wip---settings---email-invoices-to-final-customers__es.json'),
"fr": require('./-wip---settings---email-invoices-to-final-customers__fr.json'),
"it": require('./-wip---settings---email-invoices-to-final-customers__it.json'),
"nb": require('./-wip---settings---email-invoices-to-final-customers__nb.json')
"nb": require('./-wip---settings---email-invoices-to-final-customers__nb.json'),
"sv": require('./-wip---settings---email-invoices-to-final-customers__sv.json')
},
"project_63e27c4800ff170963670e71": {
"base": require('./-wip---settings---webhook-debugger__base.json')
Expand Down
57 changes: 57 additions & 0 deletions ditto/sv.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"text_64188b3d9735d5007d712249": "730.00 kr",
"text_64188b3d9735d5007d71225c": "Din faktura från {{organization}} #LAG-1234-567-981",
"text_64188b3d9735d5007d712260": "<[email protected]>",
"text_64188b3d9735d5007d712262": "Till dina kunder",
"text_64188b3d9735d5007d712266": "Faktura från {{organization}}",
"text_64188b3d9735d5007d71226a": "Förfaller 1 sep. 2023",
"text_64188b3d9735d5007d71226c": "Fakturanummer",
"text_64188b3d9735d5007d71226e": "LAG-1234-567-981",
"text_64188b3d9735d5007d712270": "Fakturadatum",
"text_64188b3d9735d5007d712272": "1 sep. 2023",
"text_64188b3d9735d5007d712274": "Ladda ner kreditfakturan för ytterligare information",
"text_64188b3d9735d5007d712276": "Frågor? Kontakta oss på",
"text_64188b3d9735d5007d712278": "Powered by",
"text_64188b3d9735d5007d712271": "Din kreditfaktura från {{organization}} #LAG-1234-567-981-CN001",
"text_64188b3d9735d5007d71227b": "Kreditfaktura från {{organization}}",
"text_64188b3d9735d5007d71227d": "730.00 kr",
"text_64188b3d9735d5007d71227e": "Krediterad till kundens förbetalda kontobalans och återbetald den 1 sep. 2023",
"text_64188b3d9735d5007d71227f": "Kreditfakturanummer",
"text_64188b3d9735d5007d712280": "LAG-1234-567-981-CN001",
"text_64188b3d9735d5007d712281": "Fakturanummer",
"text_64188b3d9735d5007d712282": "LAG-1234-567-981",
"text_64188b3d9735d5007d712283": "Fakturadatum",
"text_64188b3d9735d5007d712284": "1 sep. 2023",
"__variant-name": "Swedish",
"__variant-description": "",
"text_641d6ae1d947c400671e6abb": "Något gick fel",
"text_641d6aee014c8d00c1425cdd": "Uppdatera sidan eller kontakta oss om felet kvarstår.",
"text_641d6b00ef96c1008754734d": "Uppdatera sidan",
"text_641d6b0c5a725b00af12bd76": "Denna faktura kan inte hittas",
"text_641d6b1ae9019c00b59fe250": "Kan du ange ett annat nyckelord?",
"text_6419c64eace749372fc72b03": "Powered by",
"text_6419c64eace749372fc72b07": "Kundinformation",
"text_6419c64eace749372fc72b0b": "Namn ej angivet",
"text_6419c64eace749372fc72b0f": "Namn",
"text_6419c64eace749372fc72b13": "Företagsnamn ej angivet",
"text_6419c64eace749372fc72b17": "Företagsnamn",
"text_6419c64eace749372fc72b23": "E-post ej angivet",
"text_6419c64eace749372fc72b27": "E-post",
"text_6419c64eace749372fc72b2b": "Adress ej angivet",
"text_6419c64eace749372fc72b2f": "Adress",
"text_6419c64eace749372fc72b33": "Sök fakturor",
"text_6419c64eace749372fc72b37": "Fakturahistorik",
"text_6419c64eace749372fc72b3b": "Det finns för närvarande inga fakturor kopplade till denna kund. Återkom vid ett senare tillfälle eller kontakta oss om något inte står rätt till.",
"text_647ddd5220412a009bfd36f4": "Organisationsnummer",
"text_647ddd5f54fefd00c5754bca": "Organisationsnummer ej angivet",
"text_6480a70109b61a005b2092df": "Skatte ID",
"text_6480a707530c5c0053cd11e1": "Skatte ID ej angivet",
"text_6419c64eace749372fc72b39": "Fakturadatum",
"text_6419c64eace749372fc72b3c": "Fakturanummer",
"text_6419c64eace749372fc72b3e": "Belopp",
"text_6419c64eace749372fc72b40": "Betalning",
"text_6419c64eace749372fc72b44": "Obetald",
"text_6419c64eace749372fc72b54": "Betald",
"text_6419c64eace749372fc72b62": "Ladda ner PDF",
"text_641c6acee4bc20004e62c534": "Något gick fel, länken är ogiltig eller har gått ut"
}
2 changes: 1 addition & 1 deletion scripts/MergeTranslationFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { globSync } = require('glob')

const DITTO_DIR = './ditto/'

const AVAILABLE_LOCALES = { en: 'en', fr: 'fr', nb: 'nb', de: 'de', it: 'it', es: 'es' }
const AVAILABLE_LOCALES = { en: 'en', fr: 'fr', nb: 'nb', de: 'de', it: 'it', es: 'es', sv: 'sv' }

async function extract(locale) {
const fileLocaleKey = locale === AVAILABLE_LOCALES.en ? 'base' : locale
Expand Down
1 change: 1 addition & 0 deletions src/core/translations/documentLocales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export const DocumentLocales: documentLocalesType = {
nb: 'Norwegian (Bokmål)',
it: 'Italian',
es: 'Spanish',
sv: 'Swedish',
}
1 change: 1 addition & 0 deletions src/core/translations/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ export enum LocaleEnum {
de = 'de', // German
it = 'it', // Italian
es = 'es', // Spanish
sv = 'sv', // Swedish
}
export type Locale = keyof typeof LocaleEnum
12 changes: 12 additions & 0 deletions src/pages/settings/EmailScenarioConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const mapLanguageKey = (language: LocaleEnum) => {
return 'text_64e4ce3b2fa8940053c8a583'
case LocaleEnum.es:
return 'text_6526cbd3aedb8800aed06c3d'
case LocaleEnum.sv:
return 'text_6526cd088700e000714f0025'
default:
return 'text_6407684eaf41130074c4b2f7'
}
Expand Down Expand Up @@ -232,6 +234,16 @@ const EmailScenarioConfig = () => {
>
{translate(mapLanguageKey(LocaleEnum.es))}
</Button>
<Button
align="left"
variant={invoiceLanguage === LocaleEnum.sv ? 'secondary' : 'quaternary'}
onClick={() => {
closePopper()
setInvoiceLanguage(LocaleEnum.sv)
}}
>
{translate(mapLanguageKey(LocaleEnum.sv))}
</Button>
</MenuPopper>
)}
</Popper>
Expand Down

0 comments on commit 6cbc146

Please sign in to comment.