GithubHelp home page GithubHelp logo

mbauro / po_import_export Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 39 KB

Importer and exporter for PO files

License: GNU General Public License v3.0

Go 100.00%
exporter importer poedit po-file-export po-file-import poedit-export poedit-import

po_import_export's Introduction

PO Import Export

PoImportExport is a tool which allows exporting a ".po" file, generated with PoEdit, into a file format like CSV or XLS and vice versa, i.e. importing a CSV/XLS file into a PO file.

N.B. Only import/export with CSV files is currently supported.

How does it work

For the export action, the tool expects a PO file, generated with PoEdit, containing the list of the original strings and their translations. The latter will be exported in another file whose format is specified by the user. In particular, the original strings will be put under the column key of the header while the translations will be placed under the column translation.

For the import action, the tool expects the path of a valid PO file and the path of a CSV file. The CSV file must contain a header row with two columns (key,translation) and then the list of the strings with their relative translations. For every row of the imported file, the tool will search if the value under the key column is contained in the PO file. If there's a match, in the PO file, for that specific key, will be added the value under the column translation.

N.B. You can find example files under the folder example

Get started

First build the project using the command:

go build github.com/Mbauro/Po_Import_Export/cmd/PoImportExport

Then you can run the project deciding which action to execute:

Export

To export a PO file into the desired file format (CSV/XLS ...) use the following command:

go run github.com/Mbauro/Po_Import_Export/cmd/PoImportExport -action export -e <poAbsoluteFilepath> -format csv

The exported file will be saved in the directory ./exportedFiles

If the argument -format is not provided, the file will be exported automatically in CSV

Import

To import a CSV/XLS file with translations into a PO file use the following command:

go run github.com/Mbauro/Po_Import_Export/cmd/PoImportExport -action import -i <translationsAbsoluteFilepath> -e <poAbsoluteFilepath> -format csv

The imported po files will be saved in the directory ./importedFiles

If the argument -format is not provided, the file will be exported automatically in CSV

po_import_export's People

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.