GithubHelp home page GithubHelp logo

webhippie / po_to_json Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 10.0 62 KB

Ruby library for converting gettext PO files to JSON

Home Page: https://github.com/webhippie/po_to_json

License: MIT License

Ruby 93.30% Nix 6.70%
gettext i18n json ruby rubygem

po_to_json's Introduction

Website

General Workflow Join the Matrix chat at https://matrix.to/#/#webhippie:matrix.org Codacy Badge

Our general website, nothing fancy, just a plain landing page and really nothing more than that. You can wind it at webhippie.de

Hosting

The website is hosted on Netlify, the website gets automatically updated on every push to the master branch.

Install

This website uses the Hugo static site generator. If you are planning to contribute you'll want to download and install Hugo on your local machine. The installation of Hugo is out of the scope of this document, so please take the official install instructions to get Hugo up and running.

Development

To generate the website and serve it on localhost:1313 just execute this command and stop it with Ctrl+C:

make server

When you are done with your changes just create a pull request, after merging the pull request the website will be updated automatically.

Security

If you find a security issue please contact [email protected] first.

Contributing

Fork -> Patch -> Push -> Pull Request

Authors

License

CC-BY-SA-4.0

Copyright

Copyright (c) 2015 Thomas Boerger <[email protected]>

po_to_json's People

Contributors

chaomao avatar illiatdesdindes avatar lidaobing avatar nubis avatar renovate[bot] avatar tboerger avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

po_to_json's Issues

[feature requst] support generate pretty-print js files

currently, the generated js file is in one line, how about support pretty print format for this file, it has two pros

make the change more clearer in the version control system
use less space in the version control system
and because we are using asset pipeline, so the js can be compressed in the production server

New release

Hi, could we get a new release that includes #6 ? Thank you

Issue with JEB generation

I don't understand this part of the code:

  def build_trans
    buffer.each do |key, string|
      trans[$1.to_i] = string if key.to_s.match(/^msgstr_(\d+)/)
    end

    trans.unshift(detect_plural)
  end

Why is the plural put at the beginning, and not the end? I can't get anything to translate unless I change it to:

    def build_trans
      buffer.each do |key, string|
        trans[$1.to_i] = string if key.to_s.match(/^msgstr_(\d+)/)
      end

      trans.push(detect_plural)
    end

[Bug] should not escape double quote in msgid

Hi there
I found one issue, let me demonstrate what I found.

Behavior

If msgid contains double quote, method push_buffer will escape it then parsing. which mismatch the original msgid

let's say we have following msgid contains double quote, say "Hello"

msgid "contains double quote, say \"Hello\""
msgstr "contains double quote, say \"Hello\""

after parsing, content will be

{"contains double quote, say \\\"Hello\\\""=>["contains double quote, say \\\"Hello\\\""]}

the msgid are wrong contains double quote, say \"Hello\"

Analyze

in method push_buffer, value.gsub!(/\\"/, "\"") will trying to fix it, however method gsub will NOT modify the original string object, we should use gsub! instead.

I have create one pr #12 to fix the escape double quote issue, please review it :) @tboerger

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

bundler
Gemfile
github-actions
.github/workflows/automerge.yml
  • tibdex/github-app-token v2
  • dependabot/fetch-metadata v2
.github/workflows/flake.yml
  • tibdex/github-app-token v2
  • actions/checkout v4
  • cachix/install-nix-action v27
  • DeterminateSystems/update-flake-lock v23
.github/workflows/release.yml
  • actions/checkout v4
  • dawidd6/action-publish-gem v1
.github/workflows/testing.yml
  • actions/checkout v4
  • ruby/setup-ruby v1
  • actions/checkout v4
  • ruby/setup-ruby v1

  • Check this box to trigger a request for Renovate to run again on this repository

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.