diff --git a/.vscode/settings.json b/.vscode/settings.json index b3bb1e4..37fb753 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,13 +3,6 @@ "editor.guides.bracketPairs": true, "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.codeActionsOnSave": [ - "source.fixAll.eslint" - ], - "eslint.validate": [ - "javascript", - "javascriptreact", - "typescript", - "vue" - ] -} \ No newline at end of file + "editor.codeActionsOnSave": ["source.fixAll.eslint"], + "eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"] +} diff --git a/package.json b/package.json index 9fe2736..9a916f8 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "bech32-buffer": "^0.2.1", "core-js": "^3.6.5", "cross-fetch": "^3.1.5", + "date-fns": "^2.29.3", "emoji-mart-vue-fast": "^12.0.1", "jdenticon": "^3.2.0", "light-bolt11-decoder": "^2.1.0", @@ -23,7 +24,6 @@ "markdown-it-emoji": "^2.0.2", "markdown-it-sub": "^1.0.0", "markdown-it-sup": "^1.0.0", - "moment": "^2.29.4", "nostr-tools": "^1.1.1", "pinia": "^2.0.11", "pinia-plugin-persistedstate": "^3.0.2", diff --git a/src/boot/i18n.js b/src/boot/i18n.js index e36a6ba..7e6d537 100644 --- a/src/boot/i18n.js +++ b/src/boot/i18n.js @@ -2,13 +2,20 @@ import { boot } from 'quasar/wrappers' import { createI18n } from 'vue-i18n' import messages from 'src/i18n' -export default boot(({ app }) => { - const i18n = createI18n({ - locale: 'en-US', - globalInjection: true, - messages - }) +const [lng = 'en'] = (navigator?.language || '').split('-') +const i18n = createI18n({ + locale: lng, + fallbackLocale: 'en', + globalInjection: true, + messages, +}) + +export default boot(({ app }) => { // Set i18n instance on app app.use(i18n) }) + +const $t = i18n.global.t + +export { $t } diff --git a/src/components/AsyncLoadButton.vue b/src/components/AsyncLoadButton.vue index c3dc02b..829133a 100644 --- a/src/components/AsyncLoadButton.vue +++ b/src/components/AsyncLoadButton.vue @@ -2,7 +2,7 @@
diff --git a/src/components/AsyncLoadLink.vue b/src/components/AsyncLoadLink.vue index 0f620ce..4d3bdc4 100644 --- a/src/components/AsyncLoadLink.vue +++ b/src/components/AsyncLoadLink.vue @@ -2,9 +2,9 @@ @@ -23,19 +23,19 @@ export default defineComponent({ }, label: { type: String, - default: 'Load more' + default: 'Load more', }, labelNoMore: { type: String, - default: 'Try again?' + default: 'Try again?', }, prefix: { type: String, - default: 'Nothing here.' + default: 'Nothing here.', }, prefixNoMore: { type: String, - default: 'Nothing found.' + default: 'Nothing found.', }, hasItems: { type: Boolean, @@ -44,7 +44,7 @@ export default defineComponent({ autoload: { type: Boolean, default: false, - } + }, }, data() { return { @@ -65,7 +65,7 @@ export default defineComponent({ this.loading = false this.$emit('loaded', result) - } + }, }, mounted() { if (this.autoload) { @@ -78,7 +78,7 @@ export default defineComponent({ }, unmounted() { if (this.observer) this.observer.disconnect() - } + }, }) diff --git a/src/components/CreatePost/AutoSizeTextarea.vue b/src/components/CreatePost/AutoSizeTextarea.vue index 842bb75..179051a 100644 --- a/src/components/CreatePost/AutoSizeTextarea.vue +++ b/src/components/CreatePost/AutoSizeTextarea.vue @@ -1,7 +1,7 @@