Author Topic: MusicBee *.lng file markup highlighting for Notepad++  (Read 39874 times)

Lakrits

  • Jr. Member
  • **
  • Posts: 62
Hi,

For all of you who use Notepad++ to edit and amend the MusicBee LNG file for your translations, I scribbled down an userDefineLang code that highlights the different parts of the LNG file in different colours. That has since been amended and hugely improved by Roadrunner (vielen Danke). You can download it from Imagenetz.de or, if that doesn't work, my Mediafire account. Both links are found at the bottom of this post. Note that it can only be used in full with Notepad++ version 6.2 or later.

Roadrunner's markup looks like this with the Swedish LNG file (Roadrunner's more elaborate screenshot in English is found in a post further down at this page):



The markup highlighting code may be altered in whatever way you see fit, and if you like your "design" better than mine (you can find it in this MediaFire folder) or Roadrunner's, just post it here for others to benefit from.

Cheers,

Lakrits

---

This is how you use it:

1. Download the ZIP file via the link below (under "Download the ZIP file") and unpack the file userDefineLang_MusicBeeLNG.xml

If you already have an userDefineLang.xml file (in C:\Program Files\Notepad++ or C:\Users\[username]\AppData\Roaming\Notepad++):

2. Open the files userDefineLang_MusicBeeLNG.xml and userDefineLang.xml in Notepad++
3. Copy everything from "<UserLang …" to "</UserLang>" (i.e. all except the "<NotepadPlus>" tags)
4. Paste it into your userDefineLang.xml file
5. Save the userDefineLang.xml file to C:\Users\[username]\AppData\Roaming\Notepad++ (or your equivalent folder)

If you don't have an userDefineLang.xml file:

2. Rename the file userDefineLang_MusicBeeLNG.xml to userDefineLang.xml (remove the "_MusicBeeLNG" part)
3. Save the userDefineLang.xml file to C:\Users\[username]\AppData\Roaming\Notepad++ (or your equivalent folder)

N.B.! You must restart Notepad++ to use (and see) the new language option, you find it at the bottom of the Language menu.

---

Download the ZIP file:

From Roadrunner:Imagenetz.de(for Notepad++ 6.2 and above)
Alternative link:Mediafire(for Notepad++ 6.2 and above)

(If you find the download page at Imagenetz.de a jumble of strange words, just ignore all German words and click on the English text "File download!". Apparently, it's a button :))

---

Notepad++:

You will need the text editor Notepad++ in order to use this markup highlighting code.

Download Notepad++.

---

About the Notepad++ user defined language:

Study the UDL 2.0 online documentation.
Last Edit: November 08, 2012, 09:34:10 PM by Lakrits
Spikar'u'nte inglish? Föredrar du helt enkelt svenska?

   Du hittar svenska språkfiler i den här tråden.
---
Non loqueris lingua Anglorum? Grammaticus fastuosus Oxbrigiae es?

  In hoc filum documenta linguae Latinae nancisceris.

Roadrunner

  • Sr. Member
  • ****
  • Posts: 373
Hi Lakrits

Great idea!

If you really want to remove the "highlighting bleeds", you could set the #-Colors in the "Keywords Lists" instead of the Delimiters:

Remove the #-delimiters,
mark "Ignore case" on the top,
"Prefix mode" in the 1st Group of the "Keywords Lists"
and enter the following keywords:
   #A #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T #U #V #W #X #Y #Z

Now it works as long, as no #-tag begins with a number and no plain text contains a letter after the #-sign... (at the moment it works perfectly)...

If you're interested, you could download the ZIP at:
http://www.uploadstube.de/download.php?file=871581

lnminente

  • Sr. Member
  • ****
  • Posts: 1049
For people having problems with C:\Users\[username]\AppData\Roaming\Notepad++ just use %APPDATA%\Notepad++
I use Notepad++ too. Thanks for your work guys

Lakrits

  • Jr. Member
  • **
  • Posts: 62
Hi Lakrits

Great idea!

If you really want to remove the "highlighting bleeds", you could set the #-Colors in the "Keywords Lists" instead of the Delimiters:

Remove the #-delimiters,
mark "Ignore case" on the top,
"Prefix mode" in the 1st Group of the "Keywords Lists"
and enter the following keywords:
   #A #B #C #D #E #F #G #H #I #J #K #L #M #N #O #P #Q #R #S #T #U #V #W #X #Y #Z

Now it works as long, as no #-tag begins with a number and no plain text contains a letter after the #-sign... (at the moment it works perfectly)...

If you're interested, you could download the ZIP at:
http://www.uploadstube.de/download.php?file=871581
Thanks  :)

