diff --git a/.dockerignore b/.dockerignore
index bcbff2b..5fa8b99 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,7 +1,8 @@
-.idea
*.iml
-/vendor/
-/build/
-node_modules/
+.idea
/.php-cs-fixer.cache
+/.php_cs.cache
+/build/
+/vendor/
js/
+node_modules/
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000..a4e6f3b
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,9 @@
+*.iml
+.idea
+/.php-cs-fixer.cache
+/.php_cs.cache
+/build/
+/vendor/
+js/
+node_modules/
+l10n/
diff --git a/.l10nignore b/.l10nignore
new file mode 100644
index 0000000..2ca12bf
--- /dev/null
+++ b/.l10nignore
@@ -0,0 +1,8 @@
+*.iml
+.idea
+/.php-cs-fixer.cache
+/.php_cs.cache
+build/
+vendor/
+js/
+node_modules/
diff --git a/Makefile b/Makefile
index 29c117e..846453c 100644
--- a/Makefile
+++ b/Makefile
@@ -155,10 +155,24 @@ appstore:
../$(app_name)
# Start a nextcloud server on Docker to kickstart developement
-.PHONY: appstore
+.PHONY: dev
dev: build
docker stop repod || true
docker rm repod || true
docker build -t repod .
docker run -itd --name repod -v $(CURDIR):/var/www/html/apps/repod -p 80:80 repod
npm run watch
+
+# Generate translations
+.PHONY: l10n
+l10n:
+ docker run \
+ -v $(CURDIR):/app \
+ --entrypoint php \
+ nextcloudci/translations \
+ /translationtool.phar create-pot-files
+ docker run \
+ -v $(CURDIR):/app \
+ --entrypoint php \
+ nextcloudci/translations \
+ /translationtool.phar convert-po-files
diff --git a/l10n/fr.js b/l10n/fr.js
new file mode 100644
index 0000000..5a84812
--- /dev/null
+++ b/l10n/fr.js
@@ -0,0 +1,23 @@
+OC.L10N.register(
+ "repod",
+ {
+ "Add a RSS link" : "Ajouter un lien RSS",
+ "Could not fetch search results" : "Impossible de récupérer les resultats de la recherche",
+ "Suggests by fyyd" : "Suggestions via fyyd",
+ "Could not fetch tops" : "Impossible de récupérer les tops",
+ "Subscribe" : "S'abonner",
+ "Error while adding the feed" : "Erreur lors de l'ajout du flux",
+ "Play" : "Lecture",
+ "Stop" : "Arrêter",
+ "Could not fetch episodes" : "Impossible de récuprer les épisodes",
+ "Download" : "Télécharger",
+ "Delete" : "Supprimer",
+ "Error while removing the feed" : "Erreur lors de la suppression du flux",
+ "Add a podcast" : "Ajouter un podcast",
+ "Could not fetch subscriptions" : "Impossible de récupérer les flux",
+ "Find a podcast" : "Chercher un podcast",
+ "Error loading feed" : "Erreur lors du chargement du flux",
+ "Missing required app" : "Une application requise est manquante",
+ "Install GPodder Sync" : "Installer GPodder Sync"
+},
+"");
diff --git a/l10n/fr.json b/l10n/fr.json
new file mode 100644
index 0000000..8274593
--- /dev/null
+++ b/l10n/fr.json
@@ -0,0 +1,21 @@
+{ "translations": {
+ "Add a RSS link" : "Ajouter un lien RSS",
+ "Could not fetch search results" : "Impossible de récupérer les resultats de la recherche",
+ "Suggests by fyyd" : "Suggestions via fyyd",
+ "Could not fetch tops" : "Impossible de récupérer les tops",
+ "Subscribe" : "S'abonner",
+ "Error while adding the feed" : "Erreur lors de l'ajout du flux",
+ "Play" : "Lecture",
+ "Stop" : "Arrêter",
+ "Could not fetch episodes" : "Impossible de récuprer les épisodes",
+ "Download" : "Télécharger",
+ "Delete" : "Supprimer",
+ "Error while removing the feed" : "Erreur lors de la suppression du flux",
+ "Add a podcast" : "Ajouter un podcast",
+ "Could not fetch subscriptions" : "Impossible de récupérer les flux",
+ "Find a podcast" : "Chercher un podcast",
+ "Error loading feed" : "Erreur lors du chargement du flux",
+ "Missing required app" : "Une application requise est manquante",
+ "Install GPodder Sync" : "Installer GPodder Sync"
+},"pluralForm" :""
+}
\ No newline at end of file
diff --git a/src/components/Discover/AddRss.vue b/src/components/Discover/AddRss.vue
index 6339ccf..8de881f 100644
--- a/src/components/Discover/AddRss.vue
+++ b/src/components/Discover/AddRss.vue
@@ -1,6 +1,6 @@
-
diff --git a/src/components/Discover/Search.vue b/src/components/Discover/Search.vue
index f5070a4..997423d 100644
--- a/src/components/Discover/Search.vue
+++ b/src/components/Discover/Search.vue
@@ -67,7 +67,7 @@ export default {
}
} catch (e) {
console.error(e)
- showError(t('Could not fetch search results'))
+ showError(t('repod', 'Could not fetch search results'))
} finally {
if (this.feeds) {
this.loading = false
diff --git a/src/components/Discover/TopList.vue b/src/components/Discover/TopList.vue
index 50b2c45..84e5364 100644
--- a/src/components/Discover/TopList.vue
+++ b/src/components/Discover/TopList.vue
@@ -10,7 +10,7 @@
- {{ t('Suggests by fyyd') }}
+ {{ t('repod', 'Suggests by fyyd') }}
@@ -41,7 +41,7 @@ export default {
this.tops = toplist.data
} catch (e) {
console.error(e)
- showError(t('Could not fetch tops'))
+ showError(t('repod', 'Could not fetch tops'))
} finally {
this.loading = false
}
diff --git a/src/components/Feed/Banner.vue b/src/components/Feed/Banner.vue
index e8aa1d6..03be0b1 100644
--- a/src/components/Feed/Banner.vue
+++ b/src/components/Feed/Banner.vue
@@ -15,11 +15,11 @@
- {{ description | stripHTML }}
+ {{ strippedDescription }}
@@ -73,6 +73,11 @@ export default {
isSubscribed() {
return this.$store.state.subscriptions.subscriptions.includes(this.url)
},
+ strippedDescription() {
+ const pre = document.createElement('pre')
+ pre.innerHTML = this.description
+ return pre.textContent || pre.innerText || ''
+ },
},
methods: {
async addSubscription() {
@@ -80,7 +85,7 @@ export default {
await axios.post(generateUrl('/apps/gpoddersync/subscription_change/create'), { add: [this.url], remove: [] })
} catch (e) {
console.error(e)
- showError(t('Error while adding the feed'))
+ showError(t('repod', 'Error while adding the feed'))
}
this.$store.dispatch('subscriptions/fetch')
diff --git a/src/components/Feed/Episodes.vue b/src/components/Feed/Episodes.vue
index 983f568..94b7667 100644
--- a/src/components/Feed/Episodes.vue
+++ b/src/components/Feed/Episodes.vue
@@ -24,13 +24,13 @@
- {{ t('Play') }}
+ {{ t('repod', 'Play') }}
- {{ t('Stop') }}
+ {{ t('repod', 'Stop') }}
@@ -96,7 +96,7 @@ export default {
this.episodes = [...episodes.data].sort((a, b) => a.episodePubDate.date < b.episodePubDate.date)
} catch (e) {
console.error(e)
- showError(t('Could not fetch episodes'))
+ showError(t('repod', 'Could not fetch episodes'))
} finally {
this.loading = false
}
diff --git a/src/components/Feed/Modal.vue b/src/components/Feed/Modal.vue
index 8eea820..1fb854a 100644
--- a/src/components/Feed/Modal.vue
+++ b/src/components/Feed/Modal.vue
@@ -18,7 +18,7 @@
- {{ t('Download') }}
+ {{ t('repod', 'Download') }}
diff --git a/src/components/Player/Infos.vue b/src/components/Player/Infos.vue
index 8d883cd..f24ea2d 100644
--- a/src/components/Player/Infos.vue
+++ b/src/components/Player/Infos.vue
@@ -3,7 +3,7 @@
{{ player.episode.episodeName }}
-
+
{{ player.episode.podcastName }}
@@ -17,6 +17,11 @@ export default {
return this.$store.state.player
},
},
+ methods: {
+ toUrl(url) {
+ return `/${btoa(url)}`
+ },
+ },
}
diff --git a/src/components/Sidebar/Item.vue b/src/components/Sidebar/Item.vue
index 977fa42..ced7c4e 100644
--- a/src/components/Sidebar/Item.vue
+++ b/src/components/Sidebar/Item.vue
@@ -14,7 +14,7 @@
- {{ t('Delete') }}
+ {{ t('repod', 'Delete') }}
@@ -73,7 +73,7 @@ export default {
await axios.post(generateUrl('/apps/gpoddersync/subscription_change/create'), { add: [], remove: [this.url] })
} catch (e) {
console.error(e)
- showError(t('Error while removing the feed'))
+ showError(t('repod', 'Error while removing the feed'))
} finally {
this.loading = false
this.$store.dispatch('subscriptions/fetch')
diff --git a/src/components/Sidebar/Subscriptions.vue b/src/components/Sidebar/Subscriptions.vue
index 13e43da..3b3772d 100644
--- a/src/components/Sidebar/Subscriptions.vue
+++ b/src/components/Sidebar/Subscriptions.vue
@@ -2,7 +2,7 @@
-
+
@@ -55,7 +55,7 @@ export default {
await this.$store.dispatch('subscriptions/fetch')
} catch (e) {
console.error(e)
- showError(t('Could not fetch subscriptions'))
+ showError(t('repod', 'Could not fetch subscriptions'))
} finally {
this.loading = false
}
diff --git a/src/main.js b/src/main.js
index c48ca10..7d5980f 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,4 +1,4 @@
-import { translate, translatePlural } from '@nextcloud/l10n'
+import { translatePlural as n, translate as t } from '@nextcloud/l10n'
import App from './App.vue'
import Vue from 'vue'
import { generateFilePath } from '@nextcloud/router'
@@ -8,17 +8,8 @@ import store from './store/main.js'
// eslint-disable-next-line
__webpack_public_path__ = generateFilePath(appName, '', 'js/')
-const t = (...args) => translate('repod', ...args)
-const n = (...args) => translatePlural('repod', ...args)
-
Vue.mixin({ methods: { t, n } })
-Vue.filter('stripHTML', (value) => {
- const div = document.createElement('div')
- div.innerHTML = value
- return div.textContent || div.innerText || ''
-})
-
export default new Vue({
el: '#content',
router,
diff --git a/src/views/Discover.vue b/src/views/Discover.vue
index 82c9a0a..f70e6f5 100644
--- a/src/views/Discover.vue
+++ b/src/views/Discover.vue
@@ -1,7 +1,7 @@
diff --git a/src/views/Feed.vue b/src/views/Feed.vue
index df7b3a2..4416616 100644
--- a/src/views/Feed.vue
+++ b/src/views/Feed.vue
@@ -1,7 +1,7 @@
-
+
diff --git a/src/views/GPodder.vue b/src/views/GPodder.vue
index 87325a4..4767a32 100644
--- a/src/views/GPodder.vue
+++ b/src/views/GPodder.vue
@@ -1,12 +1,12 @@
-
+
- {{ t('Install GPodder Sync') }}
+ {{ t('repod', 'Install GPodder Sync') }}
diff --git a/translationfiles/fr/repod.po b/translationfiles/fr/repod.po
new file mode 100644
index 0000000..2522557
--- /dev/null
+++ b/translationfiles/fr/repod.po
@@ -0,0 +1,72 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the Nextcloud package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Nextcloud 3.14159\n"
+"Report-Msgid-Bugs-To: translations\\@example.com\n"
+"POT-Creation-Date: 2024-01-10 08:48+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Add a RSS link"
+msgstr "Ajouter un lien RSS"
+
+msgid "Could not fetch search results"
+msgstr "Impossible de récupérer les resultats de la recherche"
+
+msgid "Suggests by fyyd"
+msgstr "Suggestions via fyyd"
+
+msgid "Could not fetch tops"
+msgstr "Impossible de récupérer les tops"
+
+msgid "Subscribe"
+msgstr "S'abonner"
+
+msgid "Error while adding the feed"
+msgstr "Erreur lors de l'ajout du flux"
+
+msgid "Play"
+msgstr "Lecture"
+
+msgid "Stop"
+msgstr "Arrêter"
+
+msgid "Could not fetch episodes"
+msgstr "Impossible de récuprer les épisodes"
+
+msgid "Download"
+msgstr "Télécharger"
+
+msgid "Delete"
+msgstr "Supprimer"
+
+msgid "Error while removing the feed"
+msgstr "Erreur lors de la suppression du flux"
+
+msgid "Add a podcast"
+msgstr "Ajouter un podcast"
+
+msgid "Could not fetch subscriptions"
+msgstr "Impossible de récupérer les flux"
+
+msgid "Find a podcast"
+msgstr "Chercher un podcast"
+
+msgid "Error loading feed"
+msgstr "Erreur lors du chargement du flux"
+
+msgid "Missing required app"
+msgstr "Une application requise est manquante"
+
+msgid "Install GPodder Sync"
+msgstr "Installer GPodder Sync"
diff --git a/translationfiles/templates/repod.pot b/translationfiles/templates/repod.pot
new file mode 100644
index 0000000..8e69923
--- /dev/null
+++ b/translationfiles/templates/repod.pot
@@ -0,0 +1,110 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the Nextcloud package.
+# FIRST AUTHOR , YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Nextcloud 3.14159\n"
+"Report-Msgid-Bugs-To: translations\\@example.com\n"
+"POT-Creation-Date: 2024-01-10 14:22+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: /app/specialAppInfoFakeDummyForL10nScript.php:2
+msgid "RePod"
+msgstr ""
+
+#: /app/specialAppInfoFakeDummyForL10nScript.php:3
+msgid "🔊 Browse, manage and listen to podcasts"
+msgstr ""
+
+#: /app/specialAppInfoFakeDummyForL10nScript.php:4
+msgid ""
+"# Features\n"
+"- 🔍 Browse and subscribe huge collection of podcasts\n"
+"- 🔊 Listen to episodes directly in Nextcloud\n"
+"- 🌐 Sync your activity with [AntennaPod](https://antennapod.org/)\n"
+"\n"
+"# Requirements\n"
+"You need to have [GPodderSync](https://apps.nextcloud.com/apps/gpoddersync) "
+"installed to use this app!"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:1
+msgid "Add a RSS link"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:2
+msgid "Could not fetch search results"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:3
+msgid "Suggests by fyyd"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:4
+msgid "Could not fetch tops"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:5
+msgid "Subscribe"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:6
+msgid "Error while adding the feed"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:7
+msgid "Play"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:8
+msgid "Stop"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:9
+msgid "Could not fetch episodes"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:10
+msgid "Download"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:11
+msgid "Delete"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:12
+msgid "Error while removing the feed"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:13
+msgid "Add a podcast"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:14
+msgid "Could not fetch subscriptions"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:15
+msgid "Find a podcast"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:16
+msgid "Error loading feed"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:17
+msgid "Missing required app"
+msgstr ""
+
+#: /app/specialVueFakeDummyForL10nScript.js:18
+msgid "Install GPodder Sync"
+msgstr ""