Download the PHP package phpro/mage2-module-translations without Composer

On this page you can find all versions of the php package phpro/mage2-module-translations. 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 mage2-module-translations

Translation module for Magento 2

The Phpro_Translations module helps you to manage translations via the Magento backend.

Features

Installation

End user documentation

Download the end user documentation (PDF)

Usage (technical)

Locales

All locales must be defined in an ISO format. Locale = ISO-639 (language) + "_" + ISO-3166 (country).

Examples of locales: en_US, nl_BE, nl_NL, fr_BE, de_DE, ...

Import and export

Import Magento translation CSVs

CSV structure must be (key, value):

Use the phpro:translations:import command to import a CSV file for a given locale. Duplicate records are skipped and no updates are applied.

Output:

Export to CSV

Use the phpro:translations:export command to export database translations to a CSV file for one or more locales. Separate multiple locales with a space. The exported CSV file is written in the var/translations folder of Magento.

Output:

CSV structure:

Import CSV (including locale)

You can use the exported CSV file(s) to import on another environment. For example you can prepare new translations on a staging environment and import them later on a production environment.

CSV structure must be (key, value, locale):

Use the phpro:translations:import-full command to import a CSV file. Duplicate records are skipped and no updates are applied.

Output:

Import via backend

Go to System → (Data Transfer) → Import to create or update translations based on a CSV file. Please reach out our end user documentation.

Re-generate frontend translations

Generating/re-generating frontend translation will generate JSON file(s) which includes all the frontend/JS translations. These files are stored in the pub/media/phpro_translations directory in their related theme/locale subdirectory.

Via backend

Via CLI

Re-generate for single store view

Specify the storeId argument to re-generate for specific store view (locale). Use the bin/magento store:list command to show the store IDs.

Re-generate for all

Leave the storeId argument empty to re-generate for all store views.

During build process

We recommend to re-generate all frontend translations during your build process with phpro:translations:generate-frontend-translations after the setup:upgrade --keep-generated step and just before deactivating maintenance.

Browser cache optimizations

The translations JSON files are stored in the directory pub/media/phpro_translations with a specific version string. You can choose to have a these files optimally cached by browsers by configuring the Cache-Control header. A ngnix example below:

Collect translations from code base

Use the phpro:translations:prepare-keys command to collect translations phrases from the code base and prepare them. This will create a translation for every available locale.

Add translations during development

To prepare, create or delete translations you can inject \Phpro\Translations\Api\TranslationDataManagementInterface as dependency into your data patch script of your module.

Prepare

Add the translation key for all enabled locales of the Magento instance. If default translation is not set, the translation key will be used as default translation.

Create

Add a translation for given locales.

Delete

Delete a translation for given translation key and locale(s). In case no locales are given, all enabled locales will be used for deletion.

PWA

The checkbox "frontend" could be used to mark translations that need to be exported to a PWA installation. With a rest API call, the translations can be fetched and stored in the PWA translations files.

API call that can be used in build scripts

Hyvä

Install the Hyvä compatibilty module. Minimum version is 1.2.3.


All versions of mage2-module-translations with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
magento/framework Version ^102.0|^103.0
magento/module-backend Version ^101.0|^102.0
magento/module-ui Version ^101.0|^102.0
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 phpro/mage2-module-translations contains the following files

Loading the files please wait ....