How can I create an .mo file for Wordpress












30















I have some .po files for Wordpress and i want to create .mo files.



How can i do this?










share|improve this question





























    30















    I have some .po files for Wordpress and i want to create .mo files.



    How can i do this?










    share|improve this question



























      30












      30








      30


      13






      I have some .po files for Wordpress and i want to create .mo files.



      How can i do this?










      share|improve this question
















      I have some .po files for Wordpress and i want to create .mo files.



      How can i do this?







      wordpress internationalization mo






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 4 '13 at 4:56









      Ionică Bizău

      57.2k56193340




      57.2k56193340










      asked Dec 21 '10 at 13:15









      PeterPeter

      3131713




      3131713
























          4 Answers
          4






          active

          oldest

          votes


















          47














          Linux



          In Linux, you can just run this in Terminal:



          msgcat yourFile.po | msgfmt -o generatedFile.mo -


          or



          msgfmt -o generatedFile.mo yourFile.po


          You can view more information about these commands by typing:



          man msgcat
          man msgfmt


          Mac OS X



          You can get msgcat/msgfmt (as above) either with Xcode or with brew install gettext.



          However, it will not add them to your path to avoid conflict with OS X's own gettext utility (says homebrew). You can either add it anyway by adding this to your bash_profile:



          export PATH=${PATH}:/usr/local/opt/gettext/bin


          Or otherwise if you only need msgcat/msgfmt you can use aliases. Just add these lines to your bash_profile:



          msgcat='/usr/local/opt/gettext/bin/msgcat'
          msgfmt='/usr/local/opt/gettext/bin/msgfmt'


          Hope this helps! (Thanks to Georgi Stoyanov!)



          Windows



          On windows you can install MinGW (Minimal GNU for Windows) you need to select mingw32-gettext (bin and dev) durring installation and msgfmt and msgcat exe files will be installed. By default in c:MinGWbin. In order to use this tools you need to add that directory to your PATH variable. You can do that from command line using:



          set PATH=%PATH%;c:MinGWbin


          or from Control Panel > System and Security > System > Advanced System Settings > Environment Variables.






          share|improve this answer


























          • No 'msgcat' or 'msgfmt' on Mac OS X Mavericks. Couldn't find it in brew search either. What OS/Terminal am I supposed to run that from ?

            – justnorris
            Feb 12 '14 at 17:56











          • @Norris I am a Linux user. I don't have a Mac to be able to test it, but this will help you.

            – Ionică Bizău
            Feb 12 '14 at 18:23











          • Author of the "Msgcat and Mac OS X" post here. To clarify, my post was about using the Tcl package msgcat, not installing the command line tools discussed here, so it might not be much help.

            – anoved
            Feb 14 '14 at 23:16











          • I was just upset because the answer threw me of when I discovered that it's a Linux specific command. Now that the answer mentions it I'm all right :)

            – justnorris
            Feb 15 '14 at 10:59











          • If someone has a solution for Mac OS X/Windows is free to edit the answer or to leave a comment here.

            – Ionică Bizău
            Feb 16 '14 at 10:20



















          6














          If you have opened POedit, then select language in which to translate and click on ok, then it fetch all the items/strings where __ or _e functions were applied to be translated. Just translate them and do these steps like go to catalog select update from sources and then save current catalog. MO file generated/updated successfully.



          Regards,
          Zubair Khan






          share|improve this answer































            4














            Generally, you could run the .po file through a tool like pocompile. Some editors are a bit more comfortable, for example, Poedit can compile .mo files automatically. :)






            share|improve this answer



















            • 2





              Thanks. I have opened poedit but i dont know how it generates me the .mo files. can you giv eme some tipps?

              – Peter
              Dec 21 '10 at 13:28





















            2














            See http://codex.wordpress.org/WordPress_Localization WordPress in Your Language « WordPress Codex and http://codex.wordpress.org/Files_For_Direct_Translation Files For Direct Translation « WordPress Codex and http://codex.wordpress.org/I18n_for_WordPress_Developers I18n for WordPress Developers « WordPress Codex






            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4499622%2fhow-can-i-create-an-mo-file-for-wordpress%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              47














              Linux



              In Linux, you can just run this in Terminal:



              msgcat yourFile.po | msgfmt -o generatedFile.mo -


              or



              msgfmt -o generatedFile.mo yourFile.po


              You can view more information about these commands by typing:



              man msgcat
              man msgfmt


              Mac OS X



              You can get msgcat/msgfmt (as above) either with Xcode or with brew install gettext.



              However, it will not add them to your path to avoid conflict with OS X's own gettext utility (says homebrew). You can either add it anyway by adding this to your bash_profile:



              export PATH=${PATH}:/usr/local/opt/gettext/bin


              Or otherwise if you only need msgcat/msgfmt you can use aliases. Just add these lines to your bash_profile:



              msgcat='/usr/local/opt/gettext/bin/msgcat'
              msgfmt='/usr/local/opt/gettext/bin/msgfmt'


              Hope this helps! (Thanks to Georgi Stoyanov!)



              Windows



              On windows you can install MinGW (Minimal GNU for Windows) you need to select mingw32-gettext (bin and dev) durring installation and msgfmt and msgcat exe files will be installed. By default in c:MinGWbin. In order to use this tools you need to add that directory to your PATH variable. You can do that from command line using:



              set PATH=%PATH%;c:MinGWbin


              or from Control Panel > System and Security > System > Advanced System Settings > Environment Variables.






              share|improve this answer


























              • No 'msgcat' or 'msgfmt' on Mac OS X Mavericks. Couldn't find it in brew search either. What OS/Terminal am I supposed to run that from ?

                – justnorris
                Feb 12 '14 at 17:56











              • @Norris I am a Linux user. I don't have a Mac to be able to test it, but this will help you.

                – Ionică Bizău
                Feb 12 '14 at 18:23











              • Author of the "Msgcat and Mac OS X" post here. To clarify, my post was about using the Tcl package msgcat, not installing the command line tools discussed here, so it might not be much help.

                – anoved
                Feb 14 '14 at 23:16











              • I was just upset because the answer threw me of when I discovered that it's a Linux specific command. Now that the answer mentions it I'm all right :)

                – justnorris
                Feb 15 '14 at 10:59











              • If someone has a solution for Mac OS X/Windows is free to edit the answer or to leave a comment here.

                – Ionică Bizău
                Feb 16 '14 at 10:20
















              47














              Linux



              In Linux, you can just run this in Terminal:



              msgcat yourFile.po | msgfmt -o generatedFile.mo -


              or



              msgfmt -o generatedFile.mo yourFile.po


              You can view more information about these commands by typing:



              man msgcat
              man msgfmt


              Mac OS X



              You can get msgcat/msgfmt (as above) either with Xcode or with brew install gettext.



              However, it will not add them to your path to avoid conflict with OS X's own gettext utility (says homebrew). You can either add it anyway by adding this to your bash_profile:



              export PATH=${PATH}:/usr/local/opt/gettext/bin


              Or otherwise if you only need msgcat/msgfmt you can use aliases. Just add these lines to your bash_profile:



              msgcat='/usr/local/opt/gettext/bin/msgcat'
              msgfmt='/usr/local/opt/gettext/bin/msgfmt'


              Hope this helps! (Thanks to Georgi Stoyanov!)



              Windows



              On windows you can install MinGW (Minimal GNU for Windows) you need to select mingw32-gettext (bin and dev) durring installation and msgfmt and msgcat exe files will be installed. By default in c:MinGWbin. In order to use this tools you need to add that directory to your PATH variable. You can do that from command line using:



              set PATH=%PATH%;c:MinGWbin


              or from Control Panel > System and Security > System > Advanced System Settings > Environment Variables.






              share|improve this answer


























              • No 'msgcat' or 'msgfmt' on Mac OS X Mavericks. Couldn't find it in brew search either. What OS/Terminal am I supposed to run that from ?

                – justnorris
                Feb 12 '14 at 17:56











              • @Norris I am a Linux user. I don't have a Mac to be able to test it, but this will help you.

                – Ionică Bizău
                Feb 12 '14 at 18:23











              • Author of the "Msgcat and Mac OS X" post here. To clarify, my post was about using the Tcl package msgcat, not installing the command line tools discussed here, so it might not be much help.

                – anoved
                Feb 14 '14 at 23:16











              • I was just upset because the answer threw me of when I discovered that it's a Linux specific command. Now that the answer mentions it I'm all right :)

                – justnorris
                Feb 15 '14 at 10:59











              • If someone has a solution for Mac OS X/Windows is free to edit the answer or to leave a comment here.

                – Ionică Bizău
                Feb 16 '14 at 10:20














              47












              47








              47







              Linux



              In Linux, you can just run this in Terminal:



              msgcat yourFile.po | msgfmt -o generatedFile.mo -


              or



              msgfmt -o generatedFile.mo yourFile.po


              You can view more information about these commands by typing:



              man msgcat
              man msgfmt


              Mac OS X



              You can get msgcat/msgfmt (as above) either with Xcode or with brew install gettext.



              However, it will not add them to your path to avoid conflict with OS X's own gettext utility (says homebrew). You can either add it anyway by adding this to your bash_profile:



              export PATH=${PATH}:/usr/local/opt/gettext/bin


              Or otherwise if you only need msgcat/msgfmt you can use aliases. Just add these lines to your bash_profile:



              msgcat='/usr/local/opt/gettext/bin/msgcat'
              msgfmt='/usr/local/opt/gettext/bin/msgfmt'


              Hope this helps! (Thanks to Georgi Stoyanov!)



              Windows



              On windows you can install MinGW (Minimal GNU for Windows) you need to select mingw32-gettext (bin and dev) durring installation and msgfmt and msgcat exe files will be installed. By default in c:MinGWbin. In order to use this tools you need to add that directory to your PATH variable. You can do that from command line using:



              set PATH=%PATH%;c:MinGWbin


              or from Control Panel > System and Security > System > Advanced System Settings > Environment Variables.






              share|improve this answer















              Linux



              In Linux, you can just run this in Terminal:



              msgcat yourFile.po | msgfmt -o generatedFile.mo -


              or



              msgfmt -o generatedFile.mo yourFile.po


              You can view more information about these commands by typing:



              man msgcat
              man msgfmt


              Mac OS X



              You can get msgcat/msgfmt (as above) either with Xcode or with brew install gettext.



              However, it will not add them to your path to avoid conflict with OS X's own gettext utility (says homebrew). You can either add it anyway by adding this to your bash_profile:



              export PATH=${PATH}:/usr/local/opt/gettext/bin


              Or otherwise if you only need msgcat/msgfmt you can use aliases. Just add these lines to your bash_profile:



              msgcat='/usr/local/opt/gettext/bin/msgcat'
              msgfmt='/usr/local/opt/gettext/bin/msgfmt'


              Hope this helps! (Thanks to Georgi Stoyanov!)



              Windows



              On windows you can install MinGW (Minimal GNU for Windows) you need to select mingw32-gettext (bin and dev) durring installation and msgfmt and msgcat exe files will be installed. By default in c:MinGWbin. In order to use this tools you need to add that directory to your PATH variable. You can do that from command line using:



              set PATH=%PATH%;c:MinGWbin


              or from Control Panel > System and Security > System > Advanced System Settings > Environment Variables.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Aug 15 '17 at 17:56









              jcubic

              33.3k29121223




              33.3k29121223










              answered Aug 2 '13 at 14:19









              Ionică BizăuIonică Bizău

              57.2k56193340




              57.2k56193340













              • No 'msgcat' or 'msgfmt' on Mac OS X Mavericks. Couldn't find it in brew search either. What OS/Terminal am I supposed to run that from ?

                – justnorris
                Feb 12 '14 at 17:56











              • @Norris I am a Linux user. I don't have a Mac to be able to test it, but this will help you.

                – Ionică Bizău
                Feb 12 '14 at 18:23











              • Author of the "Msgcat and Mac OS X" post here. To clarify, my post was about using the Tcl package msgcat, not installing the command line tools discussed here, so it might not be much help.

                – anoved
                Feb 14 '14 at 23:16











              • I was just upset because the answer threw me of when I discovered that it's a Linux specific command. Now that the answer mentions it I'm all right :)

                – justnorris
                Feb 15 '14 at 10:59











              • If someone has a solution for Mac OS X/Windows is free to edit the answer or to leave a comment here.

                – Ionică Bizău
                Feb 16 '14 at 10:20



















              • No 'msgcat' or 'msgfmt' on Mac OS X Mavericks. Couldn't find it in brew search either. What OS/Terminal am I supposed to run that from ?

                – justnorris
                Feb 12 '14 at 17:56











              • @Norris I am a Linux user. I don't have a Mac to be able to test it, but this will help you.

                – Ionică Bizău
                Feb 12 '14 at 18:23











              • Author of the "Msgcat and Mac OS X" post here. To clarify, my post was about using the Tcl package msgcat, not installing the command line tools discussed here, so it might not be much help.

                – anoved
                Feb 14 '14 at 23:16











              • I was just upset because the answer threw me of when I discovered that it's a Linux specific command. Now that the answer mentions it I'm all right :)

                – justnorris
                Feb 15 '14 at 10:59











              • If someone has a solution for Mac OS X/Windows is free to edit the answer or to leave a comment here.

                – Ionică Bizău
                Feb 16 '14 at 10:20

















              No 'msgcat' or 'msgfmt' on Mac OS X Mavericks. Couldn't find it in brew search either. What OS/Terminal am I supposed to run that from ?

              – justnorris
              Feb 12 '14 at 17:56





              No 'msgcat' or 'msgfmt' on Mac OS X Mavericks. Couldn't find it in brew search either. What OS/Terminal am I supposed to run that from ?

              – justnorris
              Feb 12 '14 at 17:56













              @Norris I am a Linux user. I don't have a Mac to be able to test it, but this will help you.

              – Ionică Bizău
              Feb 12 '14 at 18:23





              @Norris I am a Linux user. I don't have a Mac to be able to test it, but this will help you.

              – Ionică Bizău
              Feb 12 '14 at 18:23













              Author of the "Msgcat and Mac OS X" post here. To clarify, my post was about using the Tcl package msgcat, not installing the command line tools discussed here, so it might not be much help.

              – anoved
              Feb 14 '14 at 23:16





              Author of the "Msgcat and Mac OS X" post here. To clarify, my post was about using the Tcl package msgcat, not installing the command line tools discussed here, so it might not be much help.

              – anoved
              Feb 14 '14 at 23:16













              I was just upset because the answer threw me of when I discovered that it's a Linux specific command. Now that the answer mentions it I'm all right :)

              – justnorris
              Feb 15 '14 at 10:59





              I was just upset because the answer threw me of when I discovered that it's a Linux specific command. Now that the answer mentions it I'm all right :)

              – justnorris
              Feb 15 '14 at 10:59













              If someone has a solution for Mac OS X/Windows is free to edit the answer or to leave a comment here.

              – Ionică Bizău
              Feb 16 '14 at 10:20





              If someone has a solution for Mac OS X/Windows is free to edit the answer or to leave a comment here.

              – Ionică Bizău
              Feb 16 '14 at 10:20













              6














              If you have opened POedit, then select language in which to translate and click on ok, then it fetch all the items/strings where __ or _e functions were applied to be translated. Just translate them and do these steps like go to catalog select update from sources and then save current catalog. MO file generated/updated successfully.



              Regards,
              Zubair Khan






              share|improve this answer




























                6














                If you have opened POedit, then select language in which to translate and click on ok, then it fetch all the items/strings where __ or _e functions were applied to be translated. Just translate them and do these steps like go to catalog select update from sources and then save current catalog. MO file generated/updated successfully.



                Regards,
                Zubair Khan






                share|improve this answer


























                  6












                  6








                  6







                  If you have opened POedit, then select language in which to translate and click on ok, then it fetch all the items/strings where __ or _e functions were applied to be translated. Just translate them and do these steps like go to catalog select update from sources and then save current catalog. MO file generated/updated successfully.



                  Regards,
                  Zubair Khan






                  share|improve this answer













                  If you have opened POedit, then select language in which to translate and click on ok, then it fetch all the items/strings where __ or _e functions were applied to be translated. Just translate them and do these steps like go to catalog select update from sources and then save current catalog. MO file generated/updated successfully.



                  Regards,
                  Zubair Khan







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 28 '11 at 9:43









                  zubairzubair

                  6112




                  6112























                      4














                      Generally, you could run the .po file through a tool like pocompile. Some editors are a bit more comfortable, for example, Poedit can compile .mo files automatically. :)






                      share|improve this answer



















                      • 2





                        Thanks. I have opened poedit but i dont know how it generates me the .mo files. can you giv eme some tipps?

                        – Peter
                        Dec 21 '10 at 13:28


















                      4














                      Generally, you could run the .po file through a tool like pocompile. Some editors are a bit more comfortable, for example, Poedit can compile .mo files automatically. :)






                      share|improve this answer



















                      • 2





                        Thanks. I have opened poedit but i dont know how it generates me the .mo files. can you giv eme some tipps?

                        – Peter
                        Dec 21 '10 at 13:28
















                      4












                      4








                      4







                      Generally, you could run the .po file through a tool like pocompile. Some editors are a bit more comfortable, for example, Poedit can compile .mo files automatically. :)






                      share|improve this answer













                      Generally, you could run the .po file through a tool like pocompile. Some editors are a bit more comfortable, for example, Poedit can compile .mo files automatically. :)







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Dec 21 '10 at 13:21









                      hangyhangy

                      9,19553660




                      9,19553660








                      • 2





                        Thanks. I have opened poedit but i dont know how it generates me the .mo files. can you giv eme some tipps?

                        – Peter
                        Dec 21 '10 at 13:28
















                      • 2





                        Thanks. I have opened poedit but i dont know how it generates me the .mo files. can you giv eme some tipps?

                        – Peter
                        Dec 21 '10 at 13:28










                      2




                      2





                      Thanks. I have opened poedit but i dont know how it generates me the .mo files. can you giv eme some tipps?

                      – Peter
                      Dec 21 '10 at 13:28







                      Thanks. I have opened poedit but i dont know how it generates me the .mo files. can you giv eme some tipps?

                      – Peter
                      Dec 21 '10 at 13:28













                      2














                      See http://codex.wordpress.org/WordPress_Localization WordPress in Your Language « WordPress Codex and http://codex.wordpress.org/Files_For_Direct_Translation Files For Direct Translation « WordPress Codex and http://codex.wordpress.org/I18n_for_WordPress_Developers I18n for WordPress Developers « WordPress Codex






                      share|improve this answer




























                        2














                        See http://codex.wordpress.org/WordPress_Localization WordPress in Your Language « WordPress Codex and http://codex.wordpress.org/Files_For_Direct_Translation Files For Direct Translation « WordPress Codex and http://codex.wordpress.org/I18n_for_WordPress_Developers I18n for WordPress Developers « WordPress Codex






                        share|improve this answer


























                          2












                          2








                          2







                          See http://codex.wordpress.org/WordPress_Localization WordPress in Your Language « WordPress Codex and http://codex.wordpress.org/Files_For_Direct_Translation Files For Direct Translation « WordPress Codex and http://codex.wordpress.org/I18n_for_WordPress_Developers I18n for WordPress Developers « WordPress Codex






                          share|improve this answer













                          See http://codex.wordpress.org/WordPress_Localization WordPress in Your Language « WordPress Codex and http://codex.wordpress.org/Files_For_Direct_Translation Files For Direct Translation « WordPress Codex and http://codex.wordpress.org/I18n_for_WordPress_Developers I18n for WordPress Developers « WordPress Codex







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 21 '10 at 15:10









                          markratledgemarkratledge

                          14.6k94595




                          14.6k94595






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4499622%2fhow-can-i-create-an-mo-file-for-wordpress%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Monofisismo

                              Angular Downloading a file using contenturl with Basic Authentication

                              Olmecas