I didn't understand anything of what you wrote, so I just downloaded the ZIP  ;D

Lakrits
Spikar'u'nte inglish? Föredrar du helt enkelt svenska?

   Du hittar svenska språkfiler i den här tråden.
---
Non loqueris lingua Anglorum? Grammaticus fastuosus Oxbrigiae es?

  In hoc filum documenta linguae Latinae nancisceris.

Roadrunner

  • Sr. Member
  • ****
  • Posts: 373
I didn't understand anything of what you wrote, so I just downloaded the ZIP  ;D
And if you compare your file to mine, the text above should be the difference... ::) ???
But the file speaks for itselves, so I'm stopping to write wrong English text :-X
Thx again for your good idea and for sharing it! :)

Lakrits

  • Jr. Member
  • **
  • Posts: 62
I didn't understand anything of what you wrote, so I just downloaded the ZIP  ;D
And if you compare your file to mine, the text above should be the difference... ::) ???
But the file speaks for itselves, so I'm stopping to write wrong English text :-X
Thx again for your good idea and for sharing it! :)
I don't know anything about coding. My file is the result of extensive trial-and-error. I see the differences, but I don't know what they actually do. But if you need any information on complex ecological landscape models, I'm your man.  :)

I first made this in order to adjust for my hyper-perceptiveness. I need structured input in my eyes and ears, since I can't filter out any excess information. Keeping the text black while colour coding the remaining text in subdued colours make me able to focus on the string itself.

I am grateful for all the modifications you make to my original jerry-rigged try! :)
Spikar'u'nte inglish? Föredrar du helt enkelt svenska?

   Du hittar svenska språkfiler i den här tråden.
---
Non loqueris lingua Anglorum? Grammaticus fastuosus Oxbrigiae es?

  In hoc filum documenta linguae Latinae nancisceris.

Roadrunner

  • Sr. Member
  • ****
  • Posts: 373
Hi all

Notepad++ with its new version 6.2 allows more detailed user defined languages. So I tried to meet the requirements for Music Bee language files better than before:

  • Blanks within keywords are now recognized (as they could appear in Theater Mode translations)
  • {}-placeholders are now orange, including the number between (before only the brackets have been red)
  • Alt-Tag letters with the preceding &-sign are red (If you need language specific letters like ç or Ø you can append them in the "Operators1"-Field, otherwise only the &-sign will be shown in red)
  • During translation work I use ??? together with a comment for text which are not already properly translated because of ambiguities, they are not clear enough at the moment or other reasons. This kind of comments are now red and bold, even if they appear within green comment lines. (Of course there shouldn't be any of these ???-comments left outside of line comments when you upload your translations ::) )

It could look like this:

   #Main.menu.SyDe#   Gerät synchronisieren
   !Main.menu.Sy0#    Synchronise {0}
   #Main.menu.Sy0#    {0} synchronisieren
   !Main.menu.AcAu#   Activate Auto-Shutdown
   #Main.menu.AcAu#   Automatisch herunterfahren...
   !Main.menu.Exit#   Exit
   #Main.menu.Exit#   Beenden     ??? temporary remark ???

   !Main.menu.Edit#   &Edit
   #Main.menu.Edit#   &Bearbeiten

Feel free to download this file here (zipped) and of course change colors or whatever to whatever you prefer... Don't forget to update Notepad++ to 6.2 or newer as well!

Regards, Roadrunner
Last Edit: October 27, 2012, 01:56:10 AM by Roadrunner

Lakrits

  • Jr. Member
  • **
  • Posts: 62
Das ist ein Superverbesserung!

I have updated the link in the first post to yours, to avoid any misclicking accidents. It's nice to see properly working highlighting. My version was hampered by the fact that I don't have any coding skills at all, with exception for:

10 PRINT LAKRITS
20 GOTO 1O
RUN

Thanks :)

