Skip to content

Commit

Permalink
Enable italian
Browse files Browse the repository at this point in the history
  • Loading branch information
karlomikus committed Aug 25, 2024
1 parent a203208 commit 92102dd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v2.18.0
## New
- Enabled Italian language

## Changes
- Updated base docker image to alpine 3.20

# v2.17.2
## Fixes
- Fix substitute ingredient showing null amounts as `1`
Expand Down
25 changes: 25 additions & 0 deletions src/locales/it-IT.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import messages from './messages/it-IT.json'

const datetime = {
'short': {
'year': 'numeric',
'month': 'short',
'day': 'numeric'
},
'long': {
'year': 'numeric',
'month': 'short',
'day': 'numeric',
'weekday': 'short',
'hour': 'numeric',
'minute': 'numeric'
}
}

const numbers = {
decimal: {
style: 'decimal', minimumFractionDigits: 2, maximumFractionDigits: 2
}
}

export default { messages, datetime, numbers }
1 change: 1 addition & 0 deletions src/locales/messages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"hr-HR": "Croatian",
"de-DE": "German",
"pl-PL": "Polish",
"it-IT": "Italian",
"help": "Help with translations"
},
"shelf": {
Expand Down
4 changes: 4 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import hr_HR from './locales/hr-HR'
import fr_FR from './locales/fr-FR'
import de_DE from './locales/de-DE'
import pl_PL from './locales/pl-PL'
import it_IT from './locales/it-IT'

registerSW({ immediate: true })
registerSwiperElements()
Expand Down Expand Up @@ -55,20 +56,23 @@ const i18n = createI18n({
'fr-FR': fr_FR.numbers,
'de-DE': de_DE.numbers,
'pl-PL': pl_PL.numbers,
'it-IT': it_IT.numbers,
},
datetimeFormats: {
'en-US': en_US.datetime,
'hr-HR': hr_HR.datetime,
'fr-FR': fr_FR.datetime,
'de-DE': de_DE.datetime,
'pl-PL': pl_PL.datetime,
'it-IT': it_IT.datetime,
},
messages: {
'en-US': en_US.messages,
'hr-HR': hr_HR.messages,
'fr-FR': fr_FR.messages,
'de-DE': de_DE.messages,
'pl-PL': pl_PL.messages,
'it-IT': it_IT.messages,
}
})

Expand Down

0 comments on commit 92102dd

Please sign in to comment.