Coder Social home page Coder Social logo

pedro-mendonca / gp-format-csv Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 2.72 MB

Adds the CSV format to @GlotPress to export/import translations and originals.

Home Page: https://wordpress.org/plugins/gp-format-csv/

License: GNU General Public License v2.0

PHP 100.00%
glotpress wordpress i18n l10n comma-separated-values csv export format import hacktoberfest

gp-format-csv's Introduction

CSV Format for GlotPress

Adds the CSV format to GlotPress to export/import translations and originals.

WordPress Plugin Version WordPress Plugin Rating WordPress Plugin Downloads Sponsor

WordPress Plugin Required PHP Version WordPress Plugin: Required WP Version WordPress Plugin: Tested WP Version

Coding Standards Static Analysis WP Plugin Check Codacy Badge

Description

Adds the CSV format to GlotPress to export/import translations and originals.

This allows you to export a translation set to a CSV file, and use this to import the translations or originals into the project.

This plugin is properly prepared for localization.

The CSV Format

The CSV output has values separated by , and enclosured by " ".
The total number of columns depends on the number of Plural Forms of the exported Locale.
For an sample file, please check out example.csv.
The header columns for the different translations have the Translation (<plural-form>) naming convention, being the Plural Forms depending on each exported Locale.
See the example below for a Portuguese CSV export, which has 2 plural forms.

The exported CSV in plain text

"Context","Singular","Plural","Comments","References","Translation (Singular)","Translation (Plural)"
"","Singular in English.","","Comment 1.\nComment 2.","","Singular em Português.",""

The exported CSV in table format

Context Singular Plural Comments References Translation (Singular) Translation (Plural)
Singular in English. Comment 1.\nComment 2. Singular em Português.

The main columns

The 5 main columns are Context, Singular, Plural, Comments and References.

Context Singular Plural Comments References Translation(s)...
value value value value value
value value value value value

The Plural Forms variable columns

The number of Plural Forms columns may vary depending on each Locale setting.
Check the below table for examples of GlotPress Locales from 1 to 6 Plural Forms.

Locale (nplurals) ...References Translation (Singular) Translation (Plural 1) Translation (Plural 2) Translation (Plural 3) Translation (Plural 4) Translation (Plural 5)
Japanese (1) Translation (Single)
Portuguese (2) Translation (Singular) Translation (Plural)
Serbian (3) Translation (1, 21, 31) Translation (2, 3, 4) Translation (0, 5, 6)
Slovenian (4) Translation (1, 101, 201) Translation (2, 102, 202) Translation (3, 4, 103) Translation (0, 5, 6)
Irish (5) Translation (1) Translation (2) Translation (3, 4, 5) Translation (7, 8, 9) Translation (0, 11, 12)
Arabic (6) Translation (0) Translation (1) Translation (2) Translation (3, 4, 5) Translation (11, 12, 13) Translation (100, 101, 102)

Included filters

The gp_format_csv_header allows you to add, remove or customize items from the CSV header.
The gp_format_csv_row allows you to add, remove or customize items from the CSV row.

Usage

Export translations to CSV

  1. Go to the bottom of the translation table.
  2. Select CSV (.csv).
  3. Click on the Export link to download the CSV file.

Import translations from CSV

  1. Go to the bottom of the translation table.
  2. Click on the Import Translations link.
  3. Select the CSV file to upload, the Format is Auto Detected.
  4. Click on the Import button.

Import originals from CSV

  1. Go to the project page.
  2. On the project actions click on the Import Originals link.
  3. Select the CSV file to upload, the Format is Auto Detected.
  4. Click on the Import button.

Frequently Asked Questions

Can I help translating this plugin to my own language?

Yes you can! If you want to translate this plugin to your language, please click here.

Can I contribute to this plugin?

Sure! You are welcome to report any issues or add feature suggestions on the GitHub repository.

Changelog

1.0.2

  • Tested with WordPress 6.5.
  • Tested with GlotPress 4.0.
  • Tested with PHP 8.3.
  • Add WP Plugin Check CI test.
  • Update dependencies.

1.0.1

  • Fix log error message typo. Props @fxbenard.

1.0.0

  • Initial release.
  • All WPCS and PHPStan level 9 verified.

gp-format-csv's People

Contributors

dependabot[bot] avatar pedro-mendonca avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

alexclassroom

gp-format-csv's Issues

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.