Giter VIP home page Giter VIP logo

poparser's Introduction

Max Grigorian

Passionate developer, paranoid in self-improvement.

More than 15 years of programming experience.

Symfony framework fan and SymfonyCon attendee.

Skills

  • PHP 5/7/8, Symfony 2-7, Silex, Doctrine2, OOP, DI, Patterns
  • HTML 4/5, CSS 2/3, LESS, SASS
  • JavaScript, Vue 2, NUXT, Angular, jQuery, JSON, Google Maps API
  • MODx, Joomla, Opencart, Wordpress
  • MySQL, MongoDB, ValentinaDB
  • Memcached
  • Sphinx
  • Git, Subversion
  • Jenkins
  • Grunt, Webpack, Phing, Capistrano
  • PHPUnit, Codeception, Karma
  • Composer, npm, yarn, bower
  • Apache, Nginx
  • Vagrant, Docker
  • JIRA, Mantis, Redmine
  • Mac OS X, Linux, Unix, Windows

Github Stats

show MAXakaWIZARD's Github Stats

Contacts:

YouTube Twitter LinkedIn Instagram

poparser's People

Contributors

dhm80 avatar maxakawizard avatar timesplinter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

poparser's Issues

Parser eats leading and trailing " in comments

Given file foo.po

# "Bar" Something about "Foo"
msgid "Foo"
msgstr "Fop"

Running quotes.php over it (which doesn't change anything of the file itself):

<?php

require_once 'vendor/autoload.php';

$parser = new PoParser\Parser();
$parser->read("foo.po");
$parser->write("foo.po");

Results in:

# Bar" Something about "Foo
msgid "Foo"
msgstr "Fop"

And seemingly the trailing newline too...

diff --git a/locale/foo.po b/locale/foo.po
index 26d2324..1a38546 100644
--- a/locale/foo.po
+++ b/locale/foo.po
@@ -1,3 +1,3 @@
-# "Bar" Something about "Foo"
+# Bar" Something about "Foo
 msgid "Foo"
-msgstr "Fop"
+msgstr "Fop"
\ No newline at end of file

All together:

$ cat foo.po 
# "Bar" Something about "Foo"
msgid "Foo"
msgstr "Fop"
$ cat quotes.php 
<?php

require_once 'vendor/autoload.php';

$parser = new PoParser\Parser();
$parser->read("foo.po");
$parser->write("foo.po");
$ php quotes.php 
$ cat foo.po 
# Bar" Something about "Foo
msgid "Foo"
msgstr "Fop"$

Creation of tag 1.2.2

Hello Max,

with this issue I would like to ask you to create a new tag called "1.2.2" before the "1.3.0" tag.
Could you create this tag, please?

You can use: "git tag 1.2.2 f229850"
This commit is the last before 2020 (2016).

Currently I am using PHP 5.* and I am not able to upgrade PHP as fast as possible. Thats the reason why I have to use a 1.2.* version. There are some commits between 1.2.1 and 1.3.0 that I need but can not use in case of the missing tag.

I am looking forward to hearing from you. Thank you for your help and time.

Kind regards
Lukas Rühl

Unattached quotes cause undefined array key spam

When reading a file with a comment not attached to a translation block, there logs get spammy

foo.po

# Foo
msgid "Foo"
msgstr "Fop"

# foo

comments.php

<?php

require_once 'vendor/autoload.php';

$parser = new PoParser\Parser();
$parser->read("foo.po");
$ php comments.php 
PHP Warning:  Undefined array key "msgid" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Parser.php on line 340
PHP Warning:  Undefined array key "msgid" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Parser.php on line 340
PHP Warning:  Undefined array key "msgid" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Parser.php on line 340
PHP Warning:  Undefined array key "msgid" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Parser.php on line 340
PHP Warning:  Undefined array key "msgid" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Entry.php on line 70
PHP Warning:  Undefined array key "msgstr" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Entry.php on line 75

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.