diff --git a/CHANGELOG.md b/CHANGELOG.md index faf96904..f788bb2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.2.6.0 + +## New features + +* Added localization [#67](https://github.com/Otiel/BandcampDownloader/issues/67) for english and french. If you wish to help translate the application in another language, please see the [guidelines](/docs/help-translate.md). + # 0.2.5.0 ## Improvements @@ -7,15 +13,15 @@ # 0.2.4.2 +## Improvements + +* Updated dependencies to their latest version. + ## Bug fixes * Fixed issue [#75](https://github.com/Otiel/BandcampDownloader/issues/75) that would prevent downloading tracks with a name with less than 3 characters. * Fixed exponential back-off mechanism that was inactive for artwork files. -## Improvements - -* Updated dependencies to their latest version. - # 0.2.4.1 ## Bug fixes diff --git a/README.md b/README.md index 01e29543..391e6f9c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## Description -BandcampDownloader is a Windows application that helps downloading albums from [bandcamp.com](https://bandcamp.com) by retrieving the 128 kbps MP3 files streamed on the website. Its goal isn't to pirate albums, but simply to make life easier for those who prefer to listen to music on their favorite player. +BandcampDownloader is a Windows application that helps downloading albums from [bandcamp.com](https://bandcamp.com) by retrieving the 128 kbps MP3 files streamed on the website. It aims to ease the life of those who prefer to listen to music on their favorite player rather than on their web browser, but offers only what is already freely available on Bandcamp. ## Features @@ -21,8 +21,6 @@ BandcampDownloader is a Windows application that helps downloading albums from [ * Resize it, * Save it in tracks tags and in folder. -## Screenshot -

Screenshot

