From 0ba7239ab5d2234c5e8ff4e353d9f7eff16a1d36 Mon Sep 17 00:00:00 2001 From: KonPol05 Date: Mon, 12 Jan 2026 17:54:13 +0200 Subject: [PATCH 1/2] Added .json for greek and handled the logic so it can be used --- src/auth.ts | 5 +- src/components/TopMenu.tsx | 1 + src/i18n/config.ts | 3 + src/i18n/locales/el/translation.json | 91 ++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 src/i18n/locales/el/translation.json diff --git a/src/auth.ts b/src/auth.ts index 039b35f..9718177 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -50,9 +50,12 @@ function base64urlencode(arrayBuffer: ArrayBuffer): string { return btoa(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "") } +// Prefer an explicit redirect URI if provided (must match Spotify app allowlist) +const EXPLICIT_REDIRECT_URI = process.env.REACT_APP_REDIRECT_URI + // Get the redirect URI for the current location function getRedirectUri(): string { - return [window.location.protocol, '//', window.location.host, window.location.pathname].join('') + return EXPLICIT_REDIRECT_URI || `${window.location.origin}${window.location.pathname}` } // Initiate Spotify OAuth authorization flow diff --git a/src/components/TopMenu.tsx b/src/components/TopMenu.tsx index c8cdd59..0b67850 100644 --- a/src/components/TopMenu.tsx +++ b/src/components/TopMenu.tsx @@ -129,6 +129,7 @@ class TopMenu extends React.Component { {this.renderLanguageDropdownItem("en", "English")} {this.renderLanguageDropdownItem("de", "Deutsch")} + {this.renderLanguageDropdownItem("el", "Ελληνικά")} {this.renderLanguageDropdownItem("es", "Español")} {this.renderLanguageDropdownItem("fr", "Français")} {this.renderLanguageDropdownItem("it", "Italiano")} diff --git a/src/i18n/config.ts b/src/i18n/config.ts index 9810c1e..1f2d094 100644 --- a/src/i18n/config.ts +++ b/src/i18n/config.ts @@ -17,6 +17,9 @@ i18n en: { translations: require('./locales/en/translation.json') }, + el: { + translations: require('./locales/el/translation.json') + }, es: { translations: require('./locales/es/translation.json') }, diff --git a/src/i18n/locales/el/translation.json b/src/i18n/locales/el/translation.json new file mode 100644 index 0000000..4d171ae --- /dev/null +++ b/src/i18n/locales/el/translation.json @@ -0,0 +1,91 @@ +{ + "tagline": "Εξαγάγετε τις λίστες αναπαραγωγής σας στο Spotify.", + "get_started": "Ξεκινήστε", + "subtitle": "{{min}}-{{max}} από {{total}} λίστες αναπαραγωγής για {{userId}}", + "subtitle_search": "{{total}} αποτελέσματα με \"{{query}}\" στο όνομα της λίστας αναπαραγωγής", + "subtitle_search_advanced": "{{total}} αποτελέσματα για προχωρημένο ερώτημα \"{{query}}\"", + "search": "Αναζήτηση", + "export_all": "Εξαγωγή όλων", + "exporting_done": "Ολοκληρώθηκε!", + "exporting_playlist": "Γίνεται εξαγωγή {{playlistName}}...", + "export_search_results": "Εξαγωγή αποτελεσμάτων", + "top_menu": { + "help": "Βοήθεια", + "toggle_dark_mode": "Εναλλαγή σκοτεινής λειτουργίας", + "change_language": "Αλλαγή γλώσσας", + "change_user": "Αλλαγή χρήστη" + }, + "config": { + "include_artists_data": "Συμπερίληψη δεδομένων καλλιτεχνών", + "include_audio_features_data": "Συμπερίληψη δεδομένων ηχητικών χαρακτηριστικών", + "include_album_data": "Συμπερίληψη δεδομένων άλμπουμ" + }, + "help": { + "title": "Γρήγορη αναφορά", + "search_syntax": { + "title": "Σύνταξη προχωρημένης αναζήτησης", + "query": "Ερώτημα", + "behavior": "Συμπεριφορά", + "public_true": "Εμφάνιση μόνο δημόσιων λιστών", + "public_false": "Εμφάνιση μόνο ιδιωτικών λιστών", + "collaborative_true": "Εμφάνιση μόνο συνεργατικών λιστών", + "collaborative_false": "Να μην εμφανίζονται συνεργατικές λίστες", + "owner_me": "Εμφάνιση μόνο λιστών που μου ανήκουν", + "owner_owner": "Εμφάνιση μόνο λιστών που ανήκουν σε [owner]", + "more_detail": "Για περισσότερες λεπτομέρειες δείτε την πλήρη τεκμηρίωση του έργου." + } + }, + "playlist": { + "name": "Όνομα", + "owner": "Κάτοχος", + "tracks": "Κομμάτια", + "public": "Δημόσια;", + "collaborative": "Συνεργατική;", + "not_supported": "Αυτή η λίστα δεν υποστηρίζεται", + "export": "Εξαγωγή" + }, + "track": { + "track_uri": "URI κομματιού", + "track_name": "Όνομα κομματιού", + "artist_uris": "URI καλλιτέχνη/ων", + "artist_names": "Όνομα/τα καλλιτέχνη", + "album_uri": "URI άλμπουμ", + "album_name": "Όνομα άλμπουμ", + "album_artist_uris": "URI καλλιτέχνη/ων άλμπουμ", + "album_artist_names": "Όνομα/τα καλλιτέχνη άλμπουμ", + "album_release_date": "Ημερομηνία κυκλοφορίας άλμπουμ", + "album_image_url": "URL εικόνας άλμπουμ", + "disc_number": "Αριθμός δίσκου", + "track_number": "Αριθμός κομματιού", + "track_duration": "Διάρκεια κομματιού (ms)", + "track_preview_url": "URL προεπισκόπησης κομματιού", + "explicit": "Ακατάλληλο", + "popularity": "Δημοτικότητα", + "isrc": "ISRC", + "is_playable": "Αναπαράγεται", + "added_by": "Προστέθηκε από", + "added_at": "Προστέθηκε στις", + "album": { + "album_genres": "Είδη άλμπουμ", + "label": "Εταιρεία", + "copyrights": "Πνευματικά δικαιώματα" + }, + "artist": { + "artist_genres": "Είδη καλλιτέχνη" + }, + "audio_features": { + "danceability": "Χορευτικότητα", + "energy": "Ενέργεια", + "key": "Τονικότητα", + "loudness": "Ένταση", + "mode": "Τρόπος", + "speechiness": "Ομιλητικότητα", + "acousticness": "Ακουστικότητα", + "instrumentalness": "Οργανοκεντρικότητα", + "liveness": "Ζωντάνια", + "valence": "Θετικότητα", + "tempo": "Ρυθμός", + "time_signature": "Μέτρο" + } + } +} From 3c444b06730388c462a7fb0c778983b475513b5b Mon Sep 17 00:00:00 2001 From: Poly <159016999+0x6B70@users.noreply.github.com> Date: Mon, 12 Jan 2026 18:03:48 +0200 Subject: [PATCH 2/2] Refactor getRedirectUri the way it was before the orginal commit Refactor getRedirectUri function to construct URI using window properties. --- src/auth.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/auth.ts b/src/auth.ts index 9718177..853ece6 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -50,12 +50,10 @@ function base64urlencode(arrayBuffer: ArrayBuffer): string { return btoa(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "") } -// Prefer an explicit redirect URI if provided (must match Spotify app allowlist) -const EXPLICIT_REDIRECT_URI = process.env.REACT_APP_REDIRECT_URI // Get the redirect URI for the current location function getRedirectUri(): string { - return EXPLICIT_REDIRECT_URI || `${window.location.origin}${window.location.pathname}` + return [window.location.protocol, '//', window.location.host, window.location.pathname].join('') } // Initiate Spotify OAuth authorization flow