Skip to content

Instantly share code, notes, and snippets.

View Dimitris1990's full-sized avatar

Dimitris Petrogiannis Dimitris1990

View GitHub Profile
@Dimitris1990
Dimitris1990 / potoyml.php
Last active February 13, 2024 14:21
Convert .po files from Drupal7 to .yml for Drupal9
<?php
/**
* First enable translation tracking (if it's disabled) by removing `collections.language.*`
* from /admin/config/development/configuration/ignore.
* After that, export all field translation .po files from the drupal7 site and save them
* in a directory in your project.
* The way the script is made requires some specifications:
* -The dir that the .po files are stored (e.g. /path/to/poFiles)
* -The dir that contains the language files (e.g. /path/to/config/sync/languages/)
* -The entities you want the translations from