Giter VIP home page Giter VIP logo

php.mo's Introduction

php.mo 0.1

Converts gettext translation '.po' files to binary '.mo' files in PHP.

Usage:

php.mo is a couple of functions that take an input (.po) file and generate an output (.mo) file. Usage is easy:

<?php
    require('php-mo.php');
    phpmo_convert( 'input.po', [ 'output.mo' ] );
?>

Just like that. You can even leave the second parameter blank, and the output file will take the same filename as the input file, with a .mo extension.

I've double-checked the phpmo-generated .mo binary files with those generated by Poedit, and they seem to be identical - which leads me to believe that this is production-ready.

NB:

  • If no $output_file specified, output filename is same as $input_file (but .mo)
  • Returns true/false for success/failure
  • No warranty, but if it breaks, please let me know

Credit:

Based on php-msgfmt by Matthias Bauer (Copyright © 2007), a command-line PHP tool for converting .po files to .mo. (http://wordpress-soc-2007.googlecode.com/svn/trunk/moeffju/php-msgfmt/msgfmt.php)

License:

GPL v3 http://www.opensource.org/licenses/gpl-3.0.html

php.mo's People

Contributors

thetesttube avatar trubit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.