P.S. There's a smiley for your inline commenting syntax:  ???
D.S.
Last Edit: October 27, 2012, 10:32:08 PM by Lakrits
Spikar'u'nte inglish? Föredrar du helt enkelt svenska?

   Du hittar svenska språkfiler i den här tråden.
---
Non loqueris lingua Anglorum? Grammaticus fastuosus Oxbrigiae es?

  In hoc filum documenta linguae Latinae nancisceris.

Roadrunner

  • Sr. Member
  • ****
  • Posts: 373
(If you find the download page a jumble of strange words, just ignore all German words and click on the English text "File download!". Apparently, it's a button :))
Sorry for that, this was deformation professionelle: Usually I load up language files for German speaking people only... And personally I use the plugin NoScript, which suppresses many of the "jumble of strange words".

I have updated the link in the first post to yours, to avoid any misclicking accidents. It's nice to see properly working highlighting. My version was hampered by the fact that I don't have any coding skills at all, with exception for:

10 PRINT LAKRITS
20 GOTO 1O
RUN

Thanks :)
P.S. There's a smiley for your inline commenting syntax:  ???
Du är välkommen. Before Notepad 6.2 it was not possible with just a simple description file and your program code might still be running, so cannot be all bad ;) . And the smiley for my ??? inline comment is quite suitable...

andrea.ippo

  • Guest
Thanks for this, it makes translating a lot easier!  :)

Maybe you could also publish it in the official np++ wiki for user defined language files, here's the how to:

http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files#Contributing_new_user_defined_language_files

Lakrits

  • Jr. Member
  • **
  • Posts: 62
Maybe you could also publish it in the official np++ wiki for user defined language files […]
I have thought about it, but decided against it. The reason is that the file extension LNG is too common as a language file extension. It is used by other software I translate in Notepad++, who use other syntax but still would load using this markup highlighting. So I would prefer if the MusicBee language file extension was changed into something more specific (e.g. MLF or MBL for "MusicBee language file", or something like that) before the markup highlighting file is uploaded to such a busy site as Notepad++: User Defined Language Files.

Lakrits
Spikar'u'nte inglish? Föredrar du helt enkelt svenska?

   Du hittar svenska språkfiler i den här tråden.
---
Non loqueris lingua Anglorum? Grammaticus fastuosus Oxbrigiae es?

  In hoc filum documenta linguae Latinae nancisceris.

Roadrunner

  • Sr. Member
  • ****
  • Posts: 373
Hi translators

I don't know how many of you let the original English text in the translated file as comment like me:

  !Main.menu.Sy0#    Synchronise {0}
   #Main.menu.Sy0#    {0} synchronisieren
   !Main.menu.AcAu#   Activate Auto-Shutdown
   #Main.menu.AcAu#   Automatisch herunterfahren...
Until now I copied the new tags line by line before translating and replaced in the first lines the "#"-sign by a "!". But it could be so simple with a regex replace, which is available in notepad++ as well. I saved the following replace command as a macro with shortcut:

   Find what: (^#)(.*$)
   Replace with: !\2\r\n\1\2
   Search mode: Regular expression

This could be run once (push "Replace All") over the new.txt file. That's it! Well, almost: The translation work has still to be done by yourselves ;)

By the way: If you're still using Notepad 6.2, it might be a good idea to update to the current version 6.5.5, which has an automatic word completion function.

Regards, Roadrunner
Last Edit: April 29, 2014, 10:32:14 AM by Roadrunner