Language Converter between MP1 and MP2 (1 Viewer)

huha

Extension Developer
January 3, 2008
890
556
Home Country
Germany Germany
I have written a simple language converter which you can use to translate language files between MP1 and MP2.
I originally used it to maintain a golden language source in MP1 and derive all MP2 language files.
Now I am using it more to get the transifex MP2 language files and reconvert it back into MP1.

The usage is very simple:
All .xml files from the Input folder will be converted into language files into the output folder. A backup is generated.

The Easter built MP2 did support the old MP2 language format (no more needed)

The source code is attached. I am not planning to support this program, but thaught it could be useful as is for others, too.

Just one more comment:
If you use a comment in yourMP1 language file
<!-- MP2STR:CreateTvWish -->
<String id="200">Create Tv Wish</String>

Then the string in MP2 will be for a plugin name "TvWishListMP2" TvWishListMP2.CreateTvWish and not
TvWishListMP2.200.

In also works the other way for a MP2 language file
<!-- MP1STR:200 -->
<string name="TvWishListMP2.CreateTvWish">Create Tv Wish</string>
the MP1 string will be 200.

The .exe program is in MP2LanguageConverter.Program.zip.

The source code is in MP2LanguageConverter.zip

Have fun, huha

Update: New version uploaded on 17. Sept. 2012

Update: New version uploaded on 05. Nov. .2012

Update: New version uploaded on 25.November 2012 and included Source Code for FillFromLanguageFile
 

Attachments

  • Program.JPG
    Program.JPG
    56.7 KB
  • MP2LanguageConverter.Program.zip
    8.1 KB
  • MP2LanguageConverter.zip
    307.6 KB
  • FillFromLanguageFile.zip
    75 KB
Last edited:

huha

Extension Developer
January 3, 2008
890
556
Home Country
Germany Germany
  • Thread starter
  • Moderator
  • #2
I updated the language converter for translating Transifex MP2 language files back to MP1 language files.
- the transifex line return will now be converted into 2 charcters "\n"
- updated the program to handle partial language files not fully translated
 

chefkoch

Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,130
    1,630
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    I updated the language converter for translating Transifex MP2 language files back to MP1 language files.
    - the transifex line return will now be converted into 2 charcters "\n"
    - updated the program to handle partial language files not fully translated
    We implemented some code in the TransifexHelper to apply some fixes after pulling translations from Transifex.
    Maybe this also helps you within the converter.
    https://github.com/MediaPortal/Medi...aPortal/Tools/TransifexHelper/Program.cs#L339
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #4
    I updated the language converter and added the conversion for \' as shown in the TransifexHelper program.
    chefkoch, I realized that the Transifex helper does not contain an encoding for the newline character from transifex, but you may not need this.
    I had to convert the transifex newline character 9166 by

    Char transifexreturnline_char = Convert.ToChar(9166);
    myline = myline.Replace(transifexreturnline_string, @"\n");

    Transifex will interprete in a string the two characters "\n" as a newline and convert it into a single character 9166.

    I also added a log file, a flexible input file and a silent mode.
    So the user can now enter
    MP2LanguageConverter.exe <inputfile> PROCESS

    Inputfile is the parameterfile and must have been generated by an old run of MP2LanguageConverter.exe, where the parameters are saved in MP2LanguageConverter.txt after exiting the program.
     

    huha

    Extension Developer
    January 3, 2008
    890
    556
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #5
    I did another minor update and included the source code for a small program to fill an incomplete MP2 language file with the missing strings from a golden resource.
    In the TvWishList Transifex Posting you can see an example for how to use these little programs to download the langugae files from transifex, convert into MP1 or MP2 language files and install it in the MP1 or MP2 or Tvserver plugin folders.
     
    Last edited:

    Users who are viewing this thread

    Similar threads

    Created ticket targeted for 2.4 release: [MP2-865] MP2-Server crashes if FileSystemWatcher is used for exFAT drives - MediaPortal Jira
    Created ticket targeted for 2.4 release: [MP2-865] MP2-Server crashes if FileSystemWatcher is used for exFAT drives - MediaPortal Jira
    Hi I really love MediaPortal and have been using MP1 for a long time. I'm setting up a new PC for a friend now and thought I'd...
    Replies
    10
    Views
    765
    Just for your information: couldn't find the ns*.tmp file...
    Just for your information: couldn't find the ns*.tmp file...
    Pre Releases are provided as a way for the community to test and give feedback on all the exciting things we have lined up for the...
    Replies
    39
    Views
    3K
    That's fun. I shattered my kneecap on one of those e-scooters. I'm terribly out of shape from the months of being bedridden. I didn't get fat, at least, but a walk in the park is not an expression of something being easy anymore.
    That's fun. I shattered my kneecap on one of those e-scooters. I'm terribly out of shape from the months of being bedridden. I...
    It seems odd that most of the problems that people complain about are that we can't switch to MP2 because there's no plugins for...
    Replies
    8
    Views
    1K
    There is currently only the reimport function, that can be used individually for media items, that were wrongly found or updated. There is no function yet to check, if the nfo content changed, it would take far too much time. But I'd also like a function to generally reimport all media items once again.
    There is currently only the reimport function, that can be used individually for media items, that were wrongly found or updated...
    G'day guys, I am looking forward to trying the next version of MP2 (new skin hopefully soon;)) and after trying previous versions...
    Replies
    7
    Views
    815
    It is looking and working very well now and I am almost at the point of switching my HTPC to MP2, madvr would definitely push me over the edge for sure.;)
    It is looking and working very well now and I am almost at the point of switching my HTPC to MP2, madvr would definitely push me...
    We are proud to present MediaPortal 2.3 MediaPortal 2.3 is a full-blown media center software that addresses the most common user...
    Replies
    4
    Views
    2K
    Top Bottom