GithubHelp home page GithubHelp logo

seanhennig / gettext-php-scanner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eslam-mahmoud/gettext-php-scanner

0.0 1.0 0.0 173 KB

Scan php files/project and create .po file, used for localization. It will extract all strings like __('txt').

PHP 100.00%

gettext-php-scanner's Introduction

GetText PHP scanner

Created by Eslam Mahmoud http://eslam.me [email protected]

Description

PHP class to scan files/project and create or update .po file, used for localization. Could be used to scan any type of files, It will extract all strings like __('Hello World') Or _e("Hello again.").

Configuration

  • $directory to be scanned accept array of directories or single string directory
  • $file_extensions an array of allowed files extensions to be scanned

How to use it?

    //Example of how to use this class
    require_once './gettext.php';
    $gettext = new gettext();
    $lines = $gettext->scan_dir();
    echo count($lines) . ' lines have been collected and need to be translated <br>';
    
    if ($gettext->create_po($lines))
        echo '"' . $gettext->file_name . '" file has been created in the same directory of this script find it at <a href="' . $gettext->file_name . '">download ' . $gettext->file_name . '</a>';
    else
        echo 'Error could not create the file please check if you have the right permissions';

gettext-php-scanner's People

Contributors

eslam-mahmoud 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.