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,129
    1,634
    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

    Top Bottom