@@ -31,6 +29,10 @@ BandcampDownloader is a Windows application that helps downloading albums from [ See the [changelog](CHANGELOG.md). +## Contributing + +If you wish to help translate the application, please read the [guidelines](/docs/help-translate.md). + ## License BandcampDownloader is licensed under the MIT license - see the [LICENSE](LICENSE) file for details. @@ -39,6 +41,8 @@ BandcampDownloader is licensed under the MIT license - see the [LICENSE](LICENSE Some icons by [Yusuke Kamiyamane](http://p.yusukekamiyamane.com) licensed under a [Creative Commons Attribution 3.0 License](https://creativecommons.org/licenses/by/3.0). +The list of open-source libraries used by BandcampDownloader can be found [here](docs/dependencies.md). + ## Piracy You'll do what you want to do with this app, but remember to buy albums from your favorite artists if you want to support them! diff --git a/docs/dependencies.md b/docs/dependencies.md new file mode 100644 index 00000000..f0005ddf --- /dev/null +++ b/docs/dependencies.md @@ -0,0 +1,17 @@ +# Dependencies + +BandcampDownloader relies on a number of open-source libraries, all listed below: + +* [`Castle.Core`](https://github.com/castleproject/Core): required by `Config.Net`. +* [`Config.Net`](https://github.com/aloneguid/config): used to manage the application configuration file. +* [`Costura`](https://github.com/Fody/Costura): used to embed dependencies (_*.dll_) files in the main _exe_ file. +* [`Fody`](https://github.com/Fody/Fody): required by `Costura`. +* [`HtmlAgilityPack`](https://github.com/zzzprojects/html-agility-pack): used to parse Html from bandcamp.com pages. +* [`ImageResizer`](https://github.com/imazen/resizer): used to resize/compress the album covers. +* [`Json.NET`](https://github.com/JamesNK/Newtonsoft.Json): used to parse Json from bandcamp.com pages. +* [`MessageBoxManager`](https://www.codeproject.com/Articles/18399/Localizing-System-MessageBox): used to localize the buttons of the Windows system message box. +* [`NLog`](https://github.com/NLog/NLog): used to log events. +* [`Resource.Embedder`](https://github.com/MarcStan/Resource.Embedder): used to embed localization resources (_*.resources.dll_) in the main _exe_ file (not supported by `Costura`). +* [`TagLib#`](https://github.com/mono/taglib-sharp): used to write MP3 tags. +* [`WPFLocalizationExtension`](https://github.com/XAMLMarkupExtensions/WPFLocalizationExtension): used to manage the localization. +* [`XAMLMarkupExtensions`](https://github.com/XAMLMarkupExtensions/XAMLMarkupExtensions): required by `WpfLocalizeExtension`. diff --git a/docs/help-translate.md b/docs/help-translate.md new file mode 100644 index 00000000..9c77d103 --- /dev/null +++ b/docs/help-translate.md @@ -0,0 +1,23 @@ +# Help translate + +If you wish to help translate the application, the following should get you started. + +## Edit translation files + +Translations are stored in resources (_resx_) files, one file per language. As of today, the following translations exist: +* English: [_Resources.resx_](/src/BandcampDownloader/Properties/Resources.resx) +* French: [_Resources.fr.resx_](/src/BandcampDownloader/Properties/Resources.fr.resx) + +In order to modify the translations, you can either edit the files with your favorite text editor, or use a tool such as [Zeta Resource Editor](https://www.zeta-resource-editor.com). + +If you wish to create a new language file, simply duplicate the English file (_Resources.resx_) in the same place and rename it using the correct [culture code](https://docs.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo?view=netframework-4.7.2#culture-names-and-identifiers) (for instance: _Resources.fr.resx_, _Resources.fr-CA.resx_...): + +>The name is a combination of an [ISO 639 two-letter](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) lowercase culture code associated with a language and an ISO 3166 two-letter uppercase subculture code associated with a country or region. + +## Submit changes + +Once you're done, commit your changes on a new branch and create a pull request. + +## Closing + +If you're not sure of the translation by lack of context for instance, don't hesitate to open a [new issue](https://github.com/Otiel/BandcampDownloader/issues/new) and ask. Any effort will be appreciated, even if you cannot provide a complete translated file. **Thanks in advance for your help!** diff --git a/docs/new-release.md b/docs/new-release.md index 1dfdf228..665c098b 100644 --- a/docs/new-release.md +++ b/docs/new-release.md @@ -29,9 +29,11 @@ This repository follows [git flow](https://nvie.com/posts/a-successful-git-branc 1. On Visual Studio, set the Solution Configuration to "Release". 2. Build the solution. 3. Create a new _zip_ archive containing the necessary files created under `src\BandcampDownloader\bin\Release`. -4. Draft a new [release](https://github.com/Otiel/BandcampDownloader/releases) on GitHub: +4. Compute hashes (MD5, SHA-1...) for the files. +5. Draft a new [release](https://github.com/Otiel/BandcampDownloader/releases) on GitHub: * Choose the newly created tag (if you forgot to push it, now's the time to do it). * Set the title equal to `X.Y.Z`. * Copy-paste the changes from `CHANGELOG.md`. + * Add the hashes to the description. * Attach the _zip_ file. -5. Publish the release! +6. Publish the release! diff --git a/src/BandcampDownloader/App.xaml.cs b/src/BandcampDownloader/App.xaml.cs index 528d4d95..9f92b000 100644 --- a/src/BandcampDownloader/App.xaml.cs +++ b/src/BandcampDownloader/App.xaml.cs @@ -1,10 +1,13 @@ using System; +using System.Globalization; using System.Windows; using Config.Net; +using WPFLocalizeExtension.Engine; namespace BandcampDownloader { public partial class App: Application { + /// /// The settings chosen by the user. /// @@ -13,6 +16,7 @@ public partial class App: Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); InitializeSettings(); + LoadLanguage(); } /// @@ -26,5 +30,20 @@ private void InitializeSettings() { App.UserSettings.DownloadsPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\{artist}\\{album}"; } } + + /// + /// Load settings for localization + /// + private void LoadLanguage() { + // Sets the CultureInfo according to the language saved in settings. + LocalizeDictionary.Instance.Culture = new CultureInfo(UserSettings.Language.ToString()); + + // Set system MessageBox buttons + MessageBoxManager.OK = BandcampDownloader.Properties.Resources.messageBoxButtonOK; + MessageBoxManager.Cancel = BandcampDownloader.Properties.Resources.messageBoxButtonCancel; + MessageBoxManager.Yes = BandcampDownloader.Properties.Resources.messageBoxButtonYes; + MessageBoxManager.No = BandcampDownloader.Properties.Resources.messageBoxButtonNo; + MessageBoxManager.Register(); + } } } \ No newline at end of file diff --git a/src/BandcampDownloader/BandcampDownloader.csproj b/src/BandcampDownloader/BandcampDownloader.csproj index 52942ab7..4a6a2f90 100644 --- a/src/BandcampDownloader/BandcampDownloader.csproj +++ b/src/BandcampDownloader/BandcampDownloader.csproj @@ -1,6 +1,7 @@  + Debug x86 @@ -79,7 +80,7 @@ - ..\packages\Castle.Core.4.3.1\lib\net45\Castle.Core.dll + ..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll ..\packages\Config.Net.4.13.2\lib\net452\Config.Net.dll @@ -87,8 +88,8 @@ ..\packages\Costura.Fody.3.3.2\lib\net40\Costura.dll - - ..\packages\HtmlAgilityPack.1.9.2\lib\Net45\HtmlAgilityPack.dll + + ..\packages\HtmlAgilityPack.1.11.2\lib\Net45\HtmlAgilityPack.dll ..\packages\ImageResizer.4.2.5\lib\net45\ImageResizer.dll @@ -98,13 +99,14 @@ ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll - ..\packages\NLog.4.5.11\lib\net45\NLog.dll + ..\packages\NLog.4.6.2\lib\net45\NLog.dll + @@ -114,12 +116,19 @@ 4.0 + ..\packages\taglib.2.1.0.0\lib\taglib-sharp.dll + + ..\packages\WPFLocalizeExtension.3.3.1\lib\net452\WPFLocalizeExtension.dll + + + ..\packages\XAMLMarkupExtensions.1.6.0\lib\net452\XAMLMarkupExtensions.dll + @@ -127,6 +136,7 @@ Designer + @@ -226,6 +236,9 @@ Settings.settings True + + Resources.fr.Designer.cs + ResXFileCodeGenerator Resources.Designer.cs @@ -289,10 +302,11 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ... + + + Parcourir + + + _Annuler + + + Vérifier _maintenant + + + _Paramètres + + + Ouvrir les paramètres + + + Réinitialiser les paramètres à leur valeur par défaut + + + _Enregistrer + + + _Télécharger + + + _Annuler + + + Vérifier les mises à jour au _démarrage + + + L'application accèdera à l'adresse suivante en démarrant : + + + Convertir en _jpg + + + La pochette sera convertie en jpg avec une compression jpeg égale à 90 (considéré comme un excellent compromis entre taille et qualité de l'image). + + + Restreindre la _largeur / hauteur maximale + + + La pochette sera redimensionnée pour ne pas être plus grande que la largeur / hauteur définie. + + + Convertir en jp_g + + + La pochette sera convertie en jpg avec une compression jpeg égale à 90 (considéré comme un excellent compromis entre taille et qualité de l'image). + + + Restreindre la largeur / _hauteur maximale + + + La pochette sera redimensionnée pour ne pas être plus grande que la largeur / hauteur définie. + + + Télécharger la _discographie de l'artiste + + + La discographie complète de l'artiste sera téléchargée. + + + Sons de _notifications + + + Un son de notification sera joué lorsque les téléchargements sont terminés. + + + _Modifier les métadonnées des chansons (ID3) + + + Chaque métadonnée sera modifiée selon les règles définies ci-dessous. + +Si cette option est décochée, toutes les règles définies ci-dessous seront ignorées et les métadonnées seront conservées à l'identique du fichier téléchargé. +Cela revient à régler "Do not modify" ("Ne pas modifier") pour chaque métadonnée. + + + Télécharger un album à la _fois + + + Un seul album sera téléchargé à la fois. +Si cette option n'est pas cochée, tous les albums seront téléchargés en même temps (conseillé si vous avez une bande passante suffisante). + + + Récupérer la _taille des fichiers avant téléchargement + + + La taille des fichiers sera récupérée afin de calculer précisément l'avancement. +Décocher cette option permet de gagner du temps. + + + Sauvegarder dans le _dossier + + + La pochette sera téléchargée dans le dossier de l'album. + + + Sauvegarder dans les _métadonnées + + + La pochette sera téléchargée dans les métadonnées des chansons. + + + Afficher le log _verbeux + + + Toutes les informations seront affichées sur le log. + + + Sélectionner le dossier dans lequel télécharger les albums + + + Interprète de l'al_bum + + + _Nom de l'album + + + _Différence de taille de fichier autorisée (%) + + + _Interprète + + + _Réinitialiser + + + C_ommentaires + + + Taille maximale (_px) + + + Taille maximale (p_x) + + + Nombre de téléchargements _maximum + + + _Temps d'attente avant nouvel essai (sec) + + + E_xposant de nouvel essai + + + _Enregistrer les albums sous + + + _Format du nom de fichier : + + + Proxy _HTTP(S) + + + _Port + + + Modifiez ces paramètres à vos risques et périls. + + + _Langue + + + _Paroles + + + Certains paramètres ne peuvent pas être modifiés lorsque des téléchargements sont en cours. + + + N_uméro de la piste + + + _Titre + + + (le fichier log est toujours verbeux) + + + Cliquer pour se rendre sur le site web du projet : + + + Impossible de vérifier les mises à jour + + + Une nouvelle version ({0}) est disponible + + + Année _de parution de l'album + + + Paramètres avancés + + + Pochette + + + Téléchargements + + + Général + + + Réseau + + + Noms et métadonnées + + + &Annuler + + + &Non + + + &OK + + + &Oui + + + Êtes-vous sûr de vouloir arrêter les téléchargements ? + + + Une erreur est intervenue lors de la vérification de mises à jour. Veuillez réessayer plus tard. + + + Des téléchargements sont en cours. Êtes-vous sûr de vouloir fermer l'application et arrêter tous les téléchargements ? + + + Vous avez déjà la dernière version disponible ({0}). + + + Réinitialiser tous les paramètres à leur valeur par défaut ? + + + Une nouvelle version est disponible : +Version actuelle = {0} +Nouvelle version = {1} + +Voulez-vous aller sur le site web du projet afin de récupérer la dernière version ? + + + Proxy _manuel + + + A_ucun proxy + + + Proxy _système + + + Quand une chanson est téléchargée, si le même nom de fichier existe déjà dans le dossier, il sera comparé au fichier à télécharger. +Si la taille des deux fichiers diffère moins que cette valeur (en pourcentage), la chanson ne sera pas re-téléchargée. + +Valeur conseillée = 5 + + + Nombre maximum d'essais quand un téléchargement échoue. +Si ce nombre est dépassé (par chanson), le téléchargement de la chanson sera abandonné. + +Valeur conseillée = 7 + + + Utilisé pour contrôler l'algorithme d'attente exponentiel. +Lorsque qu'un téléchargement échoue, BandcampDownloader attend un temps donné avant de ré-essayer de +télécharger la chanson afin d'éviter de déclencher le filtre anti-spam de Bandcamp. +La formule utilisée pour calculer le temps à attendre est la suivante : +temps = temps-d'attente * (exposant ^ numéro-de-l'essai) + +Valeur conseillée = 0.2 + + + Utilisé pour contrôler l'algorithme d'attente exponentiel. +Lorsque qu'un téléchargement échoue, BandcampDownloader attend un temps donné avant de ré-essayer de +télécharger la chanson afin d'éviter de déclencher le filtre anti-spam de Bandcamp. +La formule utilisée pour calculer le temps à attendre est la suivante : +temps = temps-d'attente * (exposant ^ numéro-de-l'essai) + +Valeur conseillée = 4 + + + Vous pouvez utiliser des paramètres de substitution relatifs à chaque album dans le chemin de téléchargement : +- {artist} sera remplacé par l'interprète de l'album +- {album} sera remplacé par le nom de l'album +- {year} (année), {month} (mois) et {day} (jour) seront remplacés par la date de parution de l'album + + + Vous pouvez utiliser des paramètres de substitution pour personnaliser le nom des fichiers : +- {artist} sera remplacé par l'interprète de l'album +- {title} sera remplacé par le titre de la chanson +- {tracknum} sera remplacé par le numéro de la piste +- {album} sera remplacé par le nom de l'album +- {year} (année), {month} (mois) et {day} (jour) seront remplacés par la date de parution de l'album + + + Copiez les URL d'albums à télécharger ici. Vous pouvez spécifier plusieurs URL en ayant un URL par ligne. + +Un URL de Bandcamp est de la forme suivante : http://[artiste].bandcamp.com/album/[album] or http://[artiste].bandcamp.com/track/[chanson] +Copiez des URL d'interprètes : http://[artiste].bandcamp.com et cocher "☑ Télécharger la discographie de l'artiste" pour télécharger l'ensemble +de leurs albums. + + + Paramètres + + \ No newline at end of file diff --git a/src/BandcampDownloader/Properties/Resources.resx b/src/BandcampDownloader/Properties/Resources.resx index d4ab6089..45280db0 100644 --- a/src/BandcampDownloader/Properties/Resources.resx +++ b/src/BandcampDownloader/Properties/Resources.resx @@ -133,4 +133,312 @@ ..\Resources\InformationSmallWhite.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ... + + + Browse for folder + + + _Cancel + + + Check no_w + + + _Settings + + + Open settings + + + Resets settings to their default values + + + _Save + + + Start _download + + + _Cancel + + + Check for _updates at startup + + + If checked, the application will query the following address when starting: + + + Convert to _jpg + + + If checked, the cover art will be converted to jpg with a jpeg compression of 90 (which is an excellent tradeoff between size and perfection). + + + Constrain _maximum width/height + + + If checked, the cover art will be resized with the specified max width/height. + + + Convert to jp_g + + + If checked, the cover art will be converted to jpg with a jpeg compression of 90 (which is an excellent tradeoff between size and perfection). + + + Constrain m_aximum width/height + + + If checked, the cover art will be resized with the specified max width/height. + + + Download _artist discography + + + If checked, the whole artist discography will be downloaded. + + + Play _notifications sounds + + + If checked, a notification sound will be played when downloads are finished. + + + _Modify tracks tags (ID3) + + + If checked, each tag will be modified as specified below. + +If unchecked, all settings below will be ignored and the tags will be left as they are in the original downloaded file. +This is equivalent to setting "Do not modify" on each tag. + + + _Download one album at a time + + + If checked, only one album at a time will be downloaded. +If unchecked, all albums will be downloaded at the same time (preferred if you have a high bandwidth). + + + Retrieve files _size + + + If checked, files size will be retrieved so that precise download progress can be shown. +Uncheck this option to save some time. + + + Save in _folder + + + If checked, the cover art will be downloaded in the albums folder. + + + Save in _tags + + + If checked, the cover art will be saved in the tracks tags. + + + Show _verbose log + + + If checked, more information will be shown on the log. + + + Select the folder to save albums + + + Album art_ist + + + Album _name + + + Allowed file _size difference (%) + + + _Artist + + + _Reset settings + + + Comm_ents + + + Max size (_px) + + + Max size (p_x) + + + Download _max tries + + + Retry c_ooldown (sec) + + + Retry _exponent + + + Save albums _to + + + _File name format: + + + _HTTP(S) proxy + + + _Port + + + Change these settings at your own risk. + + + _Language + + + _Lyrics + + + Some settings cannot be changed while tracks are downloading. + + + Track n_umber + + + _Title + + + (the log file is always verbose) + + + Click to go to official project website: + + + Could not check for updates + + + A new version ({0}) is available + + + Album release _year + + + Advanced settings + + + Cover art + + + Downloads + + + General + + + Network + + + Naming and tags + + + &Cancel + + + &No + + + &OK + + + &Yes + + + Would you like to cancel all downloads? + + + An error occured while checking for updates. Please retry later. + + + There are currently active downloads. Are you sure you want to close the application and stop all downloads? + + + You already have the latest version available ({0}). + + + Reset all settings to their default values? + + + A new version is available: +Current version = {0} +Latest version = {1} + +Would you like to go to the project website in order to download the latest version? + + + _Manual proxy configuration + + + _No proxy + + + _System proxy + + + When downloading a track, if the same file (name) already exists, it will be checked against the track to download. +If the size of both files differ from less than this value (in percent), the track download will be skipped. + +Recommended value = 5 + + + Maximum number of tries performed to download a track if it fails. +After that number is reached (for each track), the track download will be skipped. + +Recommended value = 7 + + + Used to control the exponential back-off mechanism. +After each failure of a track download, BandcampDownloader can wait for a specific time before trying again +to download the track in order to avoid tickling the Bandcamp anti-spam filter. +The formula used to compute the time to wait before trying again a download is the following: +time = cooldown * (exponent ^ try-count) + +Recommended value = 0.2 + + + Used to control the exponential back-off mechanism. +After each failure of a track download, BandcampDownloader can wait for a specific time before trying again +to download the track in order to avoid tickling the Bandcamp anti-spam filter. +The formula used to compute the time to wait before trying again a download is the following: +time = cooldown * (exponent ^ try-count) + +Recommended value = 4 + + + You can use placeholders to customize the download folder depending on the album: +- {artist} will be replaced by the album artist +- {album} will be replaced by the album name +- {year}, {month} and {day} will be replaced by the album release date + + + You can use placeholders to customize the file name: +- {artist} will be replaced by the album artist +- {title} will be replaced by the track name +- {tracknum} will be replaced by the track number +- {album} will be replaced by the album name +- {year}, {month} and {day} will be replaced by the album release date + + + Paste URLs of albums to download here. You can specify multiple URLs by writing one URL per line. + +A Bandcamp URL looks like: http://[artist].bandcamp.com/album/[album] or http://[artist].bandcamp.com/track/[track] +Paste artist pages: http://[artist].bandcamp.com and check "☑ Download artist discography" to download all their albums. + + + Settings + \ No newline at end of file diff --git a/src/BandcampDownloader/UI/Dialogs/Settings/UserControlSettingsAdvanced.xaml b/src/BandcampDownloader/UI/Dialogs/Settings/UserControlSettingsAdvanced.xaml index 03c084e9..ce58359f 100644 --- a/src/BandcampDownloader/UI/Dialogs/Settings/UserControlSettingsAdvanced.xaml +++ b/src/BandcampDownloader/UI/Dialogs/Settings/UserControlSettingsAdvanced.xaml @@ -3,11 +3,15 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:lex="http://wpflocalizeextension.codeplex.com" xmlns:local="clr-namespace:BandcampDownloader" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Name="userControlSettingsAdvanced" - Width="240" + Width="410" Height="135" + lex:LocalizeDictionary.DesignCulture="en" + lex:ResxLocalizationProvider.DefaultAssembly="BandcampDownloader" + lex:ResxLocalizationProvider.DefaultDictionary="Resources" KeyboardNavigation.TabNavigation="Local" mc:Ignorable="d"> @@ -30,94 +34,106 @@ Source="pack://application:,,,/Resources/ExclamationSmall.png" Stretch="None" />