mirror of
https://github.com/Aran404/SpotAPI.git
synced 2026-04-25 16:55:50 +03:00
[PR #55] [MERGED] Add Multi-Language Support with Accept-Language Header #56
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SpotAPI#56
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Aran404/SpotAPI/pull/55
Author: @ParkJeongseop
Created: 12/19/2025
Status: ✅ Merged
Merged: 12/19/2025
Merged by: @Aran404
Base:
main← Head:feature/add-language-support📝 Commits (1)
f3fe30dfeat: add multi-language support with Accept-Language header📊 Changes
12 files changed (+210 additions, -12 deletions)
View changed files
📝
README.md(+17 -1)📝
docs/album.md(+19 -1)📝
docs/artist.md(+25 -1)➕
docs/language.md(+90 -0)📝
docs/playlist.md(+19 -1)📝
docs/song.md(+19 -1)📝
spotapi/album.py(+2 -1)📝
spotapi/artist.py(+2 -1)📝
spotapi/client.py(+8 -1)📝
spotapi/playlist.py(+5 -2)📝
spotapi/podcast.py(+2 -1)📝
spotapi/song.py(+2 -1)📄 Description
Summary
This PR adds comprehensive multi-language support to SpotAPI by implementing
Accept-Languageheader functionality across all major classes. Users can now receive localized responses from Spotify's API in their preferred language using standard ISO 639-1 language codes.Changes Made
Core Implementation
languageparameter andAccept-Languageheader support inspotapi/client.pyset_language()method for dynamic language changesArtistSongPublicPlaylistPrivatePlaylistPublicAlbumPodcastDocumentation Updates
docs/language.mddocumentationFeatures
✅ ISO 639-1 Standard: Support for standard language codes (ko, ja, zh, en, etc.)
✅ Runtime Language Changes: Switch languages without reinitializing objects
✅ Backward Compatible: Default English, existing code continues to work
✅ Comprehensive Coverage: Available in all major SpotAPI classes
✅ Centralized Implementation: DRY principle with BaseClient handling headers
Usage Examples
Initialize with Language
Runtime Language Changes
Testing
Thoroughly tested with real Spotify tracks:
Accept-Languageproperly applied to all requestsTechnical Details
Implementation Approach
BaseClient._auth_rule()methodAccept-Languageheader added to all authenticated requestsHeader Example
Backward Compatibility
language="en")Files Changed
Core Files
spotapi/client.py- Added language support to BaseClientspotapi/artist.py- Added language parameterspotapi/song.py- Added language parameterspotapi/playlist.py- Added language parameter (both Public and Private)spotapi/album.py- Added language parameterspotapi/podcast.py- Added language parameterDocumentation
README.md- Added features and examplesdocs/artist.md- Added language documentationdocs/song.md- Added language documentationdocs/playlist.md- Added language documentationdocs/album.md- Added language documentationdocs/language.md- New comprehensive language guideBenefits
🌍 Global Accessibility: Makes SpotAPI usable for international developers
🎯 User Experience: Localized responses improve user experience
📚 Well Documented: Comprehensive documentation with examples
🔧 Easy to Use: Simple API with sensible defaults
⚡ Performance: No overhead when using default language
This enhancement significantly improves SpotAPI's international usability while maintaining its simplicity and existing functionality.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
urisvslibraryItemUris) #34