Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
* master:
  Update translations from transifex.
  Update POT files using the production database
  Install pkg-config to probe ICU headers/libraries (#1360)
  Fix MBS-10572: Have one Jed bundle per language (#1359)
  MBS-10571: Fix "localized" ModBot email display (#1358)
  Eslint fixes: no-prototype-builtins
  Document musicbrainz_selenium creation
  MBS-10567: Limit series types as per DB constraint (#1351)
  MBS-10560: Show full country names in release edits (#1353)
  MBS-10536: Remove span.name-variation around "see all" releases link (#1354)
  Remove unneeded extra newlines
  MBS-10365: Convert ReleaseList to react-table
  Eslint sort-keys fixes
  MBS-10552: Add Deezer links to the sidebar
  • Loading branch information
mwiencek committed Jan 21, 2020
2 parents 838524e + 8406760 commit 263e7ff
Show file tree
Hide file tree
Showing 70 changed files with 810 additions and 601 deletions.
6 changes: 6 additions & 0 deletions HACKING.md
Expand Up @@ -187,6 +187,12 @@ These are a bit more involved to set up:

* Run ./script/create_test_db.sh and ./script/compile_resources.sh again.

* Create the `musicbrainz_selenium` database using `musicbrainz_test` as
a template:

$ # On Ubuntu, use sudo -u postgres
$ createdb -O musicbrainz -T musicbrainz_test -U postgres musicbrainz_selenium

With the above prerequisites out of the way, the tests can be run from the
command line like so:

Expand Down
5 changes: 3 additions & 2 deletions INSTALL.md
Expand Up @@ -172,7 +172,8 @@ Below outlines how to setup MusicBrainz server with local::lib.
libpq-dev \
libxml2 \
libxml2-dev \
cpanminus
cpanminus \
pkg-config

2. Enable local::lib

Expand Down Expand Up @@ -228,7 +229,7 @@ Creating the database
To build our collate extension you will need libicu and its development
headers, to install these run:

sudo apt-get install libicu-dev
sudo apt-get install libicu-dev pkg-config

With libicu installed, you can build and install the collate extension by
running:
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Expand Up @@ -37,6 +37,7 @@ module.exports = function (api) {
const ignore = [
'node_modules',
'root/static/scripts/tests/typeInfo.js',
/root\/static\/build\/jed-[A-z_-]+?\.source\.js$/,
];

return {
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.tests
Expand Up @@ -64,6 +64,7 @@ RUN apt-get update && \
openjdk-8-jre \
openssh-client \
perl \
pkg-config \
postgresql \
postgresql-10-pgtap \
postgresql-contrib \
Expand Down
3 changes: 2 additions & 1 deletion docker/templates/macros.m4
Expand Up @@ -53,7 +53,8 @@ libicu-dev m4_dnl
libperl-dev m4_dnl
libpq-dev m4_dnl
libssl-dev m4_dnl
libxml2-dev')
libxml2-dev m4_dnl
pkg-config')

# postgresql-server-dev-9.5 provides pg_config, which is needed by InitDb.pl
# at run-time.
Expand Down
5 changes: 5 additions & 0 deletions entities.json
Expand Up @@ -199,6 +199,7 @@
"removal": {
"automatic": {}
},
"series": true,
"tags": true,
"type": {
"simple": true
Expand Down Expand Up @@ -483,6 +484,7 @@
"manual": true
},
"report_filter": true,
"series": true,
"sitemaps_lastmod_table": true,
"tags": true,
"url": "recording"
Expand Down Expand Up @@ -528,6 +530,7 @@
"manual": true
},
"report_filter": true,
"series": true,
"sitemaps_lastmod_table": true,
"tags": true,
"url": "release"
Expand Down Expand Up @@ -576,6 +579,7 @@
}
},
"report_filter": true,
"series": true,
"sitemaps_lastmod_table": true,
"tags": true,
"type": {
Expand Down Expand Up @@ -741,6 +745,7 @@
"automatic": {}
},
"report_filter": true,
"series": true,
"sitemaps_lastmod_table": true,
"tags": true,
"type": {
Expand Down
2 changes: 1 addition & 1 deletion lib/MusicBrainz/Server/Data/Release.pm
Expand Up @@ -647,7 +647,7 @@ sub _order_by {
"date" => sub {
return "date_year, date_month, date_day, musicbrainz_collate(name)"
},
"title" => sub {
"name" => sub {
return "musicbrainz_collate(name), date_year, date_month, date_day"
},
"country" => sub {
Expand Down
1 change: 1 addition & 0 deletions lib/MusicBrainz/Server/Data/URL.pm
Expand Up @@ -48,6 +48,7 @@ my %URL_SPECIALIZATIONS = (
'Dailymotion' => qr{^https?://(?:www\.)?dailymotion\.com/}i,
'DanceDB' => qr{^https?://(?:www\.)?tedcrane\.com/DanceDB/}i,
'Decoda' => qr{^https?://(?:www\.)?decoda\.com/}i,
'Deezer' => qr{^https?://(?:www\.)?deezer\.com/}i,
'DHHU' => qr{^https?://(?:www\.)?dhhu\.dk/}i,
'Directlyrics' => qr{^https?://(?:www\.)?directlyrics\.com/}i,
'Discogs' => qr{^https?://(?:www\.)?discogs\.com/}i,
Expand Down
22 changes: 22 additions & 0 deletions lib/MusicBrainz/Server/Email.pm
Expand Up @@ -18,6 +18,7 @@ use MusicBrainz::Server::Constants qw(
:edit_status
:email_addresses
$CONTACT_URL
$EDITOR_MODBOT
$MINIMUM_RESPONSE_PERIOD
);
use MusicBrainz::Server::Email::AutoEditorElection::Nomination;
Expand All @@ -27,6 +28,9 @@ use MusicBrainz::Server::Email::AutoEditorElection::Canceled;
use MusicBrainz::Server::Email::AutoEditorElection::Accepted;
use MusicBrainz::Server::Email::AutoEditorElection::Rejected;
use MusicBrainz::Server::Email::Subscriptions;
use MusicBrainz::Server::Translation;

use aliased 'MusicBrainz::Server::Entity::EditNote';

has 'c' => (
is => 'rw',
Expand Down Expand Up @@ -311,6 +315,24 @@ sub _create_edit_note_email
my $note_text = $opts{note_text} or die "Missing 'note_text' argument";
my $own_edit = $opts{own_edit};

if ($from_editor->id == $EDITOR_MODBOT) {
# Messages from ModBot, while they may be translated on the website,
# are currently always mailed in English via
# `run_without_translations` below. This is because, for one, the
# current language set here is unrelated to the language of the
# recipient: the current process is either authenticated as the
# user who approved the edit, or no user at all (being applied by
# ModBot). Second, the UI language of the recipient is stored as a
# cookie in their browser, which we obviously don't have access
# to here.
MusicBrainz::Server::Translation->run_without_translations(sub {
$note_text = EditNote->new(
editor_id => $from_editor->id,
text => "$note_text",
)->localize;
});
}

my @headers = (
'To' => _user_address($editor),
'From' => _user_address($from_editor, 1),
Expand Down
24 changes: 24 additions & 0 deletions lib/MusicBrainz/Server/Entity/URL/Deezer.pm
@@ -0,0 +1,24 @@
package MusicBrainz::Server::Entity::URL::Deezer;

use Moose;

use MusicBrainz::Server::Translation qw( l );

extends 'MusicBrainz::Server::Entity::URL';
with 'MusicBrainz::Server::Entity::URL::Sidebar';

sub sidebar_name { l('Stream at Deezer') }

__PACKAGE__->meta->make_immutable;
no Moose;
1;

=head1 COPYRIGHT AND LICENSE
Copyright (C) 2020 MetaBrainz Foundation
This file is part of MusicBrainz, the open internet music database,
and is licensed under the GPL version 2, or (at your option) any
later version: http://www.gnu.org/licenses/gpl-2.0.txt
=cut
5 changes: 3 additions & 2 deletions lib/MusicBrainz/Server/Form/Admin/Attributes.pm
Expand Up @@ -52,8 +52,9 @@ sub options_parent_id {
}

sub options_item_entity_type {
my ($self) = @_;
return map { $_ => $_ } sort { $a cmp $b } entities_with('collections');
my ($self, $model) = @_;
my $entity_type = $self->ctx->stash->{model} eq 'SeriesType' ? 'series' : 'collections';
return map { $_ => $_ } sort { $a cmp $b } entities_with($entity_type);
}

1;
Expand Down
11 changes: 11 additions & 0 deletions lib/MusicBrainz/Server/Translation.pm
Expand Up @@ -9,6 +9,7 @@ use I18N::LangTags::Detect;
use List::UtilsBy qw( sort_by );
use Locale::Messages qw( bindtextdomain LC_MESSAGES );
use Locale::Util qw( web_set_locale );
use POSIX qw( setlocale );
use Text::Balanced qw( extract_bracketed );
use Unicode::ICU::Collator qw( UCOL_NUMERIC_COLLATION UCOL_ON );

Expand Down Expand Up @@ -149,6 +150,16 @@ sub set_language
}
}

sub run_without_translations {
my ($self, $code) = @_;

my $prev_locale = setlocale(LC_MESSAGES);
$self->unset_language();
$code->();
setlocale(LC_MESSAGES, $prev_locale);
return;
}

sub unset_language
{
web_set_locale([ 'en' ], [ 'utf-8' ], LC_MESSAGES);
Expand Down
38 changes: 19 additions & 19 deletions po/attributes.nl.po
Expand Up @@ -3,14 +3,14 @@
# reneweesp <email address hidden>, 2017
# Maurits Meulenbelt <email address hidden>, 2012
# Maurits Meulenbelt <email address hidden>, 2012
# Maurits Meulenbelt <email address hidden>, 2013-2019
# Maurits Meulenbelt <email address hidden>, 2013-2020
# Nikolai Prokoschenko <email address hidden>, 2011
# Nikolai Prokoschenko <email address hidden>, 2011
# Niko Strijbol <email address hidden>, 2018
msgid ""
msgstr ""
"Project-Id-Version: MusicBrainz\n"
"PO-Revision-Date: 2019-10-28 15:05+0000\n"
"PO-Revision-Date: 2020-01-20 13:10+0000\n"
"Last-Translator: Maurits Meulenbelt <email address hidden>\n"
"Language-Team: Dutch (http://www.transifex.com/musicbrainz/musicbrainz/language/nl/)\n"
"MIME-Version: 1.0\n"
Expand All @@ -25,64 +25,64 @@ msgid ""
"\"Motet\" is a term that applies to different types of (usually "
"unaccompanied) choral works. What exactly is a motet depends quite a bit on "
"the period."
msgstr "\"Motet\" is een term die van toepassing is op verschillende soorten (meestal niet-begeleide) koorcomposities. Wat een motet precies is, hangt nogal af van de tijdsperiode."
msgstr "Met motet worden verschillende soorten gezongen composities aangeduid. Meestal worden motetten niet door een instrument begeleid. Wat precies als een motet wordt beschouwd, hangt af van de periode."

#: DB:work_type/description:5
msgctxt "work_type"
msgid ""
"\"Sonata\" is a general term used to describe small scale (very often solo "
"or solo + keyboard) instrumental works, initially in baroque music."
msgstr "\"Sonate\" is een term die kleinschalige instrumentale composities (vaak voor een solo-instrument of een solo-instrument samen met piano) beschrijft. De sonate is ontstaan in de barok."
msgstr "Sonate is een benaming die wordt gebruikt voor kleinschalige instrumentale composities (vaak voor een solo-instrument of een solo-instrument samen met piano). De sonate is ontstaan in de barok."

#: DB:medium_format/name:54
msgctxt "medium_format"
msgid "10\" Shellac"
msgstr "10″ schellak"
msgstr "10″-schellak"

#: DB:medium_format/name:30
msgctxt "medium_format"
msgid "10\" Vinyl"
msgstr "10″ vinyl"
msgstr "10″-vinyl"

#: DB:medium_format/name:72
msgctxt "medium_format"
msgid "12\" LaserDisc"
msgstr "12″ LaserDisc"
msgstr "12″-LaserDisc"

#: DB:medium_format/name:55
msgctxt "medium_format"
msgid "12\" Shellac"
msgstr "12″ schellak"
msgstr "12″-schellak"

#: DB:medium_format/name:31
msgctxt "medium_format"
msgid "12\" Vinyl"
msgstr "12″ vinyl"
msgstr "12″-vinyl"

#: DB:medium_format/name:49
msgctxt "medium_format"
msgid "3.5\" Floppy Disk"
msgstr "3,5″ floppy"
msgstr "3,5″-floppy"

#: DB:medium_format/name:52
msgctxt "medium_format"
msgid "7\" Flexi-disc"
msgstr "7″ flexi-disc"
msgstr "7″-flexi-disc"

#: DB:medium_format/name:56
msgctxt "medium_format"
msgid "7\" Shellac"
msgstr "7″ schellak"
msgstr "7″-schellak"

#: DB:medium_format/name:29
msgctxt "medium_format"
msgid "7\" Vinyl"
msgstr "7″ vinyl"
msgstr "7″-vinyl"

#: DB:medium_format/name:71
msgctxt "medium_format"
msgid "8\" LaserDisc"
msgstr "8″ LaserDisc"
msgstr "8″-LaserDisc"

#: DB:medium_format/name:78
msgctxt "medium_format"
Expand All @@ -92,12 +92,12 @@ msgstr "8-sporencassette"
#: DB:medium_format/name:34
msgctxt "medium_format"
msgid "8cm CD"
msgstr "8 cm cd"
msgstr "8cm-cd"

#: DB:medium_format/name:40
msgctxt "medium_format"
msgid "8cm CD+G"
msgstr "8 cm cd+g"
msgstr "8cm-cd+g"

#: DB:medium_format/description:58
msgctxt "medium_format"
Expand Down Expand Up @@ -2421,7 +2421,7 @@ msgstr "Flexidiscs zijn grammofoonplaten die zijn gemaakt van een dun, flexibel
#: DB:medium_format/name:76
msgctxt "medium_format"
msgid "Floppy Disk"
msgstr "Floppy"
msgstr "floppy"

#: DB:gender/description:4
msgctxt "gender"
Expand Down Expand Up @@ -3203,7 +3203,7 @@ msgid ""
"Island is used for islands and atolls which don't form subdivisions of their"
" own, e.g. Skye. These are not considered when displaying the parent areas "
"for a given area."
msgstr "Eiland wordt gebruikt voor eilanden en atollen die geen eigen subdivisie vormen, zoals het Britse eiland Skye. Eilanden worden niet getoond als bovenliggende gebieden van andere gebieden."
msgstr "Eiland wordt gebruikt voor eilanden en atollen die geen eigen onderafdeling vormen, zoals het Britse eiland Skye. Eilanden worden niet getoond als bovenliggende gebieden van andere gebieden."

#: DB:work_attribute_type/name:3
msgctxt "work_attribute_type"
Expand Down Expand Up @@ -5703,7 +5703,7 @@ msgctxt "medium_format"
msgid ""
"Shellac records were the most predominant type of gramophone record during "
"the first half of the 20th century."
msgstr "De schellakplaat was het meest voorkomende type grammofoonplaat tijdens de eerste helft van de twintigste eeuw."
msgstr "De schellakplaat was tijdens de eerste helft van de twintigste eeuw het meest voorkomende type grammofoonplaat."

#: DB:work_attribute_type_allowed_value/value:236
msgctxt "work_attribute_type_allowed_value"
Expand Down

0 comments on commit 263e7ff

Please sign in to comment.