#metabrainz

/

      • yvanzo[m]
        It should do lp instead.
      • reosarevok[m]
        lp doesn't help unless we hardcode the context keys, does it
      • yvanzo[m]
        Yes you need the context key too.
      • bitmap[m]
        you can override l_edit_name in the classes where the context differs from the standard 'edit type'
      • reosarevok[m]
        I'm probably being stupid but, if edit_name is N_lp, shouldn't that already be a translated string anyway?
      • bitmap[m]
        the no-op functions just return back the English string that was passed in
      • reosarevok[m]
        Oh, those were just for gettext to extract it, weren't they
      • Can we move away from gettext soon? :p
      • bitmap[m]
        yeah, I assume they aren't just using lp directly because we actually use the English names somewhere?
      • reosarevok[m]
        No clue...
      • yvanzo[m]
        We have context keys for all edit names.
      • reosarevok[m]
        Yes, but most are just 'edit type' so bitmap is right that can be the default and be overrode when needed
      • bitmap[m]
        reosarevok[m]: I think /doc/Edit_Types uses the English `edit_name` for the paths, at least
      • yvanzo[m]
        bitmap[m]: Not sure to follow
      • PrathamGupta[m]
        monkey: I changed the API_URL from api.listenbrainz to localhost:8100 and can create the playlists now. But on clicking on the playlist, I am getting a internal server error.
      • PrathamGupta[m] uploaded an image: (23KiB) < https://matrix.chatbrainz.org/_matrix/media/v3/download/matrix.org/QpPjkExZhXtxcsTSeRgldnXp/image.png >
      • bitmap[m]
        yvanzo[m]: I just meant that there's no reason `edit_name` can't simply use `lp` (as these functions are executed after the translation is already set), unless we actually use the English names.
      • yvanzo[m]
        Right, I don’t see any such reason or use of English names either.
      • bitmap[m]
        The /doc/Edit_Types case I identified was https://github.com/metabrainz/musicbrainz-serve... but I'm a bit confused about how this is used
      • reosarevok[m]
        Ooooh
      • That's the stupid wiki documentation feature
      • Isn't it?
      • We literally only use it there as a test because I found out it exists IIRC, so if so I'd get rid and use lp tbh
      • bitmap[m]
        yeah, looks like it uses the English name to request the Wiki page, but is it actually used?
      • reosarevok[m]
        Well, it is on that one page I just linked 😅
      • yvanzo[m]
        This has been changed from l to N_l a long time ago without explaining why: https://github.com/metabrainz/musicbrainz-serve...
      • reosarevok[m]
        I think we don't use it elsewhere
      • The reason is probably for consistency with other names which use l_whatever? That's all I can think of, unless they were thinking of this obscure feature but the commit message would probably mention it then?
      • bitmap[m]
        yvanzo[m]: I guess in theory it makes sense for `edit_name` to return the source string if `l_edit_name` exists (but perhaps there is no reason to separate them)
      • I didn't review every use of `->edit_name` or `.edit_name` in the server code or templates to make sure the translated versions can be used
      • reosarevok[m]
        We're barely using l_edit_name right now, in any case
      • TO_JSON passes edit_name which then we just do l() on
      • yvanzo[m]
        Or just factorize the context key with an edit_type_name_context set to edit_type by default, and overridden when needed. That’s almost the initial proposition with fewer need for local changes.
      • reosarevok[m]
        So either we actually pass and use l_edit_name, or we factorize context
      • (and pass it to JS too)
      • Or we do a combination, factorizing context but using it just for l_edit_name and then passing that to TO_JSON
      • We do use edit_name on getEditHeaderClass, I forget how we use that
      • But maybe passing a separate l_edit_name is the cleanest
      • bitmap[m]
        I've generally avoided outputting translated strings from TO_JSON but not opposed to using it here
      • reosarevok[m]
        I mean, I'm fine with outputting the context and doing lp on JS if that seems cleaner
      • bitmap[m]
        (I guess because I'd eventually prefer if we only had to maintain one translations implementation.)
      • reosarevok[m]
        But one of the two needs to be on TO_JSON
      • Unless I'm missing a solution
      • bitmap[m]
        if it's easy to do the lp in JavaScript, let's do that then? :)
      • reosarevok[m]
        In theory, it should be, if I pass and override context
      • I guess `edit_type_name_context` as yvanzo suggested, for clarity
      • And I'll change the N_lp calls to use edit_type_name_context, and define it as 'edit type' on Server::Edit overriding it only when needed
      • It does seem cleaner than now, at least
      • Plus it should work, which is a slight improvement
      • yvanzo[m]
        bitmap: Maybe I spoke too quickly about factorizing the context key, doesn’t `xgettext` needs the context key to be written out in full?
      • reosarevok[m]
        Well, worst case scenario I'll duplicate it
      • bitmap[m]
        yeah, it does, I assume we were still keeping the N_lp calls in the server for extraction
      • reosarevok[m]
        Yes, I was, but I was going to do N_lp('string', edit_type_name_context) - will that not work?
      • yvanzo[m]
        It won’t work indeed.
      • reosarevok[m]
        (well, self->edit_type_name_context or whatever)
      • bitmap[m]
        oh sorry I misunderstood that, yes you're right
      • reosarevok[m]
        shift, whatnot :)
      • Hmmm. So I need to duplicate the context?
      • Not the end of the world, but if so, when do we move away from this?
      • yvanzo[m]
      • Yes, it has to be duplicated if you also want to pass it through JSON.
      • Context keys are already duplicated for autoditor election status for example.
      • bitmap[m]
        reosarevok[m]: if we don't have any necessary uses of `edit_name` on the server, we could eventually define the strings in JavaScript rather than Perl
      • yvanzo[m]
        we could also move this data to a table
      • well, there are plenty of long term options, but duplicating it in the same file isn’t the most severe issue for now :)
      • reosarevok[m]
        Yeah, will do that
      • bitmap[m]
        in JavaScript this isn't really an issue because N_lp returns a function that preserves the context :) in Perl it just returns the source string
      • reosarevok[m]
        Heh
      • reosarevok[m] sent a code block: https://matrix.chatbrainz.org/_matrix/media/v3/download/chatbrainz.org/kfjRtEWkkkrQlXslKLegppEe
      • Fix one thing, find one thing, repeat...
      • BrainzGit
        [musicbrainz-server] 14reosarevok merged pull request #3302 (03master…fix-fullexport): Fix oversights when exporting all tables https://github.com/metabrainz/musicbrainz-serve...
      • aerozol[m]
        Happy Matariki everyone! Today, just before the sun rises, we welcome the Matariki star cluster (the star Matariki and her star children), ideally with a cloud of steam from opening up our hangi (earth ovens) and beckoning in the new year with fresh food.
      • Now you know more about the Māori new year than most :P
      • Completely different note - I’ve started leaving thumbs up, hearts, rockets, so on, on PR’s and PR comments that catch my eye/are excellent + I happen to see. Is this an annoying distraction re. notifications? Or is it easily ignored by you devs and thus a welcome addition
      • bitmap[m]
        I've never gotten notifications for reactions on GitHub at least and am not distracted by them
      • BrainzGit
        [musicbrainz-server] 14reosarevok opened pull request #3303 (03master…MBS-13645): MBS-13645: Fix translations of edit type names https://github.com/metabrainz/musicbrainz-serve...
      • reosarevok[m]
        bitmap (and/or yvanzo) ^
      • Would be neat to put the fix on beta too
      • And then finally release it :)
      • aerozol: I like positive reactions. I also like fresh food and sunrises, but that's harder to send
      • So I'll settle for the reactions :D
      • yvanzo, bitmap: pushed the requested changes
      • BrainzGit
        [musicbrainz-server] 14reosarevok merged pull request #3303 (03master…MBS-13645): MBS-13645: Fix translations of edit type names https://github.com/metabrainz/musicbrainz-serve...
      • reosarevok[m]
        Ok, barring any new huge messes, I'll release beta then 😅🤞
      • Toasty joined the channel
      • BrainzGit
        [musicbrainz-server] 14reosarevok merged pull request #3292 (03master…mbs-13626): MBS-13626: Always link to correct edit note from timestamp https://github.com/metabrainz/musicbrainz-serve...
      • fletchto99 has quit
      • reosarevok[m]
        yvanzo: one thing I noticed that is annoying is that I'd want to show "Imágenes" for "Event art" in most places (we don't need to specify it's *Event* images on an event page tab for example) but there's a few places where I'd still need the distinction, like the added entities stats
      • Dunno about you in French
      • yvanzo[m]
        reosarevok: Do you have a link to the string?
      • reosarevok[m]
        No, I wasn't translating it right now, but it's the one I'm adding in https://github.com/metabrainz/musicbrainz-serve... (same applies to cover art though)
      • It feels a bit weird to add context there, how would that work... "singular, shows in the same section as 'cover art'" :D
      • fletchto99 joined the channel
      • Leftmost joined the channel
      • Leftmost has left the channel
      • yvanzo[m]
        It also feels a bit weird to have cover art and event art mixed with other entity types.
      • Maybe moving those as sub-rows of event/release would resolve both issues.
      • Kladky has quit
      • reosarevok[m]
        Hmm. My only worry is whether it would look like they are subsets, so releases they added and added art to?
      • But it might work 🤷‍♂️
      • Not that I'm going to look into it right now, but :)
      • Running tests on beta
      • Toasty has quit
      • Sigh. Selenium timed out
      • Well, probably still releasing, can always undo if something breaks horribly
      • Updating beta
      • Done
      • aerozol[m]
        Ahh, did some walkthroughs on adding events and adding event art, but my audio on my new mic is choppy. I tested before starting, but it only decided to fuck up during the actual take. It takes too much time to redo any time soon - so the question is: Better to have not-perfect youtube tutorials (still perfectly understandable, imo), or none at all?
      • minimal has quit