Download the PHP package mathieumaingret/drup_csv2po without Composer

On this page you can find all versions of the php package mathieumaingret/drup_csv2po. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package drup_csv2po

Drup Csv2Po

Generates the PO files of a module or a theme from a CSV translation file, typically a Google Sheet exported as CSV. One PO file is written per language column found in the CSV.

Requirements

Setup

  1. Tell Drupal where the translation files of the module or theme live, in its own .info.yml:

  2. At /admin/config/regional/translate/settings, set Translation source overwrite to All.

  3. Declare the CSV URL in settings.php:

Usage

The command downloads the CSV, writes one PO file per language next to it, and points you to /admin/reports/translations to import them.

Which extension is translated

extension_name is looked up in the modules first, then in the themes. Without a value, the site's default theme is used. A name matching neither is rejected.

Options

Every option can be set in settings.php under $settings['drup_csv2po'], or passed to the command. The command line wins over settings.php, which wins over the defaults.

Option Default Description
extension_name the default theme Machine name of the module or theme to translate.
extension_translations_directory translations Directory, inside the extension, the files are written to.
csv_remote_url none URL the CSV is downloaded from. Required.
csv_output_filename translations.csv Name the downloaded CSV is saved under.
plural_value_separator PHP_EOL Separator between the singular and the plural value of a cell.
check_enabled_languages TRUE Only generate files for languages enabled on the site.
translations_source_langcode en Langcode of the column strings are translated from.

The canonical list is ConverterOptions::DEFAULTS.

CSV format

Column names are matched case insensitively.

Column Required Description
PAGE yes Grouping label. A comment banner is written whenever it changes. May be left empty on a row.
CONTEXT yes Translation context. May be left empty on a row.
PLURAL yes When filled, the source and translation cells hold a singular and a plural value, separated by plural_value_separator.
source langcode yes The strings to translate. EN unless translations_source_langcode says otherwise.
[LANGCODE] — One column per translation, named after the langcode.

A row is skipped when its source or its translation is empty, so a language column can be filled progressively.

Example

Safeguards


All versions of drup_csv2po with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
gettext/gettext Version ^5.7
league/csv Version ^9.14
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mathieumaingret/drup_csv2po contains the following files

Loading the files please wait ...