You can do it with php using the code below.

../Per

 

<?php

include 'wp-config.php';

$mofile = dirname(__FILE__) . '/nb_NO.mo';

 

if ( is_readable($mofile)) {

     $input = new CachedFileReader($mofile);

     $mo2po = new gettext_reader($input);

     $mo2po->load_tables();

     echo "<xmp>"; // I know that xmp is officially deprecated , but it works ;)

     foreach ($mo2po->cache_translations as $msgid => $msgstr) {

          echo "\n";

          if ($msgid == "") {

                echo 'msgid ""' . "\n";

                echo 'msgstr ""' . "\n";                 

                foreach (split("\n",$msgstr) as $val) {

                     if ($val != "")

                          echo '"' . $val . '\n"' . "\n";

                }

          } else {

                echo 'msgid "' . $msgid . '"' . "\n";

                echo 'msgstr "' . $msgstr . '"' . "\n";

          }

     }   

     echo "</xmp>";

} else {

     echo 'ERROR: file not readable: ' . $mofile;

}

?>

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of René Clausen Nielsen
Sent: 24. juli 2006 18:13
To: [email protected]
Subject: RE: [wp-polyglots] .mo to .po

 

Brilliant. That worked like a charm.

 

Being a complete moron when it comes to something than cannot be clicked, I had to give it a few tries, though. So, for future reference:

 

In the command promt, it should look a bit like this: ‘C:\Program Files\poEdit\bin> msgunfmt [path_to _file.mo] > [path_to_file.po]’.

 

Cheers matie,

 

René

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Seok-moon Jang
Sent: 24. juli 2006 17:36
To: [email protected]
Subject: Re: [wp-polyglots] .mo to .po

 

There is msgunfmt in poedit installer for windows

Default Installation directory is C:\Program Files\poedit.

You can find this program at C:\Program Files\poedit\bin.

 

In command windows(cmd.exe for WIN XP), run next command.

 

C:\>msgunfmt YourLanguage.mo > YourLanguage.po

 

If you want to recompile to .mo, you can use msgfmt at same directory with msgunfmt.

 

 

PS. sorry for using poor english.

 

----- Original Message -----

Sent: Monday, July 24, 2006 10:33 PM

Subject: [wp-polyglots] .mo to .po

 

Hi List,

 

Anybody know if it possible to convert a .mo to .po? I seem to have forgotten where I put the .po file in the first instance and now that I want to update the language file, I can only seem to find the .mo in use. Bugger.

 

I am working on a Windoze PC.

 

Regards,

 

René


_______________________________________________
wp-polyglots mailing list
[email protected]
http://lists.automattic.com/mailman/listinfo/wp-polyglots

 


I am using the free version of SPAMfighter for private users.
It has removed 2706 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!

_______________________________________________
wp-polyglots mailing list
[email protected]
http://lists.automattic.com/mailman/listinfo/wp-polyglots

Reply via email to